fix(web): normalize compact UI geometry#4498
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: Approved This PR normalizes UI geometry by introducing CSS custom properties for consistent spacing and border-radius values across components. The changes are purely mechanical styling updates with no behavioral impact. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b931602. Configure here.
| <div className={cn("px-2.5 py-1.5", wrapperClassName)}> | ||
| <div | ||
| className={cn( | ||
| "px-[var(--command-shell-inset)] py-1.5 [&_[data-slot=autocomplete-start-addon]]:ps-[calc(var(--command-shell-inset)+0.0625rem)] sm:*:data-[slot=autocomplete-input]:ps-[calc(var(--command-shell-inset)+1.5rem)]", |
There was a problem hiding this comment.
Command input padding never applies
Medium Severity
The CommandInput's text padding is incorrect. The sm:*:data-[slot=autocomplete-input] selector fails to apply the intended ps rule because data-slot=autocomplete-input is a nested element, not a direct child. This results in the input text using hardcoded spacing instead of --command-shell-inset.
Reviewed by Cursor Bugbot for commit b931602. Configure here.
| size="xs" | ||
| size="icon-xs" | ||
| variant="outline" | ||
| className="@3xl/header-actions:w-auto @3xl/header-actions:px-[calc(--spacing(2)-1px)]" |
There was a problem hiding this comment.
Expanded script buttons stay cramped
Medium Severity
Switching these controls to icon-xs keeps sm:size-6 width while only adding @3xl/header-actions:w-auto. Depending on stylesheet order, the fixed width can win, so when labels unhide the button stays 24px wide and the text overflows. The override also omits the old xs text and gap sizing used by neighboring header actions.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b931602. Configure here.
| size="xs" | ||
| size="icon-xs" | ||
| variant="outline" | ||
| className="@3xl/header-actions:w-auto @3xl/header-actions:px-[calc(--spacing(2)-1px)]" |
There was a problem hiding this comment.
Expanded script buttons lose compact typography
Medium Severity
Switching these controls to icon-xs keeps them square when compact, but the @3xl expansion only adds width and padding. icon-xs still inherits base gap-2 and text-base/sm:text-sm, so expanded labels no longer match neighboring xs header actions that keep gap-1 and text-sm/sm:text-xs.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit b931602. Configure here.


Summary
Fixed UI close-ups
These captures are from the isolated local verification build for this PR.
Root cause
The redesigned surfaces used independent Tailwind spacing, radius, and opacity values. Reserved scrollbar gutter space also added an extra six pixels to the right side of Sidebar V2 rows, while the settings footer's explicit empty grid column added four pixels when no avatar rendered. Tooltip viewport and child padding stacked asymmetrically.
Impact
Compact controls now share an 8px radius and tokenized geometry. Sidebar rows and settings footer actions have symmetric insets, thread tooltip content has 12px padding on every edge, command-palette content shares a 16px alignment axis, compact project actions render at 24×24px, and detailed SVG icons render with an opaque semantic color.
Verification
vp test run apps/web/src/components/ui/button.test.tsx apps/web/src/components/ui/sidebar.test.tsx— 9 tests passedvp run --filter @t3tools/web typecheckvp lintover all changed web filesvp run --filter @t3tools/web buildNote
Normalize compact UI geometry using shared CSS custom property tokens
--control-radius,--sidebar-content-inset,--sidebar-control-gap,--sidebar-icon-color, etc.) to standardize spacing, corner radius, and icon color across the app.SidebarV2,SidebarChrome,SettingsSidebarNav) andCommandInput/CommandFooterwith references to these tokens.Buttonxsandghostvariants to use explicit geometry and--control-icon-colorfor icon color, replacing the prior opacity-based SVG selector approach.ghostvariant buttons now render icons with a solid--muted-foregroundcolor instead of reduced opacity;xsbuttons gain explicit height/padding/gap constraints.Macroscope summarized b931602.
Note
Low Risk
Visual and styling-only changes with unit tests; no auth, data, or API behavior changes.
Overview
Introduces shared CSS custom properties in
index.css(--control-radius,--sidebar-content-inset,--command-content-inset,--floating-content-inset,--sidebar-icon-color, etc.) so sidebar, command palette, tooltips, and compact controls stay aligned.Button defaults now use
rounded-[var(--control-radius)]and--control-icon-colorfor SVGs onoutline/ghostinstead of globalopacity-80on icons. Project header actions switch tosize="icon-xs"with responsive width/label classes so compact controls stay square until the header widens.Sidebar V2, settings footer, T3 Connect sign-in, and base
SidebarMenuButtonreplace hardcodedpx-2/rounded-mdwith the new tokens; thread tooltips drop stacked viewport padding for uniform--floating-content-inset. Command palette search shell and footer use--command-shell-inset/--command-content-inset. Settings footer usesflexso Back and avatar share space symmetrically; inactive nav icons use--sidebar-icon-color.Adds
button.test.tsxand extendssidebar.test.tsxto lock token classes and squareicon-xssizing.Reviewed by Cursor Bugbot for commit b931602. Bugbot is set up for automated code reviews on this repo. Configure here.