Repository navigation
Revert sidebar row-height layout feedback - #6625
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough
ChangesDrop Height: Static Estimation → Dynamic rowHeightProbe
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 22 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (22 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Greptile SummaryThis PR reverts #6558 (squash-merged as
Confidence Score: 5/5This 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
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
%%{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
Reviews (2): Last reviewed commit: "Use modern sidebar row height onChange s..." | Re-trigger Greptile |
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
Sources/ContentView.swiftSources/SidebarWorkspaceGroupHeaderMetrics.swiftSources/SidebarWorkspaceGroupHeaderView.swiftSources/SidebarWorkspaceRowDropMetrics.swiftcmux.xcodeproj/project.pbxprojcmuxTests/SidebarWorkspaceDropMetricsTests.swift
💤 Files with no reviewable changes (4)
- cmuxTests/SidebarWorkspaceDropMetricsTests.swift
- Sources/SidebarWorkspaceRowDropMetrics.swift
- Sources/SidebarWorkspaceGroupHeaderMetrics.swift
- cmux.xcodeproj/project.pbxproj
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>
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.shgit diff --check --cachedbefore the revert commitSkipped 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