Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ function DashboardDetailContent({
<PageLayout fillWidth noPadding>
{/* 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.

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

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

{/* Dashboard iframe panel */}
<div
className={cn(
Expand Down
Loading