fix: Desktop sidebar clips logo after collapse-mode UX changes #187
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Low
Regression Source
Introduced by #176 (chore: add desktop sidebar collapse to icon-only mode)
Problem
The desktop sidebar header (256px wide) clips the MotoVaultPro logo. The full logo text "MOTOVAULTPRO" and slogan "PRECISION VEHICLE MANAGEMENT" are truncated on the right edge, cut off by the collapse chevron button.
Root cause: The logo image has
maxWidth: 180but the available space after accounting for header padding (px: 2= 32px), gap (gap: 1= 8px), logo container padding (px: 1= 16px), and the collapse button (~34px) is only ~166px.Affected file:
frontend/src/components/Layout.tsx(lines 121-159)Steps to Reproduce
Expected Behavior
The sidebar width should allow the full logo (text + slogan) to display without clipping alongside the collapse toggle button.
Acceptance Criteria
Plan: Fix Desktop Sidebar Logo Clipping
Phase: Planning | Agent: Claude Opus 4.6 | Status: AWAITING_REVIEW (Rev 2 - post QR completeness)
Context
Root Cause Analysis (Codebase Analysis):
motovaultpro-title-slogan.pngis 1880x237px (7.94:1 aspect ratio)height: 24, natural width is ~190px;maxWidth: 180constrains it to 180pxpx: 1(16px padding) + 180px image = 196px, exceeding 182px by 14pxoverflow: hiddenadded in #176 (commitbc72f09on branchissue-162-ux-design-audit-cleanup) clips the overflow, making the bug visibleDecision Critic Verdict: STAND with modifications
Approach
Use flex-based layout to let the logo Box naturally fill available space, removing hard-coded maxWidth constraints. Remove logo Box internal padding that consumes 16px of valuable space. Keep
overflow: hiddenas safety net.Milestones
Milestone 1: Fix logo container flex constraints in Layout.tsx
Branch:
issue-187-fix-sidebar-logo-clipping(fromissue-162-ux-design-audit-cleanup)File:
frontend/src/components/Layout.tsxChanges to the logo container Box (lines ~134-157 on branch
issue-162-ux-design-audit-cleanup):flex: 1andminWidth: 0to logo Boxsx-- allows flex parent to allocate remaining space instead of defaulting to content widthpx: 1from logo Box -- eliminates 16px padding that wastes horizontal spacepx: 0.5(4px each side) for minimal visual breathing room between logo edge and containermaxWidth: 180from<img>inline style -- let flex sizing determine width naturallymaxWidth: '100%'to<img>-- prevents image from exceeding its flex-allocated containeroverflow: hiddenon logo Box -- safety net for collapse animation edge casesExpected result: Logo Box gets ~182px from flex layout. With px:0.5 (8px padding), image fills ~174px at height ~22px. Full "MOTOVAULTPRO" text and slogan visible. No clipping.
Milestone 2: Verify fix across viewports and sidebar states
Expanded sidebar tests (256px width):
Collapsed sidebar tests (64px width):
4. Click the collapse chevron (
<) button to trigger icon-only mode. Verify logo is hidden (conditional rendering{!sidebarCollapsed && ...}).5. Click expand chevron (
>) to return to full sidebar. Verify logo reappears fully visible.6. Verify collapse/expand animation is smooth with no visual artifacts (logo should not flash or partially render during transition).
Mobile layout:
7. Switch to mobile viewport. Confirm mobile header logo uses separate code path (Tailwind classes
h-6 w-auto) and is unaffected by changes.Automated checks:
8. Run
npm run lint-- zero errors9. Run
npm run type-check-- zero errorsFiles Changed
frontend/src/components/Layout.tsxRisk Assessment
{!sidebarCollapsed && ...}, this fix only affects expanded state stylingVerdict: AWAITING_REVIEW | Next: QR plan-code review
Plan Review Cycle: Complete
Phase: Plan-Review | Agent: Quality Reviewer + Technical Writer | Status: PASS
Review Results
Findings Addressed in Rev 2
Verdict: PASS | Next: Execute Milestone 1
Milestone 1: Fix logo container flex constraints -- COMPLETE
Phase: Execution | Agent: Claude Opus 4.6 | Status: PASS
Changes Applied
File:
frontend/src/components/Layout.tsx(lines 138-159)Branch:
issue-187-fix-sidebar-logo-clippingCommit:
19cd917px1(16px)0.5(8px)flex1minWidth0maxWidth180(px)'100%'Verification
npm run lint-- PASS (only pre-existing warning on line 44, unrelated)npm run type-check-- PASS (zero errors)Verdict: PASS | Next: Milestone 2 (viewport and sidebar state verification)
Milestone 2: Viewport and sidebar state verification -- PARTIAL
Phase: Execution | Agent: Claude Opus 4.6 | Status: IN_PROGRESS
Automated Checks
npm run lint-- PASSnpm run type-check-- PASSCode-Level Verification
{!sidebarCollapsed && ...}-- unchanged, no impacth-6 w-auto-- unchangedVisual Checks (require browser)
Verdict: IN_PROGRESS | Next: Visual verification by user, then PR