Skip to content

layout fix#1408

Open
aadesh18 wants to merge 3 commits intodevfrom
custom-dashboard-layout-fix
Open

layout fix#1408
aadesh18 wants to merge 3 commits intodevfrom
custom-dashboard-layout-fix

Conversation

@aadesh18
Copy link
Copy Markdown
Collaborator

@aadesh18 aadesh18 commented May 5, 2026

This PR fixes a layout bug

Summary by CodeRabbit

  • Refactor
    • Adjusted dashboard top-panel height to use viewport-aware sizing for more consistent fit across screen sizes.
    • Improved spacing behavior in dark mode to prevent clipping and ensure visible content without scrolling.

@aadesh18 aadesh18 requested a review from N2D4 May 5, 2026 00:21
@aadesh18 aadesh18 self-assigned this May 5, 2026
Copilot AI review requested due to automatic review settings May 5, 2026 00:21
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
stack-auth-hosted-components Ready Ready Preview, Comment May 5, 2026 0:35am
stack-backend Ready Ready Preview, Comment May 5, 2026 0:35am
stack-dashboard Ready Ready Preview, Comment May 5, 2026 0:35am
stack-demo Ready Ready Preview, Comment May 5, 2026 0:35am
stack-docs Ready Ready Preview, Comment May 5, 2026 0:35am
stack-preview-backend Ready Ready Preview, Comment May 5, 2026 0:35am
stack-preview-dashboard Ready Ready Preview, Comment May 5, 2026 0:35am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1cbad70-bf7b-4c25-a2ba-2cbbb4568523

📥 Commits

Reviewing files that changed from the base of the PR and between 84597aa and fce27a8.

📒 Files selected for processing (1)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/dashboards/[dashboardId]/page-client.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/dashboards/[dashboardId]/page-client.tsx

📝 Walkthrough

Walkthrough

The dashboard page client updates its top-level content wrapper from a full-height flex container to a viewport-offset height using h-[calc(100vh-3.5rem)] (light) and dark:h-[calc(100vh-6rem)] (dark). No other functional changes were made.

Changes

Dashboard Layout Height

Layer / File(s) Summary
Layout Height
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/dashboards/[dashboardId]/page-client.tsx
Replaced className="flex h-full" with className="flex h-[calc(100vh-3.5rem)] dark:h-[calc(100vh-6rem)]" to offset header height.
Context / Surrounding Markup
apps/.../page-client.tsx (nearby lines)
Change is localized to the wrapper div; surrounding JSX and logic remain unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰
I hopped upon the dashboard green,
And trimmed the height to fit the scene.
A little math — a viewport cheer,
Now header space is crystal clear.

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (1 warning, 2 inconclusive)

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.
Title check ❓ Inconclusive The title 'layout fix' is vague and generic, using non-descriptive terms that don't convey specific information about which layout was fixed or what the actual change entails. Use a more descriptive title that specifies the component and issue, such as 'Fix dashboard panel height calculation' to clearly communicate the change.
Description check ❓ Inconclusive The description 'This PR fixes a layout bug' is overly brief and lacks necessary details about what bug was fixed, why it occurred, or how it was resolved. Expand the description to explain the layout bug, its impact, and the specific fix applied (e.g., height calculation change from h-full to h-[calc(100vh-3.5rem)]).
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch custom-dashboard-layout-fix

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.

@aadesh18 aadesh18 removed the request for review from N2D4 May 5, 2026 00:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR appears to address a dashboard detail-page layout issue in the dashboard app by changing how the main split view gets its height within the project sidebar layout.

Changes:

  • Reordered imports in the dashboard detail page.
  • Replaced the split-view container’s h-full sizing with explicit viewport-based heights in light and dark mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{/* Both panels are always in the DOM so the iframe never unmounts/reloads.
The chat panel animates its width; the dashboard panel adjusts via flex-1. */}
<div data-full-bleed className="flex h-full">
<div data-full-bleed className="flex h-[calc(100vh-3.5rem)] dark:h-[calc(100vh-6rem)]">
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 5, 2026

Greptile Summary

This PR fixes the dashboard detail page layout by replacing h-full with explicit calc(100vh-3.5rem) (light) / dark:h-[calc(100vh-6rem)] (dark) on the outermost flex container. The root cause is that the flex height chain is broken by items-start in sidebar-layout.tsx, so h-full collapses — the new values are consistent with the identical approach already used for the sticky sidebar.

Confidence Score: 4/5

Safe to merge — the fix is correct and consistent with the existing sidebar pattern; only a P2 style note about duplicated magic numbers.

A single P2 finding (duplicated hardcoded rem values) that mirrors an already-established pattern in the codebase. No logic bugs, security concerns, or regressions introduced.

No files require special attention beyond the noted style concern on line 394.

Important Files Changed

Filename Overview
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/dashboards/[dashboardId]/page-client.tsx Layout fix: replaces h-full with calc(100vh-3.5rem) / dark calc(100vh-6rem) to work around broken flex height chain; also reorders imports cosmetically.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["h-screen flex-col overflow-y-auto\n(sidebar-layout outer container)"] --> B
    B["Sticky Header\nLight: h-14 = 3.5rem\nDark: mt-3 + h-14 + mb-3 = 5rem"] --> C
    C["flex flex-1 items-start\n(items-start breaks height propagation)"] --> D
    D["main flex-1\n(no explicit height)"] --> E
    E["Content wrapper\nhas-[data-full-bleed]:h-full\n(h-full fails — parent has no height)"] --> F
    F["PageLayout noPadding\nflex flex-1 min-h-0 flex-col"] --> G
    G["data-full-bleed div\nBEFORE: h-full ❌ collapses\nAFTER: h-[calc(100vh-3.5rem)] ✅\ndark:h-[calc(100vh-6rem)] ✅"]
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/dashboards/[dashboardId]/page-client.tsx:394
**Hardcoded header heights may drift out of sync**

The `calc(100vh-3.5rem)` / `dark:h-[calc(100vh-6rem)]` values match the sidebar (which already uses identical magic numbers in `sidebar-layout.tsx:738`), but they duplicate the same constants in two places. If the header height or dark-mode margins ever change, every site that uses `calc(100vh - <header>)` will need a coordinated update. Consider extracting these to a CSS custom property (e.g. `--header-height`) set on the root, so there is a single source of truth.

Reviews (1): Last reviewed commit: "Merge branch 'dev' into custom-dashboard..." | Re-trigger Greptile

{/* Both panels are always in the DOM so the iframe never unmounts/reloads.
The chat panel animates its width; the dashboard panel adjusts via flex-1. */}
<div data-full-bleed className="flex h-full">
<div data-full-bleed className="flex h-[calc(100vh-3.5rem)] dark:h-[calc(100vh-6rem)]">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Hardcoded header heights may drift out of sync

The calc(100vh-3.5rem) / dark:h-[calc(100vh-6rem)] values match the sidebar (which already uses identical magic numbers in sidebar-layout.tsx:738), but they duplicate the same constants in two places. If the header height or dark-mode margins ever change, every site that uses calc(100vh - <header>) will need a coordinated update. Consider extracting these to a CSS custom property (e.g. --header-height) set on the root, so there is a single source of truth.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/dashboards/[dashboardId]/page-client.tsx
Line: 394

Comment:
**Hardcoded header heights may drift out of sync**

The `calc(100vh-3.5rem)` / `dark:h-[calc(100vh-6rem)]` values match the sidebar (which already uses identical magic numbers in `sidebar-layout.tsx:738`), but they duplicate the same constants in two places. If the header height or dark-mode margins ever change, every site that uses `calc(100vh - <header>)` will need a coordinated update. Consider extracting these to a CSS custom property (e.g. `--header-height`) set on the root, so there is a single source of truth.

How can I resolve this? If you propose a fix, please make it concise.

{/* Both panels are always in the DOM so the iframe never unmounts/reloads.
The chat panel animates its width; the dashboard panel adjusts via flex-1. */}
<div data-full-bleed className="flex h-full">
<div data-full-bleed className="flex h-[calc(100vh-3.5rem)] dark:h-[calc(100vh-6rem)]">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hardcoded magic numbers (3.5rem for light mode, 6rem for dark mode) for header heights are duplicated across 5 files, creating a maintenance burden where any header height changes require coordinated updates in multiple locations.

Fix on Vercel

{/* Both panels are always in the DOM so the iframe never unmounts/reloads.
The chat panel animates its width; the dashboard panel adjusts via flex-1. */}
<div data-full-bleed className="flex h-full">
<div data-full-bleed className="flex h-[calc(100vh-3.5rem)] dark:h-[calc(100vh-6rem)]">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
<div data-full-bleed className="flex h-[calc(100vh-3.5rem)] dark:h-[calc(100vh-6rem)]">
<div data-full-bleed className="flex h-[calc(100vh-4.5rem)] dark:h-[calc(100vh-5.75rem)]">

Dashboard container viewport-based heights don't account for main element padding, causing overflow of its parent container

Fix on Vercel

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