Skip to content

Conversation

ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Aug 31, 2025

What does this PR do?

  1. Fixes layout for top level database page for table lists, backups, usage and settings on wider screens.
  2. Remove total table usage card inside the Table > Usage.

Test Plan

Manual.

Related PRs and Issues

N/A.

Have you read the Contributing Guidelines on issues?

Yes.

Summary by CodeRabbit

  • New Features

    • Introduced a databasesMainScreen layout variant for database pages, optimizing widths at larger viewports.
    • Added paddingInlineEndDouble option for enhanced spacing on wide screens.
  • Refactor

    • Consolidated Container’s public API; content is now provided via a children prop.
    • Replaced multiple legacy flags with a simplified prop interface.
    • Updated header to use the new databasesMainScreen prop.
  • Style

    • Refined responsive sizing and padding for containers and cover on large screens.
    • Unified layouts on Databases, Backups, Settings, and Usage pages for consistency.

@ItzNotABug ItzNotABug self-assigned this Aug 31, 2025
Copy link

appwrite bot commented Aug 31, 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

coderabbitai bot commented Aug 31, 2025

Walkthrough

The Container component (src/lib/layout/container.svelte) was refactored from multiple exported props to a consolidated $props() API: individual exports (expanded, slotSpacing, overlapCover, paddingInlineEnd, insideSideSheet, databasesScreen, expandHeightButton, size) were removed; new public props include children (Snippet), paddingInlineEndDouble (boolean), and databasesMainScreen (boolean). Content rendering moved from a slot to {@render children?.()}. Styling uses a derived store to compute CSS variables and arbitrary props are forwarded via restProps. New classes/CSS variants for paddingInlineEndDouble and databasesMainScreen were added. Several database-related pages and cover/header components were updated to pass databasesMainScreen and to simplify page markup (notably replacing Usage with UsageMultiple).

Suggested reviewers

  • eldadfux
  • HarshMN2345
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-layout

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 @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai 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 @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @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.

Copy link

@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

Caution

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

⚠️ Outside diff range comments (1)
src/lib/layout/container.svelte (1)

37-47: Fix inverted class binding for paddingInlineEnd

class:paddingInlineEnd={!paddingInlineEnd} applies padding when the prop is false. This likely inverts the intended semantics and can cause layout regressions (especially combined with .expanded).

Apply:

-        class="console-container"
-        class:paddingInlineEndDouble
-        class:paddingInlineEnd={!paddingInlineEnd}>
+        class="console-container"
+        class:paddingInlineEndDouble
+        class:paddingInlineEnd={paddingInlineEnd}>
🧹 Nitpick comments (2)
src/lib/layout/container.svelte (2)

30-34: Avoid empty style attribute; bind the CSS variable directly

Binding an empty string to style produces style="". Bind the custom property directly instead.

-    const style = $derived(
-        size
-            ? `--p-container-max-size: var(--container-max-size, var(--container-size-${size}))`
-            : ''
-    );
+    // no helper needed; bind CSS var inline on the element
@@
-    <div
-        {style}
+    <div
+        style:--p-container-max-size={size
+            ? `var(--container-max-size, var(--container-size-${size}))`
+            : undefined}

Also applies to: 38-41


105-116: Ordering and overrides: expanded vs. padding classes

.expanded zeroes end padding, but .paddingInlineEnd/.paddingInlineEndDouble later reapply padding with !important. Confirm this is intentional for expanded pages; otherwise consider removing !important or scoping the double-padding to non-expanded variants.

Also applies to: 66-83

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

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 bf5ff13 and c83bf48.

📒 Files selected for processing (5)
  • src/lib/layout/container.svelte (3 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/settings/+page.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/usage/[[period]]/+page.svelte (1 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). (1)
  • GitHub Check: e2e
🔇 Additional comments (6)
src/lib/layout/container.svelte (1)

37-37: Verify style directive name for container-type

Svelte style directives typically use camelCase (e.g., style:containerType) or a static style attribute. Please verify style:container-type compiles across your Svelte version; if not, switch to a static style.

-<div style:container-type="inline-size" class:overlap-cover={overlapCover} {...restProps}>
+<div style="container-type: inline-size" class:overlap-cover={overlapCover} {...restProps}>
src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.svelte (1)

21-21: LGTM: Container alignment flags

Using expanded slotSpacing paddingInlineEndDouble aligns with the new Container API. Re-test at ≥1024px to confirm the end padding matches adjacent UI chrome.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.svelte (1)

180-180: Consistency with new Container props

size="xxl" + expanded slotSpacing paddingInlineEndDouble looks consistent. Verify that double end padding doesn’t clash with .policies-holder-card min-width at tablet/desktop breakpoints.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/settings/+page.svelte (1)

64-131: LGTM: layout-only change

Switching to expanded slotSpacing paddingInlineEndDouble reads well. Please spot-check the CardGrid title/aside alignment on 1024–1440px widths.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/usage/[[period]]/+page.svelte (2)

13-23: LGTM: simplified usage panel

Props to UsageMultiple look correct (totals, counts, legend). Keep an eye on empty-state handling previously provided by the removed component.


2-2: UsageMultiple import is valid; no changes needed
src/lib/layout/index.ts exports UsageMultiple from usageMultiple.svelte, and there is no src/lib/usage directory.

Likely an incorrect or invalid review comment.

@ItzNotABug ItzNotABug marked this pull request as draft September 2, 2025 12:41
@ItzNotABug ItzNotABug marked this pull request as ready for review September 4, 2025 03:49
Copy link

@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 (1)
src/lib/layout/container.svelte (1)

3-5: Nice: rest props typed and children optional

Typing ...restProps and making children optional resolves the earlier feedback.

🧹 Nitpick comments (2)
src/lib/layout/cover.svelte (1)

125-129: Avoid width drift between Cover and Container; use a shared CSS var

Cover hardcodes 1200px while Container can vary. Prefer a var so both stay in sync and size overrides work consistently.

-        &.databasesMainScreen {
-            @media (min-width: 1440px) {
-                max-width: 1200px;
-            }
-        }
+        &.databasesMainScreen {
+            @media (min-width: 1440px) {
+                /* fall back to 1200px if not provided */
+                max-width: var(--p-container-max-size, 1200px);
+            }
+        }
src/lib/layout/container.svelte (1)

46-52: Invert-or-rename paddingInlineEnd to reduce confusion

class:paddingInlineEnd={!paddingInlineEnd} reads counterintuitively (false enables padding). Consider a clearer prop (paddingInlineEndEnabled) or inverting the binding for readability. Keep a deprecated alias for BC.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

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 64f8eb9 and 73457d4.

📒 Files selected for processing (7)
  • src/lib/layout/container.svelte (3 hunks)
  • src/lib/layout/cover.svelte (3 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/header.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/settings/+page.svelte (1 hunks)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/usage/[[period]]/+page.svelte (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/+page.svelte
  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/settings/+page.svelte
🔇 Additional comments (6)
src/lib/layout/cover.svelte (2)

10-10: Prop addition looks good

databasesMainScreen is a clear, boolean toggle. No issues spotted.


47-47: Correct class binding

class:databasesMainScreen properly maps the prop to styling. 👍

src/routes/(console)/project-[region]-[project]/databases/database-[database]/header.svelte (1)

41-41: Tablet spacing regression check

Switching from expanded to databasesMainScreen removes the expanded-based top margin in Cover. Please verify header spacing on tablets (<=1024px) as marginTop in Cover depends on expanded.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/backups/+page.svelte (1)

180-180: Confirm Container width; size="xxl" currently has no effect

In the updated Container, the size prop sets a CSS var that isn’t used in its CSS (see comment on container.svelte). Expect the page to render at default breakpoints unless fixed.

src/routes/(console)/project-[region]-[project]/databases/database-[database]/usage/[[period]]/+page.svelte (2)

13-24: Usage UI simplification LGTM

Removing the total table usage card matches the PR goal and the remaining UsageMultiple config looks consistent.


2-2: No action needed: UsageMultiple is correctly re-exported
Confirmed in src/lib/layout/index.ts (line 14) that UsageMultiple is exported.

@ItzNotABug ItzNotABug merged commit 1c2e114 into main Sep 4, 2025
5 checks passed
@ItzNotABug ItzNotABug deleted the fix-layout branch September 4, 2025 04:21
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