-
Notifications
You must be signed in to change notification settings - Fork 191
feat: notification for opt in loading #2274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: notification for opt in loading #2274
Conversation
ConsoleProject ID: Sites (2)
Note You can use Avatars API to generate QR code for any text or URLs. |
WalkthroughReplaced 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
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 unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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.
⛔ 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 LGTMMatches 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 undersrc/lib/images/promos/
; no missing‐file risk.
56-58
: No action needed: ID is unique and plan targeting is consistent
The idmodal:opt_in_relation_announcement
appears only once inbottomAlerts.ts
, and itsplan: 'free'
matches the other promos.
message: | ||
'Gain full control over which related documents to fetch and drastically reduce payload sizes.', | ||
plan: 'free', | ||
importance: 8, |
There was a problem hiding this comment.
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.
text: 'Read announcement', | ||
link: () => 'https://appwrite.io/blog/post/announcing-opt-in-relationship-loading', | ||
external: true, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 consistencyUse 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 stabilityCurrently 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 formatOthers 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.
⛔ 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 formatsEnsure 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 correctFields align with BottomModalAlertItem and the id appears unique. No structural issues.
67-67
: Scope choice is appropriateProject scope matches the feature’s relevance. Good call.
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 | ||
}; |
There was a problem hiding this comment.
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.
What does this PR do?
Add a console notification for Opt-in-Relationship Loading
Test Plan
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