Skip to content

Revert sidebar row-height layout feedback - #6625

Merged
austinywang merged 2 commits into
mainfrom
revert-6558-sidebar-rowheight
Jun 23, 2026
Merged

austinywang merged 2 commits into
mainfrom
revert-6558-sidebar-rowheight

Conversation

@austinywang

@austinywang austinywang commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reverts #6558, which was squash-merged as 0df6f71. That PR regressed sidebar row heights: workspace rows and terminal tab pills now render too wide/tall for their content, including tiny titles like ~.

This restores the pre-#6558 layout sizing path so the row and tab-pill dimensions come from their rendered content again.

This intentionally reopens the original concern in #6556 so the layout-feedback fix can be redone without the sizing regression.

Testing

  • ./scripts/check-pbxproj.sh
  • ./scripts/lint-pbxproj-test-wiring.sh
  • git diff --check --cached before the revert commit
  • GitHub CI on PR Revert sidebar row-height layout feedback #6625: all required checks green
  • Bundled autoreview for the current branch/head: clean

Skipped fresh reproduction per user request: this is a direct revert of a user-identified regression.

Demo Video

Not provided. Per request, no dev build has been launched yet; the cloud build command will only be run after explicit user instruction.

Checklist

This reverts commit 0df6f71.

PR #6558 regressed sidebar row heights and made workspace rows and terminal tab pills too wide/tall for their content. Reopen the original #6556 concern for a safer follow-up.
@vercel

vercel Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 23, 2026 12:45am
cmux-staging Building Building Preview, Comment Jun 23, 2026 12:45am

@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

SidebarWorkspaceRowDropMetrics and its static height/width/line-count estimation logic are deleted entirely, along with its test suite and Xcode project references. Drop-hit height for TabItemView and SidebarWorkspaceGroupHeaderView is now determined by a GeometryReader-based rowHeightProbe. VerticalTabsSidebar drops sidebarWidth in favor of windowId. SidebarMetadataRows and SidebarMetadataMarkdownBlocks internalize their expansion state and hardcoded line limits.

Changes

Drop Height: Static Estimation → Dynamic rowHeightProbe

Layer / File(s) Summary
Remove static drop metrics infrastructure
Sources/SidebarWorkspaceGroupHeaderMetrics.swift, cmux.xcodeproj/project.pbxproj
dropTargetHeight removed from SidebarWorkspaceGroupHeaderMetrics. All eight Xcode project entries for SidebarWorkspaceRowDropMetrics.swift and SidebarWorkspaceDropMetricsTests.swift are removed from build phases, file references, and groups.
VerticalTabsSidebar and TabItemView: sidebarWidth removal and rowHeightProbe
Sources/ContentView.swift
VerticalTabsSidebar replaces sidebarWidth: CGFloat with windowId: UUID; WorkspaceListRenderContext drops sidebarWidth. TabItemView removes sidebarWidth, adds rowSpacing, adds @State rowHeight, introduces a GeometryReader rowHeightProbe attached via .background, and calls tabDropDelegateFactory(rowHeight) for drop sizing.
SidebarWorkspaceGroupHeaderView: rowHeightProbe wiring
Sources/SidebarWorkspaceGroupHeaderView.swift
Adds tabDropDelegateFactory: (CGFloat) -> SidebarWorkspaceGroupHeaderDropDelegate stored property, @State rowHeight, a GeometryReader-based rowHeightProbe (clamped to ≥ 1), and wires the probe via .background; drop delegate creation uses tabDropDelegateFactory(rowHeight) instead of metrics.dropTargetHeight.
Internalized expansion state and hardcoded line limits
Sources/ContentView.swift
SidebarMetadataRows and SidebarMetadataMarkdownBlocks replace @Binding var isExpanded with @State private var isExpanded and local limit constants (collapsedEntryLimit / collapsedBlockLimit). TabItemView call sites drop the expansion bindings. SidebarWorkspaceDescriptionText and SidebarMetadataMarkdownBlockRow set maxDisplayedLines = 12 locally.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • manaflow-ai/cmux#6111: The inverse of this PR—it introduced SidebarWorkspaceRowDropMetrics and dropTargetHeight on SidebarWorkspaceGroupHeaderMetrics, which are exactly the constructs this PR removes.
  • manaflow-ai/cmux#6558: Directly modifies the same TabItemView/SidebarWorkspaceGroupHeader* drop-height plumbing using the metrics-based approach that this PR replaces with rowHeightProbe.
  • manaflow-ai/cmux#6052: Also refactors sidebar drag-and-drop row-height handling via tabDropDelegateFactory and live measured row height, touching the same TabItemView drop delegate flow.

Poem

🐇 Hop, hop, away with the guessing game,
No more estimating heights by name!
A GeometryReader peeks and sees,
The actual row height, if you please.
Static math deleted, probes installed,
The rabbit measured — and that's all! 📏

🚥 Pre-merge checks | ✅ 22 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (22 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change—reverting sidebar row-height layout feedback. It is concise and directly related to the changeset's primary purpose.
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.
Cmux Swift Actor Isolation ✅ Passed This PR reverts a prior commit without introducing Swift 6 actor isolation issues. All modified UI views (TabItemView, VerticalTabsSidebar, SidebarWorkspaceGroupHeaderView) inherit @MainActor from...
Cmux Swift Blocking Runtime ✅ Passed PR introduces no blocking/timing-based synchronization (DispatchSemaphore, sleeps, asyncAfter, locks, etc.) in Swift production code. Changes remove layout metrics and use measured rowHeight via Ge...
Cmux Expensive Synchronous Load ✅ Passed PR removes 464 lines of height calculation code and adds only UI layout measurement via GeometryReader; no expensive synchronous loads (RestorableAgentSessionIndex.load, JSONL parsing, agent sessio...
Cmux Cache Substitution Correctness ✅ Passed rowHeight is transient @State (not persisted) and measured fresh via GeometryReader on each render; it does not substitute cached values in persistence/undo/snapshot paths.
Cmux No Hacky Sleeps ✅ Passed PR modifies only Swift files and Xcode config; check scope is TypeScript, JavaScript, shell, and non-Swift build scripts. Swift is covered by separate rule.
Cmux Algorithmic Complexity ✅ Passed PR removes 464 lines of complex SidebarWorkspaceRowDropMetrics (string analysis, line-counting, markdown parsing) and replaces with simple GeometryReader height measurements. No nested O(n²) loops,...
Cmux Swift Concurrency ✅ Passed PR reverts height-calculation regression; uses only SwiftUI callbacks (.onAppear, .onChange) in GeometryReader, which are allowed framework boundaries per swift-concurrency-modernization.md.
Cmux Swift @Concurrent ✅ Passed This revert PR introduces no new async functions, @concurrent annotations, or nonisolated async work. Row height measurement uses synchronous GeometryReader callbacks. No concurrency violations found.
Cmux Swift File And Package Boundaries ✅ Passed PR removes 464-line metrics file and makes net-zero changes to ContentView.swift (16,093 lines, within 16,117 limit). Focused bug-fix revert with no new oversized files, no >250-line additions, no...
Cmux Swiftpm Lockfiles ✅ Passed PR contains no SwiftPM dependency changes, Package.swift modifications, Package.resolved changes, or Xcode project package-reference updates; check is not applicable.
Cmux Swift Logging ✅ Passed PR contains no Swift logging violations: zero instances of print/debugPrint/dump/NSLog, file logging, unsafe Logger patterns, or sensitive data logging in modified/added code.
Cmux User-Facing Error Privacy ✅ Passed This is a revert of a layout sizing regression. Changes are internal UI measurement logic with no new user-facing error messages, alerts, or sensitive information exposed.
Cmux Full Internationalization ✅ Passed This PR reverts code that caused a regression; it removes SidebarWorkspaceRowDropMetrics and tests, and refactors layout code without introducing new user-facing strings. All existing localized str...
Cmux Swiftui State Layout ✅ Passed PR uses @State (not @StateObject/@published) for local state, GeometryReader with Color.clear in .background (contained, non-layout-affecting), and lifecycle callbacks (onAppear/onChange) rather th...
Cmux Architecture Rethink ✅ Passed PR reverts regression by removing pre-computed sizing and restoring content-based measurement via GeometryReader. Uses standard SwiftUI patterns: @State per view, no timing/dispatch dependencies, c...
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR removes layout metric code and refactors window ID passing for main workspace window (cmux.main.*), which is an allowed case per rules. No new/modified standalone windows introduced.
Cmux Source Artifacts ✅ Passed All 6 file changes are hand-written source files, tests, or project config. No artifacts, logs, caches, build output, or scratch directories are being added; only intentional code modifications and...
Cmux No Test Or Debug Seam In Production Source ✅ Passed PR removes SidebarWorkspaceRowDropMetrics.swift and its test file, introducing no new test/debug seams in production source files under Sources/. Existing test seams remain unmodified and unmodified.
Description check ✅ Passed PR description is comprehensive with clear summary, testing methodology, and checklist items addressing revert specifics and validation steps.

✏️ 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 revert-6558-sidebar-rowheight

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.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reverts #6558 (squash-merged as 0df6f71d), which regressed sidebar row and terminal tab-pill heights by replacing dynamic layout measurement with a static pre-calculation that over-estimated dimensions for short titles like ~. The revert restores the GeometryReader-in-.background probe pattern so each row's drop-hit height comes from its actual rendered size.

  • SidebarWorkspaceRowDropMetrics.swift deleted — the 464-line static estimation helper (and its test file) are removed; hardcoded constants it exported (maxWrappedTitleLines = 8, maxDescriptionLines = 12, collapsed-item limits) are re-inlined at their single use-sites with unchanged values.
  • sidebarWidth parameter chain removed — VerticalTabsSidebar → VerticalRenderContext → TabItemView no longer passes sidebar width; tabDropDelegateFactory now receives the @State rowHeight measured by a GeometryReader probe in .background on both TabItemView and SidebarWorkspaceGroupHeaderView.
  • Expansion state localised — metadataRowsExpanded / metadataBlocksExpanded move from TabItemView-owned @Bindings into private @State on SidebarMetadataRows and SidebarMetadataMarkdownBlocks respectively; lifecycle matches the prior behavior since both views are LazyVStack rows.

Confidence Score: 5/5

This is a focused revert that removes static pre-calculation logic and restores runtime measurement via GeometryReader probes; no new behavior is introduced beyond what existed before #6558.

The change is a clean revert of a recent squash-commit: the deleted file and its dependents are excised atomically, the GeometryReader-in-background probe pattern is correct (reads layout without affecting it, no render-time mutation), and inlined constants carry the same values as the removed centralized ones. Both rowHeightProbe implementations now consistently use the two-parameter onChange form. No actor isolation, blocking, or layout-feedback issues are introduced.

No files require special attention.

Important Files Changed

Filename Overview
Sources/ContentView.swift Drops sidebarWidth parameter chain through VerticalTabsSidebar → VerticalRenderContext → TabItemView; replaces static SidebarWorkspaceRowDropMetrics-based drop-target height with a GeometryReader probe (rowHeight @State) placed in .background; moves metadata-expansion state out of TabItemView and into SidebarMetadataRows / SidebarMetadataMarkdownBlocks as internal @State.
Sources/SidebarWorkspaceGroupHeaderMetrics.swift Removes the static dropTargetHeight computed property that pre-calculated header height without layout measurement; drop-hit height is now supplied by the GeometryReader probe in SidebarWorkspaceGroupHeaderView.
Sources/SidebarWorkspaceGroupHeaderView.swift Adds rowHeight @State + a rowHeightProbe (GeometryReader in .background) to measure the rendered header height; passes that measured height to tabDropDelegateFactory instead of the removed metrics.dropTargetHeight.
Sources/SidebarWorkspaceRowDropMetrics.swift File deleted entirely; the 464-line static layout-estimation helper is removed as its calculated heights caused workspace rows and terminal tab pills to render oversized.
cmuxTests/SidebarWorkspaceDropMetricsTests.swift Test file deleted in lockstep with SidebarWorkspaceRowDropMetrics; all tests were unit tests of the now-removed static estimation logic.
cmux.xcodeproj/project.pbxproj Removes PBXBuildFile and PBXFileReference entries for the two deleted files; all other project wiring is unchanged.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant CV as ContentView
    participant VTS as VerticalTabsSidebar
    participant TIV as TabItemView
    participant GR as GeometryReader (background probe)
    participant DD as SidebarTabDropDelegate

    CV->>VTS: init(windowId:) — sidebarWidth removed
    VTS->>TIV: init(rowSpacing:) — sidebarWidth removed
    TIV->>GR: ".background { rowHeightProbe }"
    GR-->>TIV: "onAppear / onChange → rowHeight = measured height"
    TIV->>DD: tabDropDelegateFactory(rowHeight)
    Note over TIV,DD: Drop hit-area now matches rendered row height
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant CV as ContentView
    participant VTS as VerticalTabsSidebar
    participant TIV as TabItemView
    participant GR as GeometryReader (background probe)
    participant DD as SidebarTabDropDelegate

    CV->>VTS: init(windowId:) — sidebarWidth removed
    VTS->>TIV: init(rowSpacing:) — sidebarWidth removed
    TIV->>GR: ".background { rowHeightProbe }"
    GR-->>TIV: "onAppear / onChange → rowHeight = measured height"
    TIV->>DD: tabDropDelegateFactory(rowHeight)
    Note over TIV,DD: Drop hit-area now matches rendered row height
Loading

Reviews (2): Last reviewed commit: "Use modern sidebar row height onChange s..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Sources/SidebarWorkspaceGroupHeaderView.swift`:
- Around line 113-124: The rowHeightProbe helper view is mutating `@State`
property rowHeight during render-time through onAppear and onChange callbacks,
which violates the coding guideline against render-time state writes and causes
sidebar feedback loops. Remove the state mutations from rowHeightProbe by
eliminating the rowHeight assignments in both the onAppear callback (line 117)
and the onChange callback for proxy.size.height (line 120). Instead, move height
measurement logic to the parent/owner view using a lifecycle observer, and pass
the measured row height as an immutable parameter or binding into this view to
decouple the measurement side effects from the render path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ddc99447-77dc-4d10-bba7-73b747510855

📥 Commits

Reviewing files that changed from the base of the PR and between c19767a and 91bd231.

📒 Files selected for processing (6)
  • Sources/ContentView.swift
  • Sources/SidebarWorkspaceGroupHeaderMetrics.swift
  • Sources/SidebarWorkspaceGroupHeaderView.swift
  • Sources/SidebarWorkspaceRowDropMetrics.swift
  • cmux.xcodeproj/project.pbxproj
  • cmuxTests/SidebarWorkspaceDropMetricsTests.swift
💤 Files with no reviewable changes (4)
  • cmuxTests/SidebarWorkspaceDropMetricsTests.swift
  • Sources/SidebarWorkspaceRowDropMetrics.swift
  • Sources/SidebarWorkspaceGroupHeaderMetrics.swift
  • cmux.xcodeproj/project.pbxproj

Comment thread Sources/SidebarWorkspaceGroupHeaderView.swift
@austinywang
austinywang merged commit ab9b9f0 into main Jun 23, 2026
32 checks passed
austinywang added a commit that referenced this pull request Jun 23, 2026
Integrate #6625 (revert sidebar row-height layout feedback), #6617/#6621,
and #6624. ContentView conflict: #6625 removed the render-context/row
`sidebarWidth` threading while this branch added `pinResolutionContext` —
took #6625's sidebarWidth removal and kept pinResolutionContext. Font fix
(`magnifiedFont`/@Environment), lazy tooltips, and #6625's rowHeight probe
all preserved. swift-file-length-budget.tsv regenerated via --write-budget
(only ContentView's entry changes, +40 lines).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
Preview – cmux — e629d1b0 Deployed Jun 23, 2026 by vercel[bot]
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.

1 participant