Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file added src/lib/images/promos/opt-relation-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/images/promos/opt-relation-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 13 additions & 13 deletions src/routes/(console)/bottomAlerts.ts
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.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import TablesApiLight from '$lib/images/promos/tables-api-light.png';
import TablesApiDark from '$lib/images/promos/tables-api-dark.png';
import TimestampOverridesDark from '$lib/images/promos/timestamp-overrides-dark.png';
import TimestampOverridesLight from '$lib/images/promos/timestamp-overrides-light.png';
import AppwriteGeneralAvailabiltyLight from '$lib/images/promos/appwrite-general-availability-light.png';
import AppwriteGeneralAvailabiltyDark from '$lib/images/promos/appwrite-general-availability-dark.png';
import OptInRelationDark from '$lib/images/promos/opt-relation-dark.png';
import OptInRelationLight from '$lib/images/promos/opt-relation-light.png';

const listOfPromotions: BottomModalAlertItem[] = [];

Expand Down Expand Up @@ -53,27 +53,27 @@ if (isCloud) {
show: true
};

const appwriteGeneralAvailabiltyPromo: BottomModalAlertItem = {
id: 'modal:appwrite_general_availability_announcement',
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,
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.

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,
Comment on lines +69 to 71
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.

hideOnClick: true
},
show: true
};
Comment on lines +56 to 75
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.


listOfPromotions.push(tablesApiPromo, timestampOverridesPromo, appwriteGeneralAvailabiltyPromo);
listOfPromotions.push(optInRelationPromo, tablesApiPromo, timestampOverridesPromo);
}

export function addBottomModalAlerts() {
Expand Down
Loading