Skip to content

feat: add realtime connections and messages metrics to usage reports#2934

Open
lohanidamodar wants to merge 11 commits intomainfrom
chore/usage-update
Open

feat: add realtime connections and messages metrics to usage reports#2934
lohanidamodar wants to merge 11 commits intomainfrom
chore/usage-update

Conversation

@lohanidamodar
Copy link
Member

@lohanidamodar lohanidamodar commented Mar 26, 2026

What does this PR do?

(Provide a description of what this PR does.)

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?

(Write your answer here.)

Summary by CodeRabbit

  • New Features

    • Realtime metrics: connections, messages, and bandwidth — charts, project breakdowns, and historical views across billing and usage pages
    • Pay-as-you-go pricing rows shown where applicable
    • Cloud-only dismissible pricing alert banner with a “View usage” action
  • Chores

    • Updated package configuration: refreshed console package reference, bumped/removed dependencies, and added dependency overrides

@appwrite
Copy link

appwrite bot commented Mar 26, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Build commands execute in runtime containers during deployment

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 26, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Updates add realtime billing and usage features and dependency tweaks. package.json updates include swapping an @appwrite.io/console tarball, bumping nanotar, removing flatted from dependencies and adding several overrides. Code changes add realtime metrics (connections, messages, bandwidth): extend PlanServices and Metric unions, treat realtimeMessages as billable, extend usage load fallback with realtime fields, add realtime UI cards on organization and project usage pages, add project and billing table rows, introduce a realtimePricing HeaderAlert component and register it in layout, and simplify rendering in a billing component.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding realtime connections and messages metrics to usage reports, which aligns with the substantial updates across multiple billing and usage components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/usage-update

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

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

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 26, 2026

Greptile Summary

This PR adds realtime connections, messages, and bandwidth metrics to both the organization-level and project-level usage reports, along with supporting billing plan summary and usage rate display. The implementation follows existing patterns for other metrics (bar charts, progress bars, project breakdowns, empty states).

Key changes:

  • New CardGrid sections for realtime connections, messages, and bandwidth on both the org and project usage pages
  • realtimeMessages added to the PlanServices union and checkForUsageFees in billing.ts
  • New rows in planSummary.svelte for all three realtime resource types
  • usageRates.svelte now renders a pay-as-you-go row for resources with a price but no hard limit
  • SDK bumped to ce4304a to pull in the new API fields; as any is used as a temporary workaround until types propagate

One concrete inconsistency: the early-return stub in +page.ts was updated with realtimeConnections/realtimeMessages fields but is missing realtimeBandwidth and realtimeBandwidthTotal, which diverges from the null-for-everything pattern used by every other field in that block.

Confidence Score: 4/5

Safe to merge after adding the two missing realtimeBandwidth null fields to the early-return stub.

The feature implementation is complete and consistent with existing patterns; the only concrete bug is the missing realtimeBandwidth/realtimeBandwidthTotal nulls in the org-level early-return which won't crash (the UI falls through to the empty state) but is an observable inconsistency. The as any cast is an acknowledged temporary workaround tied to the SDK bump. One targeted fix keeps this from a 5.

src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts — missing realtimeBandwidth fields in the early-return stub.

Important Files Changed

Filename Overview
src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts Early-return stub is missing realtimeBandwidth and realtimeBandwidthTotal fields — inconsistent with every other field which is explicitly null.
src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte Adds three new CardGrid sections for realtime connections, messages, and bandwidth with charts and project breakdowns; uses as any cast to work around missing SDK types.
src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte Adds realtime, realtimeMessages, and realtimeBandwidth to the Metric union and wires them into the format/display functions correctly.
src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte Adds project-level realtime connections, messages, and bandwidth cards with bar charts; mirrors the org-level approach and handles null/undefined safely.
src/lib/stores/billing.ts Adds realtimeMessages to PlanServices union and the checkForUsageFees switch, consistent with how realtime is already handled.
src/routes/(console)/organization-[organization]/billing/planSummary.svelte Adds realtime connections, messages, and bandwidth rows to the plan summary table using existing createResourceRow/createRow helpers correctly.
src/lib/components/billing/usageRates.svelte Adds a pay-as-you-go row for usage items where limit === false but usage.price > 0; minor code cleanup of intermediate show variable.
package.json Bumps @appwrite.io/console SDK to ce4304a; inadvertently adds extra indentation to the cron-parser line.
bun.lock Lockfile update reflecting the SDK hash change from 41152f5 to ce4304a.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte (1)

97-109: ⚠️ Potential issue | 🟠 Major

Handle screenshotsGenerated in format().

The organization usage page still passes metric="screenshotsGenerated" into this component, but this switch never formats that case, so those breakdown rows end up with an empty Usage cell.

Suggested fix
         switch (metric) {
             case 'imageTransformations':
+            case 'screenshotsGenerated':
             case 'authPhoneTotal':
                 return formatNumberWithCommas(value);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte
around lines 97 - 109, The switch in the format(...) function inside
ProjectBreakdown.svelte is missing a case for 'screenshotsGenerated', causing
empty usage cells; add a case 'screenshotsGenerated' (alongside
'imageTransformations'/'authPhoneTotal') and return
formatNumberWithCommas(value) so screenshot counts render correctly. Ensure you
update the same switch block in the format function so other metrics keep their
existing formatting.
🧹 Nitpick comments (1)
src/lib/components/billing/usageRates.svelte (1)

84-95: Consider de-duplicating the usage row rendering.

Lines 84-95 repeat most of the same row/rate markup from the limit !== false branch. You can compute the limit label once and render a single row path.

♻️ Suggested simplification
 {`#each` Object.entries(org.billingPlanDetails.usage) as [key, usage]}
     {`@const` limit = getPlanLimit(key)}
-    {`#if` limit !== false}
+    {`@const` limitLabel =
+        limit !== false
+            ? `${abbreviateNumber(limit)}${usage.unit}`
+            : usage.price > 0
+                ? 'Pay-as-you-go'
+                : null}
+    {`#if` limitLabel}
         <Table.Row.Base {root}>
             <Table.Cell column="resource" {root}>{usage.name}</Table.Cell>
-            <Table.Cell column="limit" {root}>
-                {abbreviateNumber(limit)}{usage.unit}
-            </Table.Cell>
+            <Table.Cell column="limit" {root}>{limitLabel}</Table.Cell>
             {`#if` !isFree}
                 <Table.Cell column="rate" {root}>
                     {formatCurrency(usage.price)}/{abbreviateNumber(
                         usage.value
                     )}{usage.unit}
                 </Table.Cell>
             {/if}
         </Table.Row.Base>
-    {:else if usage.price > 0}
-        <Table.Row.Base {root}>
-            <Table.Cell column="resource" {root}>{usage.name}</Table.Cell>
-            <Table.Cell column="limit" {root}>Pay-as-you-go</Table.Cell>
-            {`#if` !isFree}
-                <Table.Cell column="rate" {root}>
-                    {formatCurrency(usage.price)}/{abbreviateNumber(
-                        usage.value
-                    )}{usage.unit}
-                </Table.Cell>
-            {/if}
-        </Table.Row.Base>
     {/if}
 {/each}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/components/billing/usageRates.svelte` around lines 84 - 95, The two
branches render almost identical Table.Row.Base markup; compute a single limit
label (e.g., const limitLabel = usage.limit !== false ? usage.limit :
'Pay-as-you-go') before the template and render one Table.Row.Base path that
uses limitLabel and conditionally renders the rate cell when !isFree (using
existing formatCurrency, abbreviateNumber, usage.unit), replacing the duplicated
row in both the `limit !== false` and `usage.price > 0` branches so only one row
template remains.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 37: The "cron-parser" dependency line in package.json has extra leading
whitespace causing malformed JSON/formatting errors; edit the package.json
dependency block and normalize the indentation to match the other entries (align
"cron-parser": "^4.9.0" with the same 8-space indentation used by the
surrounding dependency entries) so the JSON is properly formatted and passes
prettier/JSON parsing.
- Line 94: The package override for the transitive dependency "flatted" pins an
insecure version (^3.4.0) vulnerable to CVE-2026-33228; update the override in
package.json to "^3.4.2" (minimum secure version) and re-run your package
manager (npm/yarn/pnpm install) and dependency resolution to ensure no conflicts
with other pinned versions, then run npm/yarn audit (or equivalent) and the test
suite to confirm the upgrade is safe.

In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/+page.svelte:
- Around line 36-37: Replace the unsafe cast by giving orgUsage an explicit
inline type instead of "as any" in the +page.svelte file (e.g., declare $:
orgUsage: { projects: ..., usage: ..., realtimeBandwidth: number;
realtimeBandwidthTotal: number; /* include other used fields */ } =
data.organizationUsage) so template accesses remain typed, and update the
fallback object defined in +page.ts to include realtimeBandwidth and
realtimeBandwidthTotal (with sensible default numeric values) so the template's
realtime fields never guard-fail; ensure the property names exactly match
realtimeBandwidth and realtimeBandwidthTotal and that any other realtime fields
referenced in the template are present in the fallback object.

In `@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/+page.ts:
- Around line 38-42: The migration fallback object is missing realtime bandwidth
fields and should match the normal load shape; update the fallback that
currently sets screenshotsGeneratedTotal, realtimeConnections,
realtimeConnectionsTotal, realtimeMessages, and realtimeMessagesTotal to also
include realtimeBandwidth and realtimeBandwidthTotal (set both to null) so
organizationUsage and any code reading organizationUsage.realtimeBandwidth and
organizationUsage.realtimeBandwidthTotal will receive the same shape as the
regular load path.

---

Outside diff comments:
In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte:
- Around line 97-109: The switch in the format(...) function inside
ProjectBreakdown.svelte is missing a case for 'screenshotsGenerated', causing
empty usage cells; add a case 'screenshotsGenerated' (alongside
'imageTransformations'/'authPhoneTotal') and return
formatNumberWithCommas(value) so screenshot counts render correctly. Ensure you
update the same switch block in the format function so other metrics keep their
existing formatting.

---

Nitpick comments:
In `@src/lib/components/billing/usageRates.svelte`:
- Around line 84-95: The two branches render almost identical Table.Row.Base
markup; compute a single limit label (e.g., const limitLabel = usage.limit !==
false ? usage.limit : 'Pay-as-you-go') before the template and render one
Table.Row.Base path that uses limitLabel and conditionally renders the rate cell
when !isFree (using existing formatCurrency, abbreviateNumber, usage.unit),
replacing the duplicated row in both the `limit !== false` and `usage.price > 0`
branches so only one row template remains.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c90fe848-0ef2-4ac3-8cf9-270479c9a415

📥 Commits

Reviewing files that changed from the base of the PR and between 2f102ff and 15cec0a.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (8)
  • package.json
  • src/lib/components/billing/usageRates.svelte
  • src/lib/stores/billing.ts
  • src/routes/(console)/organization-[organization]/billing/planSummary.svelte
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/ProjectBreakdown.svelte
  • src/routes/(console)/project-[region]-[project]/settings/usage/[[invoice]]/+page.svelte

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

🧹 Nitpick comments (2)
src/lib/components/billing/alerts/realtimePricing.svelte (1)

4-5: Combine imports from the same module.

✨ Suggested improvement
-    import { organization } from '$lib/stores/organization';
-    import { currentPlan } from '$lib/stores/organization';
+    import { organization, currentPlan } from '$lib/stores/organization';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/components/billing/alerts/realtimePricing.svelte` around lines 4 - 5,
Two separate imports from the same module should be combined into a single
import to clean up the import statements; replace the two lines importing
organization and currentPlan from '$lib/stores/organization' with a single
import that destructures both symbols (organization, currentPlan) in one
statement in realtimePricing.svelte so both stores are imported together.
src/routes/(console)/organization-[organization]/+layout.ts (1)

68-75: Consider extracting the cutoff date as a named constant.

The hardcoded date string '2026-04-22' is a magic value. Extracting it as a constant improves readability and makes future updates easier.

✨ Suggested improvement
+const REALTIME_PRICING_CUTOFF = new Date('2026-04-22');
+
 // Inside load function:
-        if (isCloud && new Date() < new Date('2026-04-22')) {
+        if (isCloud && new Date() < REALTIME_PRICING_CUTOFF) {
             headerAlert.add({
                 show: true,
                 component: RealtimePricing,
                 id: 'realtimePricing',
                 importance: 1
             });
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/routes/`(console)/organization-[organization]/+layout.ts around lines 68
- 75, Extract the hardcoded cutoff date '2026-04-22' into a named constant
(e.g., REALTIME_PRICING_CUTOFF or REALTIME_PRICING_CUTOFF_DATE) and use that
constant in the conditional instead of the literal string; update the check
within the +layout.ts block that references isCloud and new Date(...) so it
compares new Date() to new Date(REALTIME_PRICING_CUTOFF) and keep the
headerAlert.add call (component: RealtimePricing, id: 'realtimePricing')
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/lib/components/billing/alerts/realtimePricing.svelte`:
- Line 10: The top-level access to localStorage is causing SSR crashes; change
the dismissed initialization in realtimePricing.svelte (the dismissed variable
that uses DISMISS_KEY) so it does not read localStorage on the server — e.g.,
initialize dismissed to a safe default (false) and then in Svelte's onMount
lifecycle (or guard with typeof window !== 'undefined' / the Svelte `browser`
flag) read localStorage.getItem(DISMISS_KEY) and update dismissed accordingly;
ensure any writes to localStorage (when dismissing) also only run in the
browser.

---

Nitpick comments:
In `@src/lib/components/billing/alerts/realtimePricing.svelte`:
- Around line 4-5: Two separate imports from the same module should be combined
into a single import to clean up the import statements; replace the two lines
importing organization and currentPlan from '$lib/stores/organization' with a
single import that destructures both symbols (organization, currentPlan) in one
statement in realtimePricing.svelte so both stores are imported together.

In `@src/routes/`(console)/organization-[organization]/+layout.ts:
- Around line 68-75: Extract the hardcoded cutoff date '2026-04-22' into a named
constant (e.g., REALTIME_PRICING_CUTOFF or REALTIME_PRICING_CUTOFF_DATE) and use
that constant in the conditional instead of the literal string; update the check
within the +layout.ts block that references isCloud and new Date(...) so it
compares new Date() to new Date(REALTIME_PRICING_CUTOFF) and keep the
headerAlert.add call (component: RealtimePricing, id: 'realtimePricing')
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e90e0d1a-149a-4b8b-bfdd-8d96575f1daa

📥 Commits

Reviewing files that changed from the base of the PR and between 15cec0a and f85e462.

📒 Files selected for processing (2)
  • src/lib/components/billing/alerts/realtimePricing.svelte
  • src/routes/(console)/organization-[organization]/+layout.ts

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.

🧹 Nitpick comments (1)
src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte (1)

523-523: Keep the realtime bandwidth card spacing consistent with the other usage cards.

This CardGrid is the only card in this block that drops gap="none", so it will render with different internal spacing than its siblings.

♻️ Proposed fix
-    <CardGrid>
+    <CardGrid gap="none">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/+page.svelte
at line 523, The realtime bandwidth CardGrid is using gap="none" which makes its
internal spacing differ from sibling usage cards; update the CardGrid instance
inside the realtime bandwidth block (the CardGrid element) to use the same gap
prop as the other usage cards (either remove gap="none" or set it to the same
gap value the other CardGrid components use) so spacing is consistent across
cards.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/+page.svelte:
- Line 523: The realtime bandwidth CardGrid is using gap="none" which makes its
internal spacing differ from sibling usage cards; update the CardGrid instance
inside the realtime bandwidth block (the CardGrid element) to use the same gap
prop as the other usage cards (either remove gap="none" or set it to the same
gap value the other CardGrid components use) so spacing is consistent across
cards.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6682a3c6-93f3-4187-bec9-f81a2bed6085

📥 Commits

Reviewing files that changed from the base of the PR and between f85e462 and b64ba68.

📒 Files selected for processing (4)
  • package.json
  • src/lib/components/billing/alerts/realtimePricing.svelte
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts
✅ Files skipped from review due to trivial changes (1)
  • src/lib/components/billing/alerts/realtimePricing.svelte
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.ts
  • package.json

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.

🧹 Nitpick comments (2)
src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte (1)

520-520: Minor inconsistency: missing gap="none" prop.

All other CardGrid components in this file use gap="none", but this one doesn't. Consider adding it for consistency.

Suggested fix
-    <CardGrid>
+    <CardGrid gap="none">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/+page.svelte
at line 520, The CardGrid instance at the shown location is missing the
gap="none" prop used elsewhere; update that CardGrid component (the <CardGrid>
element in +page.svelte) to include gap="none" for visual consistency by
changing it to include the gap="none" attribute on the CardGrid component.
src/lib/components/billing/alerts/realtimePricing.svelte (1)

19-21: Consider optional chaining on $organization for defensive coding.

While the template guards with $organization?.$id, the reactive href statement evaluates independently. If $currentPlan changes before $organization is loaded, accessing $organization.$id could throw.

Suggested fix
     $: href = $currentPlan?.usagePerProject
-        ? `${base}/organization-${$organization.$id}/billing`
-        : `${base}/organization-${$organization.$id}/usage`;
+        ? `${base}/organization-${$organization?.$id}/billing`
+        : `${base}/organization-${$organization?.$id}/usage`;

Based on learnings: "billingPlanDetails is cloud-only in the Appwrite Console. When accessing billing-related properties in any Svelte file, guard with isCloud or use defensive access (e.g., optional chaining or explicit null checks)."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/lib/components/billing/alerts/realtimePricing.svelte` around lines 19 -
21, The reactive href assignment using $currentPlan and $organization may access
$organization.$id before $organization is defined; update the reactive statement
that assigns href (the "$: href = ..." line referencing $currentPlan,
$organization and base) to defensively access $organization (e.g., use optional
chaining or an explicit null/undefined check on $organization before using
$organization.$id) so the expression safely falls back to the usage path or a
safe default when $organization is not yet loaded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/lib/components/billing/alerts/realtimePricing.svelte`:
- Around line 19-21: The reactive href assignment using $currentPlan and
$organization may access $organization.$id before $organization is defined;
update the reactive statement that assigns href (the "$: href = ..." line
referencing $currentPlan, $organization and base) to defensively access
$organization (e.g., use optional chaining or an explicit null/undefined check
on $organization before using $organization.$id) so the expression safely falls
back to the usage path or a safe default when $organization is not yet loaded.

In
`@src/routes/`(console)/organization-[organization]/usage/[[invoice]]/+page.svelte:
- Line 520: The CardGrid instance at the shown location is missing the
gap="none" prop used elsewhere; update that CardGrid component (the <CardGrid>
element in +page.svelte) to include gap="none" for visual consistency by
changing it to include the gap="none" attribute on the CardGrid component.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8b6bfead-65cf-42ac-bd9f-d6aeab12a7ea

📥 Commits

Reviewing files that changed from the base of the PR and between e7e00d5 and 4fc6269.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • package.json
  • src/lib/components/billing/alerts/realtimePricing.svelte
  • src/routes/(console)/organization-[organization]/usage/[[invoice]]/+page.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

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