Skip to content

Conversation

HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Sep 29, 2025

What does this PR do?

image image image

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

yes

Summary by CodeRabbit

  • Refactor

    • Header replaced with a responsive container that groups search and quick filters into a dedicated row; wizard header now renders only when title or subtitle exists.
  • UX

    • "Schedule" label renamed to "Settings" in creation flows; option renamed to "Custom" and date/time inputs show only when scheduling later.
    • Empty states: documentation link shown inline and opens in a new tab.
    • Action labels changed from "Add" to "Create"; Create button moved to footer and triggers form submission.
    • Success message shortened ("X subscriber(s) have been added").
  • Style

    • Popover placement adjusted for improved alignment; image previews constrained for narrower popover width.

Copy link

appwrite bot commented Sep 29, 2025

Console

Project ID: 688b7bf400350cbd60e9

Sites (2)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code
 console-cloud
688b7c18002b9b871a8f
Failed Failed View Logs Preview URL QR Code

Note

Appwrite has a Discord community with over 16 000 members.

Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Walkthrough

This PR makes targeted UI and layout changes across the messaging console: restructures the non-small responsive header DOM to move QuickFilters into a row-aligned inner Layout.Stack; replaces an inline two-column header with ResponsiveContainerHeader on the providers page; adjusts empty-state and popover presentations (documentation link placement, image wrapper, popover placements); adds form binding to enable programmatic submit; changes schedule formatting and labels; conditionally renders wizard step headers; and applies several small copy and button-label tweaks.

Possibly related PRs

Suggested reviewers

  • ItzNotABug

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title Check ❓ Inconclusive The title “fix: Resolve issues in Messaging screens” is overly broad and does not convey the specific changes made in this pull request, such as the introduction of ResponsiveContainerHeader, layout adjustments in various components, and updates to UI labels and popover placements. While it indicates that messaging screens were modified, it fails to highlight the primary refactor or the most impactful change. As a result, a reviewer scanning the commit history would not immediately understand the core update without diving into the details of the diff. The use of a catch-all phrase like “resolve issues” makes the title generic rather than informative. Please revise the title to clearly summarize the main change, for example by referencing the key refactor to the messaging header layout or specific UI fixes (e.g., “refactor messaging header to use ResponsiveContainerHeader and adjust popover placements”).
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-SER-416-issues-in-messaging-screens

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3393329 and 71997d2.

📒 Files selected for processing (1)
  • src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: e2e
🔇 Additional comments (2)
src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte (2)

24-25: LGTM! Form ref binding enables programmatic submission.

The form reference is properly typed and bound, allowing the footer button to trigger submission programmatically.

Also applies to: 190-190


245-249: LGTM! Footer submission control follows UI patterns.

The footer slot cleanly separates the action button from the form content and properly triggers submission via the form reference.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@HarshMN2345 HarshMN2345 changed the title fix: move filters button to right side and fix search placeholder fix: Resolve issues in Messaging screens Sep 30, 2025
@vermakhushboo vermakhushboo marked this pull request as draft September 30, 2025 11:49
@HarshMN2345 HarshMN2345 marked this pull request as ready for review September 30, 2025 15:01
@HarshMN2345 HarshMN2345 self-assigned this Sep 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (6)
src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte (2)

24-25: Use proper typing instead of any for formRef.

The any type removes type safety and IntelliSense support. Consider using the appropriate Form component type.

Apply this diff to improve type safety:

-let formRef: any;
+let formRef: { triggerSubmit: () => void };

Alternatively, if the Form component exports a specific type, use that instead.


245-249: Guard against undefined formRef on Create button click.
formRef is assigned asynchronously—use optional chaining to avoid runtime errors:

-        <Button on:click={() => formRef.triggerSubmit()}>Create</Button>
+        <Button on:click={() => formRef?.triggerSubmit()}>Create</Button>
src/routes/(console)/project-[region]-[project]/messaging/topicsModal.svelte (2)

121-123: Consider removing this intermediate state.

The topicSelectionStates reactive statement creates an intermediate mapping that just derives !!selected[id]. This can be computed directly in the template without the extra reactive state.

The checkbox at line 147 could directly use:

-checked={topicSelectionStates[topicId] || false}
+checked={!!selected[topicId]}

And remove lines 121-123 entirely. This simplifies the code without changing behavior.


35-46: Approve getTopicTotal and recommend consolidating mapping logic
The new helper cleanly handles Email, Sms, and Push totals with a safe default. Similar provider-type→total mappings appear in sendModal.svelte, scheduleModal.svelte, wizard/store.ts, wizard/step3.svelte, and targets.svelte; consider extracting this switch into a shared utility module to remove duplication.

src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/(components)/schedule.svelte (2)

32-38: Consider whether displaying seconds is necessary.

The timeOptions includes second: 'numeric', which will display seconds in the helper text (line 76-79). Since users can only select date, hour, and minute in the input fields (InputTime at line 67), the seconds will always be :00. Consider removing the seconds from the display format for a cleaner UX.

Apply this diff if you'd like to remove seconds from the display:

 const timeOptions: Intl.DateTimeFormatOptions = {
     hour: 'numeric',
     minute: 'numeric',
-    second: 'numeric',
     hourCycle: 'h23',
     timeZoneName: 'longGeneric'
 };

76-79: Use a dynamic locale instead of hardcoding 'en'.
In schedule.svelte, both toLocaleDateString('en', …) and toLocaleTimeString('en', …) should consume a locale value (for example, from user preferences or $page.data.locale) rather than the fixed 'en'.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dbee85e and 3393329.

📒 Files selected for processing (11)
  • src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/(components)/schedule.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/email.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/push.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/sms.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/createMessageDropdown.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte (4 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/providers/createProviderDropdown.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/providers/popoverContent.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.svelte (2 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/topicsModal.svelte (4 hunks)
  • src/routes/(console)/project-[region]-[project]/messaging/userTargetsModal.svelte (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/push.svelte
🔇 Additional comments (12)
src/routes/(console)/project-[region]-[project]/messaging/providers/createProviderDropdown.svelte (1)

12-12: LGTM! Popover alignment improved.

The placement change from bottom-end to bottom-start improves the UI alignment by anchoring the dropdown to the left edge of the trigger button, which is consistent with the identical change in createMessageDropdown.svelte.

src/routes/(console)/project-[region]-[project]/messaging/createMessageDropdown.svelte (1)

10-10: LGTM! Consistent popover alignment.

The placement change from bottom-end to bottom-start matches the identical update in createProviderDropdown.svelte, ensuring consistent dropdown alignment across the messaging interface.

src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/sms.svelte (1)

118-120: LGTM! Label updated for consistency.

The fieldset legend change from "Schedule" to "Settings" aligns with similar updates across other messaging create views (email, push). This provides a more generic grouping that can accommodate additional settings beyond scheduling if needed in the future.

src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/email.svelte (1)

136-138: LGTM! Consistent label update.

The fieldset legend change from "Schedule" to "Settings" matches the update in sms.svelte, maintaining consistency across all messaging create flows.

src/routes/(console)/project-[region]-[project]/messaging/providers/popoverContent.svelte (3)

3-3: LGTM!

The Layout import is correctly added to support the new Layout.Stack wrapper.


15-17: Clarify the purpose of the Layout.Stack wrapper and "image-wrapper" class.

The ImagePreview is now wrapped in Layout.Stack with an "image-wrapper" class, but no corresponding CSS rules are defined in this file. Please verify:

  1. Does the Layout.Stack component provide the necessary styling, or is the "image-wrapper" class styled globally?
  2. What specific layout issue does this wrapper address?

9-9: LGTM!

The width constraint using max-inline-size is well-implemented. Using logical properties respects writing direction and improves internationalization support.

Also applies to: 22-24

src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte (1)

190-190: LGTM!

The Form binding is correctly implemented and preserves the existing onSubmit handler.

src/routes/(console)/project-[region]-[project]/messaging/topics/topic-[topic]/+page.svelte (2)

74-74: LGTM! Improved notification message with count and pluralization.

The updated notification message provides better user feedback by showing the exact number of subscribers added with correct pluralization.


147-147: LGTM! Cleaner inline link text.

The shortened "Learn more" text is more concise while remaining clear in context.

src/routes/(console)/project-[region]-[project]/messaging/create-[type]/(type)/(components)/schedule.svelte (2)

24-24: LGTM! Better label clarity.

Changing the option label from "Schedule" to "Custom" improves clarity, especially now that the select field itself has the label "Schedule" (line 63). The options "Now" vs "Custom" are more intuitive than "Now" vs "Schedule".


63-69: LGTM! Good UX improvement.

The changes improve the user experience:

  • Adding a "Schedule" label to the select makes the form clearer
  • Conditionally rendering date/time inputs only when "Custom" is selected reduces visual clutter
  • The horizontal layout for date and time inputs is intuitive

The required validation and data binding remain intact.

Comment on lines +229 to +231
icon={IconBookOpen}
target="_blank"
rel="noreferrer" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Add noopener to the rel attribute for security.

When using target="_blank", best practice is to include both noopener and noreferrer to prevent security vulnerabilities (tabnapping) and ensure privacy.

Apply this diff:

         icon={IconBookOpen}
         target="_blank"
-        rel="noreferrer" />
+        rel="noopener noreferrer" />
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
icon={IconBookOpen}
target="_blank"
rel="noreferrer" />
icon={IconBookOpen}
target="_blank"
rel="noopener noreferrer" />
🤖 Prompt for AI Agents
In
src/routes/(console)/project-[region]-[project]/messaging/providers/create.svelte
around lines 229 to 231, the anchor with target="_blank" currently uses
rel="noreferrer"; update the rel attribute to include noopener as well (e.g.
rel="noopener noreferrer") to prevent tabnapping while preserving privacy.

<span>Topics selected</span>
</Layout.Stack>
<Button submit disabled={!hasSelection}>Add</Button>
<Button submit disabled={!hasSelection}>Create</Button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reconsider the button label change from "Add" to "Create".

Similar to the change in userTargetsModal.svelte, this modal's purpose is to select existing topics to send a message to. The button label "Add" more accurately describes this action (adding selected topics to the message), whereas "Create" suggests creating new topics.

Consider reverting to "Add" or using "Add topics" for semantic clarity.

🤖 Prompt for AI Agents
In src/routes/(console)/project-[region]-[project]/messaging/topicsModal.svelte
around line 193, the button label was changed from "Add" to "Create" but this
modal selects existing topics rather than creating new ones; change the button
text back to "Add" (or to a clearer phrase like "Add topics") to reflect that
the action attaches selected topics to the message rather than creating topics,
updating the Button component label accordingly.

<span>Users selected</span>
</Layout.Stack>
<Button submit disabled={!hasSelection}>Add</Button>
<Button submit disabled={!hasSelection}>Create</Button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reconsider the button label change from "Add" to "Create".

The modal's purpose is to select existing user targets to add as subscribers to a topic. The button label "Add" more accurately describes this action, whereas "Create" suggests creating new entities. The underlying logic (addTargets handler in the parent component) does create subscriber records, but from the user's perspective in this modal, they're selecting/adding targets, not creating them.

Consider reverting to "Add" or using "Add subscribers" for semantic clarity.

🤖 Prompt for AI Agents
In
src/routes/(console)/project-[region]-[project]/messaging/userTargetsModal.svelte
around line 219, the button label was changed to "Create" but the modal's action
is selecting/adding existing user targets; change the label back to "Add" or a
clearer label like "Add subscribers" to accurately reflect the UX. Update the
Button text prop/value accordingly so it reads "Add" or "Add subscribers" and
ensure any aria-labels or tests referencing the old label are updated to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant