From 5bc7d2a078d15450bb18dd74b37bc36d50f7e1ea Mon Sep 17 00:00:00 2001 From: Lawrence Chen <54008264+lawrencecchen@users.noreply.github.com> Date: Sun, 27 Sep 2026 21:26:45 -0700 Subject: [PATCH 1/2] Unify right sidebar button corner radius Every right sidebar button now uses RightSidebarChromeMetrics.buttonCornerRadius (6pt, the header icon button radius): mode and Vault grouping pills (were 5pt), compact Feed buttons (5pt), Cloud chrome icon buttons (4pt), the session preview close button (4pt), the Cloud team picker hit shape (capsule), and system bordered buttons in Dock and Cloud (platform default shape). Co-Authored-By: Claude Opus 5.5 (1M context) --- Sources/Cloud/CloudTeamPickerRow.swift | 2 +- Sources/Cloud/MachinesControlBarComponents.swift | 2 +- .../Feed/FeedButtonStyleDebugWindowController.swift | 10 +++++----- Sources/Feed/FeedPanelView.swift | 2 +- Sources/RightSidebarChromeStyle.swift | 10 ++++++++-- Sources/RightSidebarPanelView.swift | 1 + Sources/SessionIndexView.swift | 4 ++-- Sources/SidebarSearchFieldCell.swift | 2 +- Sources/VaultCheckpointTimelineView.swift | 2 +- Sources/WindowChromeMetrics.swift | 9 +++++---- 10 files changed, 26 insertions(+), 18 deletions(-) diff --git a/Sources/Cloud/CloudTeamPickerRow.swift b/Sources/Cloud/CloudTeamPickerRow.swift index 23752312c490..b88555b864de 100644 --- a/Sources/Cloud/CloudTeamPickerRow.swift +++ b/Sources/Cloud/CloudTeamPickerRow.swift @@ -29,7 +29,7 @@ struct CloudTeamPickerRow: View { } .padding(.horizontal, 7) .frame(height: 22) - .contentShape(Capsule(style: .continuous)) + .contentShape(RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous)) } .buttonStyle(.plain) .popover(isPresented: $isPresented, arrowEdge: .top) { diff --git a/Sources/Cloud/MachinesControlBarComponents.swift b/Sources/Cloud/MachinesControlBarComponents.swift index d526fef7bc60..cac467b24c65 100644 --- a/Sources/Cloud/MachinesControlBarComponents.swift +++ b/Sources/Cloud/MachinesControlBarComponents.swift @@ -130,7 +130,7 @@ struct MachinesChromeIconButton: View { .buttonStyle(.plain) .foregroundColor(isHovered ? .primary : .secondary) .background( - RoundedRectangle(cornerRadius: 4, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill(isHovered ? Color.primary.opacity(0.06) : Color.clear) ) .onHover { isHovered = $0 } diff --git a/Sources/Feed/FeedButtonStyleDebugWindowController.swift b/Sources/Feed/FeedButtonStyleDebugWindowController.swift index 96873d292548..0b7af790208f 100644 --- a/Sources/Feed/FeedButtonStyleDebugWindowController.swift +++ b/Sources/Feed/FeedButtonStyleDebugWindowController.swift @@ -322,11 +322,11 @@ enum FeedButtonDebugSettings { } static var compactCornerRadius: Double { - double(forKey: compactCornerRadiusKey, defaultValue: 5) + double(forKey: compactCornerRadiusKey, defaultValue: Double(RightSidebarChromeMetrics.buttonCornerRadius)) } static var mediumCornerRadius: Double { - double(forKey: mediumCornerRadiusKey, defaultValue: 6) + double(forKey: mediumCornerRadiusKey, defaultValue: Double(RightSidebarChromeMetrics.buttonCornerRadius)) } static var compactHorizontalPadding: Double { @@ -608,7 +608,7 @@ enum FeedButtonDebugPreset: String, CaseIterable, Identifiable { var compactCornerRadius: Double { switch self { - case .solidClassic, .minimalFlat: return 5.0 + case .solidClassic, .minimalFlat: return 6.0 case .raycastGlass, .frostedOutline: return 7.0 case .standardLiquidGlass, .tintedLiquidGlass: return 8.0 case .nativeGlass: return 9.0 @@ -862,7 +862,7 @@ private struct FeedButtonStyleDebugView: View { @AppStorage(FeedButtonDebugSettings.paletteKey) private var paletteRaw = FeedButtonDebugPalettePreset.system.rawValue @AppStorage(FeedButtonDebugSettings.compactCornerRadiusKey) - private var compactCornerRadius = 5.0 + private var compactCornerRadius = 6.0 @AppStorage(FeedButtonDebugSettings.mediumCornerRadiusKey) private var mediumCornerRadius = 6.0 @AppStorage(FeedButtonDebugSettings.compactHorizontalPaddingKey) @@ -925,7 +925,7 @@ private struct FeedButtonStyleDebugView: View { FeedButtonDebugSettings.reset() styleRaw = FeedButtonDebugVisualStyle.solid.rawValue paletteRaw = FeedButtonDebugPalettePreset.system.rawValue - compactCornerRadius = 5.0 + compactCornerRadius = 6.0 mediumCornerRadius = 6.0 compactHorizontalPadding = 8.0 mediumHorizontalPadding = 12.0 diff --git a/Sources/Feed/FeedPanelView.swift b/Sources/Feed/FeedPanelView.swift index 7baa7aff5a6b..d0089215fad0 100644 --- a/Sources/Feed/FeedPanelView.swift +++ b/Sources/Feed/FeedPanelView.swift @@ -1848,7 +1848,7 @@ struct FeedButton: View { ? CGFloat(FeedButtonDebugSettings.compactCornerRadius) : CGFloat(FeedButtonDebugSettings.mediumCornerRadius) #else - return size == .compact ? 5 : 6 + return RightSidebarChromeMetrics.buttonCornerRadius #endif } private var horizontalPadding: CGFloat { diff --git a/Sources/RightSidebarChromeStyle.swift b/Sources/RightSidebarChromeStyle.swift index a3bdf1cf6498..3245bf2fd639 100644 --- a/Sources/RightSidebarChromeStyle.swift +++ b/Sources/RightSidebarChromeStyle.swift @@ -149,11 +149,11 @@ struct RightSidebarChromePillModifier: ViewModifier { isVisible: true ) .background( - RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.controlCornerRadius, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill(backgroundColor) ) .contentShape( - RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.controlCornerRadius, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) ) } @@ -295,6 +295,12 @@ extension View { modifier(RightSidebarChromeBottomBorderModifier(backgroundColor: backgroundColor)) } + /// Gives system bordered buttons below this view the shared + /// right-sidebar button radius instead of the platform default shape. + func rightSidebarButtonBorderShape() -> some View { + buttonBorderShape(.roundedRectangle(radius: RightSidebarChromeMetrics.buttonCornerRadius)) + } + func rightSidebarHeaderControlAlignment() -> some View { alignmentGuide(VerticalAlignment.center) { dimensions in dimensions[VerticalAlignment.center] + RightSidebarChromeMetrics.headerControlCenterAlignmentAdjustment diff --git a/Sources/RightSidebarPanelView.swift b/Sources/RightSidebarPanelView.swift index 534124e917da..9375a41fc222 100644 --- a/Sources/RightSidebarPanelView.swift +++ b/Sources/RightSidebarPanelView.swift @@ -173,6 +173,7 @@ struct RightSidebarPanelView: View { contentForMode .frame(maxWidth: .infinity, maxHeight: .infinity) } + .rightSidebarButtonBorderShape() .frame(maxWidth: .infinity, maxHeight: .infinity) // Keep every mode (including Dock and AppKit-backed file rows) on the // same resolved cmux scheme as the window and left sidebar. diff --git a/Sources/SessionIndexView.swift b/Sources/SessionIndexView.swift index 59b4915e13b9..22f36f61b66f 100644 --- a/Sources/SessionIndexView.swift +++ b/Sources/SessionIndexView.swift @@ -1252,10 +1252,10 @@ struct SessionTranscriptPreviewView: View { CmuxSystemSymbolImage(magnified: "xmark", pointSize: 11, weight: .semibold, tint: closeIsHovered ? .primary : .secondary) .frame(width: 20, height: 20) .background( - RoundedRectangle(cornerRadius: 4, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill(closeIsHovered ? Color.primary.opacity(0.08) : Color.clear) ) - .contentShape(RoundedRectangle(cornerRadius: 4, style: .continuous)) + .contentShape(RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous)) .onHover { closeIsHovered = $0 } .onTapGesture { onDismiss() diff --git a/Sources/SidebarSearchFieldCell.swift b/Sources/SidebarSearchFieldCell.swift index 6e8b9bdd9bf2..0053782553d9 100644 --- a/Sources/SidebarSearchFieldCell.swift +++ b/Sources/SidebarSearchFieldCell.swift @@ -17,7 +17,7 @@ final class SidebarSearchFieldCell: NSSearchFieldCell { context.saveGState() context.setFillColor(NSColor.labelColor.withAlphaComponent(0.06).cgColor) context.addPath(RoundedRectangle( - cornerRadius: RightSidebarChromeMetrics.controlCornerRadius, + cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous ).path(in: frame).cgPath) context.fillPath() diff --git a/Sources/VaultCheckpointTimelineView.swift b/Sources/VaultCheckpointTimelineView.swift index 18eef8a33214..e2dc970fbcac 100644 --- a/Sources/VaultCheckpointTimelineView.swift +++ b/Sources/VaultCheckpointTimelineView.swift @@ -418,7 +418,7 @@ private struct VaultCheckpointRow: View, Equatable { .padding(.horizontal, 8) .frame(height: 22) .background( - RoundedRectangle(cornerRadius: 6, style: .continuous) + RoundedRectangle(cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, style: .continuous) .fill( isForkEnabled ? cmuxAccent.color.opacity(isHovered ? 0.16 : 0.10) diff --git a/Sources/WindowChromeMetrics.swift b/Sources/WindowChromeMetrics.swift index 502f902dad9f..92d38bc28582 100644 --- a/Sources/WindowChromeMetrics.swift +++ b/Sources/WindowChromeMetrics.swift @@ -54,9 +54,10 @@ enum RightSidebarChromeMetrics { static var contentIconCenter: CGFloat { contentIconLeadingPadding + contentIconFrameSize / 2 } - static var controlCornerRadius: CGFloat { - min(10, max(5, controlHeight * 0.25)) - } + /// Corner radius for every right-sidebar button: header icon buttons, + /// mode and grouping pills, panel action buttons, and system bordered + /// buttons (via `rightSidebarButtonBorderShape()`). + static let buttonCornerRadius: CGFloat = HeaderChromeControlMetrics.cornerRadius static let headerControlSize: CGFloat = HeaderChromeControlMetrics.buttonSize static let headerIconSize: CGFloat = 10 static let headerIconFrameSize: CGFloat = headerIconSize @@ -66,7 +67,7 @@ enum RightSidebarChromeMetrics { /// controls share one leading column and one trailing column. static let headerLeadingPadding: CGFloat = HeaderChromeControlMetrics.titlebarControlsLeadingPadding static let headerTrailingPadding: CGFloat = 6 - static let headerControlCornerRadius: CGFloat = HeaderChromeControlMetrics.cornerRadius + static let headerControlCornerRadius: CGFloat = buttonCornerRadius static let headerControlCenterAlignmentAdjustment: CGFloat = 0 } From deb37f5f5b4558db430ddb3c0aca3dae6da0da9e Mon Sep 17 00:00:00 2001 From: Leo Li Date: Mon, 28 Sep 2026 03:25:25 -0700 Subject: [PATCH 2/2] Route the Checkpoint Now button through the shared radius The Vault "Checkpoint Now" button still drew a 7pt corner radius while every other right sidebar button moved to RightSidebarChromeMetrics.buttonCornerRadius. It is a button, not a card, row or text field, so the PR's own rule covers it. The text field beside it in the same row keeps its 7pt radius, since text fields are exempt. The two now differ by a point. Co-Authored-By: Claude Opus 5.5 (1M context) --- Sources/VaultCheckpointTimelineView.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/VaultCheckpointTimelineView.swift b/Sources/VaultCheckpointTimelineView.swift index e2dc970fbcac..8df658ae68de 100644 --- a/Sources/VaultCheckpointTimelineView.swift +++ b/Sources/VaultCheckpointTimelineView.swift @@ -146,8 +146,11 @@ struct VaultCheckpointTimelineView: View { .padding(.horizontal, 10) .frame(height: 26) .background( - RoundedRectangle(cornerRadius: 7, style: .continuous) - .fill(cmuxAccent.color.opacity(0.13)) + RoundedRectangle( + cornerRadius: RightSidebarChromeMetrics.buttonCornerRadius, + style: .continuous + ) + .fill(cmuxAccent.color.opacity(0.13)) ) } .buttonStyle(.borderless)