Skip to content

Follow-up to #5102: simplify titlebar inset + fix sidebar-toggle animation desync#5104

Merged
austinywang merged 1 commit into
mainfrom
issue-5099-titlebar-inset-followup
Jun 1, 2026
Merged

Follow-up to #5102: simplify titlebar inset + fix sidebar-toggle animation desync#5104
austinywang merged 1 commit into
mainfrom
issue-5099-titlebar-inset-followup

Conversation

@austinywang

@austinywang austinywang commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #5102 (the #5099 titlebar-band hit-region fix). #5102 merged at its first commit, so these two review-feedback improvements from Greptile didn't make it into main:

  1. Redundant ternaryrightSidebarVisible ? rightSidebarWidth : 0 is redundant because rightSidebarWidth already evaluates to 0 when the sidebar is hidden. Simplified to .padding(.trailing, rightSidebarWidth).

  2. Animation desync (P2) — the right sidebar panel snaps without animation (.transaction { $0.animation = nil }), but the titlebar band's trailing inset could animate out of step during toggle, momentarily re-covering the right-sidebar mode bar (a brief dead-click window right after the sidebar appears). Added .animation(nil, value: rightSidebarWidth) so the band's hit-region edge snaps in lockstep with the panel.

No functional change to the merged fix; this only tightens the inset and removes the transient desync. Addresses the two open Greptile threads on #5102.

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.


Note

Low Risk
Small SwiftUI layout/hit-testing tweak in the titlebar overlay with no auth, data, or API impact.

Overview
Tightens the fullscreen titlebar drag band trailing inset in ContentView: it now uses rightSidebarWidth directly (no redundant rightSidebarVisible check) and disables animation on that inset so it snaps in sync with the right sidebar panel.

That removes a brief window where the band could animate out of step with the sidebar and re-cover the right-sidebar mode bar after toggle—dead clicks on Files/Search/Feed/Vault controls—without changing the underlying #5099/#5102 hit-region fix.

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


Summary by cubic

Simplified the titlebar band's trailing inset and synced it with the right sidebar snap to eliminate a brief dead-click window during sidebar toggle.

  • Bug Fixes

    • Snap the band's trailing hit-region by disabling animation tied to rightSidebarWidth, matching the sidebar panel’s non-animated toggle.
  • Refactors

    • Use rightSidebarWidth directly for trailing padding; remove redundant ternary.

Written for commit e3a3411. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Improved alignment of the interactive titlebar area when toggling the right sidebar visibility to prevent misalignment during transitions.

Address review feedback on #5102:
- `rightSidebarVisible ? rightSidebarWidth : 0` is redundant — `rightSidebarWidth`
  already evaluates to 0 when the sidebar is hidden. Use it directly.
- The right sidebar panel snaps without animation; match that on the titlebar
  band's trailing inset (`.animation(nil, value: rightSidebarWidth)`) so the
  hit-region edge can't animate out of step with the panel during toggle and
  briefly re-cover the mode bar.

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

vercel Bot commented Jun 1, 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 1, 2026 11:33am
cmux-staging Building Building Preview, Comment Jun 1, 2026 11:33am

@coderabbitai

coderabbitai Bot commented Jun 1, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ee831a76-f25b-4edd-bd40-f0e5e9404a34

📥 Commits

Reviewing files that changed from the base of the PR and between f4ff9de and e3a3411.

📒 Files selected for processing (1)
  • Sources/ContentView.swift

📝 Walkthrough

Walkthrough

The change ensures the workspace titlebar’s right-edge interactive region now always uses the actual right sidebar width for its inset, disabling the inset animation to keep the interaction zone perfectly synchronized with sidebar show/hide transitions.

Changes

Right Sidebar Titlebar Inset Update

Layer / File(s) Summary
Titlebar trailing inset keyed to sidebar width
Sources/ContentView.swift
The workspaceTitlebarBand's drag/double-click surface now keys its trailing inset directly off rightSidebarWidth (not rightSidebarVisible), disables animation for inset updates, and ensures perfect sync between the sidebar edge and the titlebar interaction boundary.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TitlebarBand
  participant Sidebar

  User->>TitlebarBand: Drag/double-click near right edge
  TitlebarBand->>Sidebar: Reads rightSidebarWidth
  TitlebarBand-->>User: Sets interactive region right inset to Sidebar's width (sync/no animation)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • manaflow-ai/cmux#5101: Adjusts titlebar hit-testing for right-sidebar/show-hide, resolving related UI boundary issues between titlebar and sidebar controls.

Poem

Beneath the titlebar band so wide,
Syncs the edge where actions hide.
The sidebar's width now rules the space,
No more lag—just perfect grace.
A rabbit’s nod to seamless flow,
Where insets march where sidebars go! 🐇✨

🚥 Pre-merge checks | ✅ 16 | ❌ 2

❌ Failed checks (1 warning, 1 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.
Description check ❓ Inconclusive The description provides clear context about changes, but lacks structured testing information and demo content required by the template. Add a Testing section describing how the changes were tested locally (e.g., toggling sidebar, verifying animation sync) and consider including a demo video for the UI behavior fix.
✅ Passed checks (16 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: simplifying the titlebar inset and fixing animation desync issues related to sidebar toggling.
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 Changes are purely UI modifier refinements in ContentView.swift's private workspaceTitlebarBand() method within a SwiftUI View struct; no actor isolation issues introduced.
Cmux Swift Blocking Runtime ✅ Passed No blocking runtime patterns introduced. Changes are pure SwiftUI view modifiers (.padding, .animation(nil)) without Task.sleep, locks, semaphores, or polling.
Cmux No Hacky Sleeps ✅ Passed The check applies only to non-Swift code (TypeScript, JavaScript, shell). This PR modifies only Swift (Sources/ContentView.swift). Swift timing checks are covered separately.
Cmux Algorithmic Complexity ✅ Passed PR modifies only SwiftUI layout/animation modifiers with O(1) operations on constant values, not scalable collections or algorithmic operations.
Cmux Swift Concurrency ✅ Passed PR changes only SwiftUI view modifiers (.padding and .animation) in ContentView.swift to fix titlebar inset behavior; no async/concurrency patterns introduced or expanded.
Cmux Swift @Concurrent ✅ Passed The PR changes only UI view layout modifiers (.padding, .animation) in ContentView.swift with no async functions or @concurrent annotations added, modified, or involved.
Cmux Swift File And Package Boundaries ✅ Passed Already-budgeted oversized file (15,956 lines). PR adds 8 lines as focused bug fix: simplified titlebar inset and fixed animation desync, preserving UI-glue extraction path.
Cmux Swift Logging ✅ Passed No logging violations found. The diff adds only comments and UI property changes (.padding, .animation) with no print, debugPrint, dump, or NSLog statements.
Cmux User-Facing Error Privacy ✅ Passed PR has no user-facing errors, alerts, or sensitive data. Changes are technical UI adjustments (padding and animation control) only.
Cmux Full Internationalization ✅ Passed The PR contains only technical code changes with no new user-facing text: simplified titlebar inset calculation and added animation modifier. Only developer-only comments were added.
Cmux Swiftui State Layout ✅ Passed PR only modifies titlebar inset using existing state; no new @Observable/@published, GeometryReader, lazy rows, or render-time mutations.
Cmux Architecture Rethink ✅ Passed PR simplifies redundant titlebar inset and adds animation control to prevent sidebar-toggle desync. No timing hacks, locks, or observers; clear invariant documented in comments.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR modifies only the workspaceTitlebarBand view's padding and animation—an existing UI element in the main workspace window, not a standalone window requiring close-shortcut registration.

✏️ 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 issue-5099-titlebar-inset-followup

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

greptile-apps Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Tightens the #5099/5102 titlebar-band hit-region fix: drops the redundant rightSidebarVisible ? guard (since rightSidebarWidth already returns 0 when hidden) and synchronises the inset's animation policy with the right-sidebar panel, which snaps via .transaction { $0.animation = nil }.

  • Ternary simplificationrightSidebarWidth is defined as rightSidebarVisible ? fileExplorerWidth : 0, so the old ternary at the call-site was a no-op; the cleaned-up .padding(.trailing, rightSidebarWidth) is both shorter and self-documenting.
  • Animation-policy alignment.animation(nil, value: rightSidebarWidth) prevents the trailing inset from animating while the panel itself snaps; without this, the inset could lag behind the panel on toggle, creating a brief dead-click window over the sidebar mode bar.

Confidence Score: 5/5

Safe to merge — both changes are strictly additive cleanup with no functional risk.

The ternary removal is a provably equivalent simplification: rightSidebarWidth is already the conditional expression. The animation suppressor is a targeted, value-scoped modifier that matches the existing panel policy exactly, closing the transient hit-test gap without touching any other animations or state paths. No new state, no new timing dependency, and no path through which the change could regress the original #5099 fix.

No files require special attention.

Important Files Changed

Filename Overview
Sources/ContentView.swift Removes redundant ternary from .padding(.trailing, …) and adds .animation(nil, value: rightSidebarWidth) to snap the titlebar hit-region edge in lockstep with the panel snap.

Sequence Diagram

sequenceDiagram
    participant User
    participant RightSidebarPanel
    participant TitlebarBand

    User->>RightSidebarPanel: toggle sidebar visibility
    Note over RightSidebarPanel: .transaction { $0.animation = nil }
    Note over TitlebarBand: .animation(nil, value: rightSidebarWidth)
    RightSidebarPanel-->>TitlebarBand: rightSidebarWidth changes
    TitlebarBand-->>User: hit-region edge and panel edge move together
Loading

Reviews (1): Last reviewed commit: "fix: simplify titlebar inset and keep it..." | Re-trigger Greptile

@austinywang austinywang merged commit 865b773 into main Jun 1, 2026
18 of 19 checks passed
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