Skip to content

Restore sidebar workspace icon size#4973

Open
austinywang wants to merge 20 commits into
mainfrom
fix-sidebar-icons-restore-size
Open

Restore sidebar workspace icon size#4973
austinywang wants to merge 20 commits into
mainfrom
fix-sidebar-icons-restore-size

Conversation

@austinywang
Copy link
Copy Markdown
Contributor

@austinywang austinywang commented May 29, 2026

Summary

  • restore extension sidebar workspace badge icons to the 28pt size used by the sidebar tile layout
  • restore release-era titlebar chrome sizing: 15pt icons in 24pt button lanes for the classic controls, with the old style scale preserved across titlebar variants
  • restore the 0.64.10 sidebar-toggle SF Symbol (sidebar.left) instead of the newer custom drawn glyph
  • keep the newer focus-history buttons, sidebar virtualization/drop layout, geometry reporting, and shared right-sidebar chrome metric path intact

Repro / Root Cause

Used local source diffing against v0.64.10, plus the user-provided screenshots. The shipped v0.64.10 titlebar controls used iconSize: 15, buttonSize: 24, spacing: 10, semibold symbols, and SF Symbol sidebar.left for the sidebar toggle. The later focus-history/titlebar chrome refactor shrank classic to compact shared values (12pt icons in 20pt lanes, regular weight) and replaced the sidebar toggle with a smaller custom glyph.

This fix restores the release-era titlebar icon/lane scale at the shared chrome metric root and restores the original SF Symbol path for the sidebar toggle, so the main titlebar controls and right-sidebar header controls stay in sync without a one-off frame override.

No cloud-mac video was recorded.

Testing

  • Not run locally per instruction.
  • Added regression assertions for the release-era titlebar chrome metrics and deterministic titlebar content width.
  • Added/kept regression assertions that right-sidebar header chrome derives from the shared titlebar chrome metrics.

Launch

Required command after approval:
CMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag fix-sidebar-icons-restore-size --launch

Summary by CodeRabbit

  • Refactor
    • Centralized sidebar sizing so tiles, icons, row heights, padding and corner radii are consistent across compact and regular modes and ensure icons fit.
  • UI
    • Right‑sidebar header icons and controls now use the app’s standard titlebar sizing with bolder icon weight for a clearer, more consistent appearance.
    • Titlebar control styles adjusted—spacing, icon/button sizes, corner radii and button visuals updated across styles.
  • Tests
    • Updated tests to validate the revised sizing, padding and layout metrics.

Review Change Stack


Note

Low Risk
Mostly visual layout and hit-region metrics with regression tests; no auth, data, or security paths touched.

Overview
Restores pre-refactor chrome sizing for extension sidebar workspace tiles and shared header/titlebar controls, and aligns minimal-mode sidebar titlebar behavior with a three-button chrome row.

Extension sidebar: Introduces ExtensionBrowserStackSidebarMetrics (28pt icons, fixed tile/row heights, padding and corner radius helpers with vertical padding derived from icon height) so tile and list rows no longer use scattered magic numbers; list rows always use the 28pt icon size instead of smaller compact icons.

Shared chrome: HeaderChromeControlMetrics moves to 24×15pt buttons/icons with 8pt corners; HeaderChromeIconStyle uses semibold weight and drops the custom sidebar glyph stroke. Right-sidebar header metrics follow the shared titlebar sizes.

Titlebar: Style presets get larger spacing and icon/button sizes; sidebar toggle returns to SF Symbol sidebar.left. TitlebarControlsView supports configurable actionSlots and styleConfigOverride; minimal/hidden sidebar chrome uses only toggle sidebar, notifications, new tab via sidebarChromeSlots, with fittingConfig shrinking controls to fit the 124pt host width and updated hit-test/drag regions for three buttons. Focus-history controls remain on the full titlebar path where applicable.

Tests: Assertions updated for new layout widths, metrics, and three-button hit regions.

Reviewed by Cursor Bugbot for commit b7ceab1. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment May 30, 2026 5:22am
cmux-staging Building Building Preview, Comment May 30, 2026 5:22am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Centralizes browser-stack sidebar sizing into ExtensionBrowserStackSidebarMetrics and updates tile/row views to use it; aligns header/icon/frame sizing with shared HeaderChromeControlMetrics, adjusts titlebar style presets, removes custom sidebar glyph, and updates tests to assert the new metrics.

Changes

Browser Stack Sidebar Metrics Refactoring

Layer / File(s) Summary
Metrics contract and sizing constants
Sources/ContentView.swift
New ExtensionBrowserStackSidebarMetrics enum defines shared iconSize, tileHeight, compact/regular row heights, and helpers for computing row padding and corner radius (with a precondition validating icon fits row height).
Tile view metric adoption
Sources/ContentView.swift
extensionBrowserStackTile now uses ExtensionBrowserStackSidebarMetrics for icon sizing and tile height, replacing hardcoded values while preserving selection and drag/drop behavior.
Row view dimension and styling refactor
Sources/ContentView.swift
extensionBrowserStackRow derives targetRowHeight, leading icon size, rowHorizontalPadding, rowVerticalPadding, and rowCornerRadius from metrics and applies them to padding and rounded-rectangle background/overlay for both compact and regular modes.

Header & Titlebar Metrics Update

Layer / File(s) Summary
Header chrome metrics and wiring
Sources/WindowChromeMetrics.swift
HeaderChromeControlMetrics sizing constants updated; RightSidebarChromeMetrics.headerIconSize now references HeaderChromeControlMetrics.iconSize and computes headerIconFrameSize via HeaderChromeControlMetrics.iconFrameSize(forIconSize:).
Header icon style weight change
Sources/RightSidebarChromeStyle.swift
HeaderChromeIconStyle.weight changed to .semibold for header icon rendering.
Titlebar control style adjustments
Sources/Update/UpdateTitlebarAccessory.swift
Updated TitlebarControlsStyle.config values for .classic, .compact, .roomy, .pillGroup, and .softButtons (spacing, icon/button sizes, badgeSize/badgeOffset, groupPadding, and buttonCornerRadius; .softButtons enforces buttonBackground).
Sidebar glyph removal and toggle update
Sources/Update/UpdateTitlebarAccessory.swift
Removed custom TitlebarSidebarGlyph and sidebarIconLabel; sidebar toggle now uses shared iconLabel(systemName: "sidebar.left"), and glyph-specific metric constant removed.
Tests updated to match shared metrics
cmuxTests/*
Tests renamed/updated to assert header/titlebar button/icon/frame/padding metrics derive from shared configs; deterministic content-size expectations adjusted and button-size variance tolerance widened.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Ari4ka

Poem

🐰 I nudged the sizes into neat little stacks,
Icons queued by metrics, no more hardcoded hacks,
Tiles ask the helper, rows wear matching trims,
Headers grew bolder at the font-weight rims,
A happy hop — layout calm, tidy, and slim.

🚥 Pre-merge checks | ✅ 4 | ❌ 14

❌ Failed checks (1 warning, 13 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.
Cmux Swift Actor Isolation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Blocking Runtime ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Hacky Sleeps ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Algorithmic Complexity ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Concurrency ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift @Concurrent ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift File And Package Boundaries ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Logging ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux User-Facing Error Privacy ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Full Internationalization ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftui State Layout ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Architecture Rethink ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Auxiliary Window Close Shortcuts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Restore sidebar workspace icon size' accurately and concisely summarizes the main objective of the changeset—restoring icon sizing in the sidebar workspace. It is specific, clear, and reflects a primary purpose evident across the modified files.
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.
Description check ✅ Passed The PR description provides detailed context on what changed, why (restoring pre-refactor sizing), testing approach (regression assertions added), and includes a launch command. All major template sections are covered with substantive content.

✏️ 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 fix-sidebar-icons-restore-size

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.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR restores the v0.64.10 window-chrome sizing: sidebar workspace icons return to 28 pt, the classic titlebar controls go back to 15 pt icons in 24 pt lanes with semibold weight, the sidebar-toggle glyph switches back to the sidebar.left SF Symbol, and the minimal-mode host is narrowed to a three-button strip. A new fittingConfig helper scales down any titlebar style that is too wide for the 124 pt sidebar host, and right-sidebar header controls are derived from the same shared HeaderChromeControlMetrics constants so all chrome surfaces stay in sync.

  • Centralised sidebar metricsExtensionBrowserStackSidebarMetrics (ContentView) and the shared HeaderChromeControlMetrics / RightSidebarChromeMetrics (WindowChromeMetrics) now own all icon, button, padding, and corner-radius constants.
  • Configurable button countTitlebarControlsHitRegions, TitlebarControlsView, and the minimal-mode hit-region views all accept a buttonCount parameter; the titlebar accessory and hidden-sidebar titlebar pass sidebarChromeSlots.count = 3 so focus-history buttons are kept in the code but excluded from the narrow sidebar strip.
  • Regression tests — new assertions lock in the restored per-style metrics, three-button content widths, and fittingConfig shrink behaviour for the roomy style.

Confidence Score: 5/5

Safe to merge — all changes are layout constants, static metric enums, and hit-region plumbing with no auth, data, or concurrency impact.

The change is scoped entirely to visual chrome metrics and hit-region sizing. Restored constants are validated by deterministic unit tests locking in exact widths, padding values, and button counts. The one fragility flagged (barVerticalPadding derivation without a guard) is not a current bug given the locked constants, and the tests would catch a regression before it shipped.

Sources/WindowChromeMetrics.swift — the derived barVerticalPadding formula has no guard against the padding going negative if buttonSize is later bumped past secondaryBarHeight.

Important Files Changed

Filename Overview
Sources/WindowChromeMetrics.swift Bumps HeaderChromeControlMetrics (buttonSize 20→24, iconSize 12→15, iconFrameSize 14→17, cornerRadius 6→8) and derives RightSidebarChromeMetrics.barVerticalPadding from the new buttonSize; lacks a guard against negative padding if buttonSize ever exceeds secondaryBarHeight.
Sources/ContentView.swift Extracts ExtensionBrowserStackSidebarMetrics enum to centralise icon/row sizing; restores iconSize to 28pt for all row variants; rowVerticalPadding uses assert+max(0,…) guard.
Sources/Update/UpdateTitlebarAccessory.swift Restores release-era per-style icon/button/spacing metrics, adds fittingConfig to scale down for the narrow sidebar host, gates button rendering on actionSlots, switches sidebar toggle to sidebar.left SF Symbol, removes custom TitlebarSidebarGlyph.
Sources/Update/MinimalModeSidebarControls.swift Adds configurable buttonCount to all hit-region helpers; introduces visibleSlots and frame-zeroing in layout() to keep hidden buttons out of hit targets and accessibility; default stays at sidebarChromeButtonCount (3).
Sources/WindowDragHandleView.swift Narrows MinimalModeSidebarTitlebarControlsMetrics.hostWidth from 164→124 and routes titlebarControlsStyleConfig through titlebarControlsSidebarChromeConfig for correct fitted sizing.
Sources/RightSidebarChromeStyle.swift Bumps HeaderChromeIconStyle.weight from .regular to .semibold; removes now-unused sidebarGlyphStrokeWidth constant.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    HCM["HeaderChromeControlMetrics\nbuttonSize=24 iconSize=15\ncornerRadius=8 weight=semibold"]
    RSC["RightSidebarChromeMetrics\nbarVerticalPadding=(28-24)/2=2\nheaderIconSize=15 headerControlSize=24"]
    EBSM["ExtensionBrowserStackSidebarMetrics\niconSize=28 tileHeight=54\nrowHeight(compact)=34/38"]
    TCS_classic["TitlebarControlsStyle.classic\nspacing=10 buttonSize=24 iconSize=15"]
    FC["fittingConfig()\nscales down spacing/button/icon\nto fit hostWidth=124"]
    SIDEBAR_CFG["titlebarControlsSidebarChromeConfig()\nfor style → fitted config"]
    TCV["TitlebarControlsView\nactionSlots=[sidebar,notif,newTab]\nstyleConfigOverride=fittedConfig"]
    HIT["TitlebarControlsHitRegions\nbuttonCount=3\nbuttonXRanges(config, buttonCount)"]

    HCM --> RSC
    HCM --> TCS_classic
    TCS_classic --> FC
    FC --> SIDEBAR_CFG
    SIDEBAR_CFG --> TCV
    SIDEBAR_CFG --> HIT
    EBSM --> ContentView["ContentView\nextensionBrowserStackRow"]
Loading

Reviews (11): Last reviewed commit: "fix: avoid crashing on sidebar icon padd..." | Re-trigger Greptile

Comment thread Sources/ContentView.swift
Comment thread Sources/Update/MinimalModeSidebarControls.swift Outdated
Comment thread Sources/WindowDragHandleView.swift
@lugfug
Copy link
Copy Markdown

lugfug commented May 30, 2026

+1 for configurable sidebar icon size — same need on the icon side. The workspace icons are hard to distinguish at the current fixed size when a lot of tabs are open. Would love to see this land alongside sidebar font sizing.

@austinywang
Copy link
Copy Markdown
Contributor Author

@lugfug I kept this PR scoped to the visual regression: the default workspace sidebar icon size is restored to the v0.64.10-era 28pt size, and the sizing now comes from a shared metrics path so a future preference can drive it cleanly. I did not add a new user-facing icon-size setting here because that changes the settings/config surface and needs row-height/density behavior designed separately from this regression fix.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8dc7bbd. Configure here.

Comment thread Sources/ContentView.swift
Comment thread Sources/Update/UpdateTitlebarAccessory.swift Outdated
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