Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,18 @@ struct ContentView: View {
.frame(maxWidth: .infinity)
.overlay(alignment: .topLeading) {
customTitlebar(appearance: appearance)
// The workspace titlebar band spans the full window width and sits at
// zIndex(100) over the content/sidebar layout. Its drag/double-click
// surface (`WindowDragHandleView` + `.contentShape(Rectangle())`) must
// not cover the right sidebar, whose mode bar (Files/Search/Feed/Vault)
// lives inside the titlebar-height strip — otherwise the band wins the
// hit-test and swallows every click/hover on those buttons (#5099).
// Confine the interactive titlebar surface to the area left of the
// right sidebar, matching the pre-#5017 "only over terminal content,
// not the sidebar" intent. The left sidebar's titlebar controls live in
// the AppKit titlebar accessory (above this band), so only the trailing
// (right-sidebar) edge needs to be ceded here.
.padding(.trailing, rightSidebarVisible ? rightSidebarWidth : 0)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The ternary is redundant: rightSidebarWidth is already computed as rightSidebarVisible ? fileExplorerWidth : 0, so rightSidebarVisible ? rightSidebarWidth : 0 always equals rightSidebarWidth. Using rightSidebarWidth directly also keeps this line consistent with how the same property is used elsewhere (e.g. .frame(width: rightSidebarWidth) on the panel).

Suggested change
.padding(.trailing, rightSidebarVisible ? rightSidebarWidth : 0)
.padding(.trailing, rightSidebarWidth)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch — simplified to .padding(.trailing, rightSidebarWidth) in e386c2f, since rightSidebarWidth already evaluates to 0 when the sidebar is hidden.

— Claude Code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Animation desync on sidebar toggle

rightSidebarPanel carries .transaction { $0.animation = nil } (line 2240), so it snaps immediately when fileExplorerState.isVisible changes. The new .padding(.trailing, …) on the titlebar band has no matching animation suppression. If any ancestor view wraps the visibility toggle in a withAnimation, the sidebar panel disappears/appears instantaneously while the titlebar band slowly closes/opens its trailing gap — briefly leaving an uncovered strip (sidebar gone, band still padded) or a covered strip (sidebar present, band not yet padded). Adding .transaction { $0.animation = nil } on the same modifier or on the workspaceTitlebarBand call site would keep both surfaces in sync.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in e386c2f: added .animation(nil, value: rightSidebarWidth) on the band's trailing inset so it snaps in lockstep with the sidebar panel (which uses .transaction { $0.animation = nil }). The hit-region edge can no longer animate out of step and momentarily re-cover the mode bar during toggle.

— Claude Code

}
.overlay(alignment: .topLeading) {
if isFullScreen && sidebarState.isVisible {
Expand Down
Loading