Skip to content

Conversation

HarshMN2345
Copy link
Member

@HarshMN2345 HarshMN2345 commented Aug 28, 2025

What does this PR do?

Add a console notification for Opt-in-Relationship Loading

Test Plan

image

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

  • New Features
    • Added a new bottom alert promoting opt-in relationship loading to reduce payload size.
    • Updated promo title, message, images (light/dark), and CTA to “Read announcement” with a link to the official blog post.
    • Scoped the promo to the current project for targeted visibility.
    • Reordered bottom alerts to prioritize this new promo above existing ones (Tables API, Timestamp Overrides).

Copy link

appwrite bot commented Aug 28, 2025

Console

Project ID: 688b7bf400350cbd60e9

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

Note

You can use Avatars API to generate QR code for any text or URLs.

Copy link
Contributor

coderabbitai bot commented Aug 28, 2025

Walkthrough

Replaced the general availability promo with an opt‑in relationship loading promo in cloud bottom alerts: swapped assets, renamed promo and ID, changed title/message/CTA/link/scope to project, and reordered promotions so the new promo appears first. Other promos unchanged.

Changes

Cohort / File(s) Summary
Bottom alerts promotions update
src/routes/(console)/bottomAlerts.ts
Replaced Appwrite general availability promo with opt‑in relationship loading promo: swapped image imports, renamed promo and ID, updated title, message, CTA text/link, set scope to project, and reordered promotions to push the new promo first; Tables API and Timestamp Overrides promos unchanged; no exported API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant UI as Console UI
  participant BA as bottomAlerts.ts
  participant Promo1 as OptInRelationPromo
  participant Promo2 as TablesApiPromo
  participant Promo3 as TimestampOverridesPromo

  rect rgb(235,245,255)
    note right of UI: On render
  end

  UI->>BA: request bottom alerts
  BA->>Promo1: load promo data (opt-in relation)
  BA->>Promo2: load promo data (tables API)
  BA->>Promo3: load promo data (timestamp overrides)
  BA->>UI: return ordered promos [OptInRelationPromo, TablesApiPromo, TimestampOverridesPromo]
  UI->>UI: display promos in received order
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I’m a rabbit on the code-lined lawn,
New promo hops up at early dawn.
Opt‑in sprouts, the payload’s light,
Tables nod and timestamps bite.
Thump, I push—deploy with a yawn. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-SER-328-CONSOLE-NOTIFCATION-Opt-in-loading

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@HarshMN2345 HarshMN2345 requested a review from ItzNotABug August 28, 2025 11:12
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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ba49247 and dd5c37f.

⛔ Files ignored due to path filters (4)
  • src/lib/images/promos/appwrite-general-availability-dark.png is excluded by !**/*.png
  • src/lib/images/promos/appwrite-general-availability-light.png is excluded by !**/*.png
  • src/lib/images/promos/opt-relation-dark.png is excluded by !**/*.png
  • src/lib/images/promos/opt-relation-light.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/routes/(console)/bottomAlerts.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/routes/(console)/bottomAlerts.ts (1)
src/lib/stores/bottom-alerts.ts (1)
  • BottomModalAlertItem (30-46)
⏰ 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 (3)
src/routes/(console)/bottomAlerts.ts (3)

67-67: Scope at project level LGTM

Matches the PR’s stated intent (project-scoped notification).


8-9: Assets verified – promo images present
opt-relation-dark.png (734 391 bytes) and opt-relation-light.png (269 745 bytes) exist under src/lib/images/promos/; no missing‐file risk.


56-58: No action needed: ID is unique and plan targeting is consistent
The id modal:opt_in_relation_announcement appears only once in bottomAlerts.ts, and its plan: 'free' matches the other promos.

message:
'Gain full control over which related documents to fetch and drastically reduce payload sizes.',
plan: 'free',
importance: 8,
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Confirm ordering logic; consider raising importance if priority must be first

You push the new promo first, but if downstream code sorts by importance, equal values (8) won’t guarantee top position. If it must lead, bump importance.

-        importance: 8,
+        importance: 9,

To verify behavior, check how items are ordered before rendering:

Also applies to: 76-76


🏁 Script executed:

#!/bin/bash
rg -n "showBottomModalAlert|importance" src -C3

Length of output: 11291


Stable sort confirmed; equal‐importance items preserve insertion order
BottomModalAlert.svelte sorts alerts by b.importance - a.importance (ES2019‐stable), so pushing your new promo first ensures it leads among importance 8 items. If you need it to outrank all others regardless of engine, bump its importance (e.g. to 9).

🤖 Prompt for AI Agents
In src/routes/(console)/bottomAlerts.ts around line 66 the promo alert is
assigned importance: 8 which ties with other alerts and relies on stable sort +
insertion order to lead; to guarantee it outranks all others regardless of
runtime, change its importance to a higher value (e.g. 9) so sorting will always
place it before importance 8 items.

Comment on lines +69 to 71
text: 'Read announcement',
link: () => 'https://appwrite.io/blog/post/announcing-opt-in-relationship-loading',
external: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Optional: standardize link format

Other promos mix long blog URLs and apwr.dev shortlinks. If you track via shortlinks, consider swapping to a managed redirect for consistency. No change required if long URL is preferred.

🤖 Prompt for AI Agents
In src/routes/(console)/bottomAlerts.ts around lines 69 to 71, the promo link is
using a full blog URL while other promos use apwr.dev shortlinks; standardize by
replacing the long URL with the project-managed shortlink (or vice‑versa if you
prefer long URLs) so all promos use the same format: update the link() to return
the chosen shortlink/redirect and verify any tracking/query params are preserved
and that external: true remains set.

Copy link
Member

Choose a reason for hiding this comment

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

please check with VD, the images and content refer documents and deprecated methods. we need newer ones.

@HarshMN2345 HarshMN2345 requested a review from ItzNotABug August 28, 2025 19:30
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: 1

♻️ Duplicate comments (4)
src/routes/(console)/bottomAlerts.ts (4)

63-64: Confirm product terminology: “rows” vs “documents”

Marketing copy should match product naming. If this targets Tables, “rows” is fine; if Databases, prefer “documents.” Please confirm with VD/Product, especially given earlier feedback about deprecated terms in assets/content.


62-62: Title casing consistency

Use title case to match the other promos.

-        title: 'Introducing Opt-in relationship loading',
+        title: 'Introducing Opt-in Relationship Loading',

66-66: Guarantee top placement regardless of sort stability

Currently ties at importance 8 and relies on stable sort + insertion order. If this must always lead, bump importance.

-        importance: 8,
+        importance: 9,

Also applies to: 76-76


69-71: Optional: standardize link format

Others use apwr.dev shortlinks. If you track via shortlinks, consider swapping to a managed redirect; otherwise keep as-is.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between dd5c37f and 41b5002.

⛔ Files ignored due to path filters (2)
  • src/lib/images/promos/opt-relation-dark.png is excluded by !**/*.png
  • src/lib/images/promos/opt-relation-light.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • src/routes/(console)/bottomAlerts.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/routes/(console)/bottomAlerts.ts (1)
src/lib/stores/bottom-alerts.ts (1)
  • BottomModalAlertItem (30-46)
⏰ 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 (3)
src/routes/(console)/bottomAlerts.ts (3)

8-9: Verify asset availability and consider lighter formats

Ensure both promo images exist at these paths and match dark/light themes. If WebP/AVIF variants are available, prefer them for smaller payloads.


56-61: Promo object shape looks correct

Fields align with BottomModalAlertItem and the id appears unique. No structural issues.


67-67: Scope choice is appropriate

Project scope matches the feature’s relevance. Good call.

Comment on lines +56 to 75
const optInRelationPromo: BottomModalAlertItem = {
id: 'modal:opt_in_relation_announcement',
src: {
dark: AppwriteGeneralAvailabiltyDark,
light: AppwriteGeneralAvailabiltyLight
dark: OptInRelationDark,
light: OptInRelationLight
},
title: 'Now Generally Available',
message: 'After 26 months of Appwrite Cloud, we are ready to remove the beta tag.',
title: 'Introducing Opt-in relationship loading',
message:
'Gain full control over which related rows to fetch and drastically reduce payload sizes.',
plan: 'free',
importance: 8,
scope: 'everywhere',
scope: 'project',
cta: {
text: 'Learn more',
link: () => 'https://apwr.dev/ygTXfxA',
text: 'Read announcement',
link: () => 'https://appwrite.io/blog/post/announcing-opt-in-relationship-loading',
external: true,
hideOnClick: true
},
show: true
};
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Consider cool-off to avoid re-showing after dismissal

If supported, set notificationHideOptions to prevent resurfacing across sessions/projects once closed.

Run to inspect existing usage patterns:


🏁 Script executed:

#!/bin/bash
# Find existing promos using notificationHideOptions and their shapes
rg -n -C2 'notificationHideOptions|BottomModalAlertItem' src

Length of output: 5135


Recommend adding notificationHideOptions to optInRelationPromo
Include notificationHideOptions on the new promo item so that once dismissed it won’t reappear across sessions or projects. Align the field with the NotificationCoolOffOptions shape in src/lib/stores/bottom-alerts.ts.

🤖 Prompt for AI Agents
In src/routes/(console)/bottomAlerts.ts around lines 56 to 75, the new
optInRelationPromo item is missing a notificationHideOptions field; add a
notificationHideOptions object matching the NotificationCoolOffOptions shape
from src/lib/stores/bottom-alerts.ts (use the modal id as the key and scope
'project') and set it to persist when dismissed so the promo does not reappear
across sessions/projects.

@HarshMN2345 HarshMN2345 requested a review from ItzNotABug August 29, 2025 06:13
@ItzNotABug ItzNotABug merged commit 98952cb into main Aug 29, 2025
4 of 5 checks passed
@ItzNotABug ItzNotABug deleted the feat-SER-328-CONSOLE-NOTIFCATION-Opt-in-loading branch August 29, 2025 06:19
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.

2 participants