From 21785c019f0e45179432a8b5d045f9a19fd68d62 Mon Sep 17 00:00:00 2001 From: Leo Li Date: Wed, 21 Oct 2026 02:44:14 -0700 Subject: [PATCH] test(next sidebar): the gutter test expects the pill's trailing trim from #22733 #22733 (Leo 2026-10-20) ends every sidebar row SidebarStyle.rowTrailingTrim (Metrics.space4, 8 pt) short of the list's right inset, so the pill never runs to the sidebar's edge. SidebarRowGutterTests still required the pill to end at the inset and at the divider's right edge, so it has been red on feat-cmux-next since then. The content insets inside the pill stay equal; only the pill's right edge moves in by the trim. Co-Authored-By: Claude Opus 5.5 Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15c01-a42d-7970-a4a7-2f0ac203c940&host=cosmic-gray --- .../CmuxNextAppTests/SidebarRowGutterTests.swift | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/SidebarRowGutterTests.swift b/Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/SidebarRowGutterTests.swift index 2951e61a38b6..07d8214c1138 100644 --- a/Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/SidebarRowGutterTests.swift +++ b/Packages/macOS/CmuxNext/Tests/CmuxNextAppTests/SidebarRowGutterTests.swift @@ -10,6 +10,9 @@ import Testing /// (`SidebarStyle.horizontalInset`) now sets the pill's distance from the /// sidebar's edges and the content's distance from the pill's, on both sides, /// selected or not, and the badge is as tall as the glyph, with tabular digits. +/// Since Leo 2026-10-20 (#22733) the pill also stops `SidebarStyle.rowTrailingTrim` +/// short of the right inset, so its right edge never runs to the sidebar's edge; +/// the content's insets inside the pill stay equal. @MainActor @Suite(.serialized) struct SidebarRowGutterTests { private static let pinnedID = WorkspaceID("ws-pinned") private static let unreadID = WorkspaceID("ws-unread") @@ -64,9 +67,11 @@ import Testing for (name, row) in [("unselected", unread), ("selected", selected)] { let (leading, trailing) = try Self.insets(row) #expect(leading == trailing, "\(name): text \(leading) pt in, marks \(trailing) pt in") - // The pill's own inset from the list's edges is the same token. + // The pill's own inset from the list's edges is the same token, plus the trim on the right. #expect(leading == gutter, "\(name): text \(leading) pt in, pill inset \(gutter)") - #expect(row.frame.minX == gutter && sidebar.list.bounds.width - row.frame.maxX == gutter) + #expect(row.frame.minX == gutter) + #expect(sidebar.list.bounds.width - row.frame.maxX == gutter + SidebarStyle.rowTrailingTrim, + "\(name): pill ends \(sidebar.list.bounds.width - row.frame.maxX) pt in") } } @@ -78,7 +83,9 @@ import Testing let pill = list.convert(try Self.row(sidebar, id).frame, to: sidebar) let headerFrame = list.convert(header.frame, to: sidebar) #expect(pill.minX == headerFrame.minX, "pill \(pill.minX), header \(headerFrame.minX)") - #expect(pill.maxX == sidebar.aboveLine.frame.maxX, "pill \(pill.maxX), divider \(sidebar.aboveLine.frame.maxX)") + // The divider runs to the inset; the pill stops the trim short of it (#22733). + #expect(pill.maxX == sidebar.aboveLine.frame.maxX - SidebarStyle.rowTrailingTrim, + "pill \(pill.maxX), divider \(sidebar.aboveLine.frame.maxX)") #expect(pill.minX == sidebar.aboveLine.frame.minX, "pill \(pill.minX), divider \(sidebar.aboveLine.frame.minX)") } }