From 98bbe551ea412578caa71d3d3abc48f2468e5e01 Mon Sep 17 00:00:00 2001 From: rzen Date: Sun, 9 Aug 2026 11:11:27 -0400 Subject: [PATCH] =?UTF-8?q?The=20card=20window's=20sidebar-toggle=20move?= =?UTF-8?q?=20rightmost=20in=20its=20toolbar=20=E2=80=94=20the=20conventio?= =?UTF-8?q?nal=20macOS=20position=20for=20trailing-sidebar=20controls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy --- Kanban/UI/Card/CardToolbar.swift | 27 +++++++++++++-------------- KanbanTests/ToolbarTests.swift | 15 ++++++++------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Kanban/UI/Card/CardToolbar.swift b/Kanban/UI/Card/CardToolbar.swift index b97537f..ccadc84 100644 --- a/Kanban/UI/Card/CardToolbar.swift +++ b/Kanban/UI/Card/CardToolbar.swift @@ -16,17 +16,16 @@ extension NSToolbarItem.Identifier { /// The card window's toolbar (03-board-ui.md ▸ Toolbar; 05-card-window.md ▸ Window). /// /// "**Card window default: Edit Body · Raw Source · Add Attachment** — the window's three committed -/// functions, all discoverable from its toolbar." **Show Sidebar joined them** (05-card-window.md ▸ -/// Composition, the toggle added beside the toolbar-customization work): a fourth default item, the -/// trailing sidebar's own show/hide control, the `Show Trash` precedent applied to the card window's -/// one collapsible pane. **Delete Card joined them too** (05 ▸ Actions, retired — Pipeline card -/// bcd3b323): the sidebar's Actions section is gone, and its destructive Delete moved here as the -/// fifth default item, trailing a `.flexibleSpace` so it sits apart from the four creation-and-view -/// items ahead of it — HIG's "destructive actions read as separate from the everyday cluster", -/// `Mail.app`'s own toolbar Delete being the nearest system precedent for a one-click, no-confirm, -/// recoverable-by-trash button. **Reveal in Finder joined the catalog** the same day, catalog-only — -/// it already has a menu-bar twin with no default chord (`RevealInFinderCommand`), so nothing was -/// unreachable before this; the toolbar item is Customize's shortcut to it, not its only path. +/// functions, all discoverable from its toolbar." **Delete Card joined them** (05 ▸ Actions, retired — +/// Pipeline card bcd3b323): the sidebar's Actions section is gone, and its destructive Delete moved here +/// (separated by a `.flexibleSpace` from the creation-and-view items ahead) — HIG's "destructive actions +/// read as separate from the everyday cluster", `Mail.app`'s own toolbar Delete being the nearest system +/// precedent for a one-click, no-confirm, recoverable-by-trash button. **Show Sidebar joined them too** +/// (05-card-window.md ▸ Composition, the toggle added beside the toolbar-customization work), positioned +/// rightmost as the conventional macOS place for a trailing-sidebar toggle — the `Show Trash` precedent +/// applied to the card window's one collapsible pane. **Reveal in Finder joined the catalog** the same +/// day, catalog-only — it already has a menu-bar twin with no default chord (`RevealInFinderCommand`), +/// so nothing was unreachable before this; the toolbar item is Customize's shortcut to it, not its only path. /// /// ### The six items are six menu rows, predicates included /// @@ -68,15 +67,15 @@ enum CardToolbar { /// The trio plus Show Sidebar plus Delete Card — the whole catalog except Reveal in Finder, which /// is catalog-only (already reachable off its own menu row, no default chord). The trailing - /// `.flexibleSpace` is what "placed apart from the creation-side defaults" means in code: Delete - /// Card is still a default, just not adjacent to the four items ahead of it. + /// `.flexibleSpace` separates the creation-side defaults from Delete Card, and Show Sidebar sits + /// rightmost (the conventional macOS position for a trailing-sidebar toggle). static let defaultItems: [NSToolbarItem.Identifier] = [ .cardEditBody, .cardRawSource, .cardAddAttachment, - .cardShowSidebar, .flexibleSpace, .cardDeleteCard, + .cardShowSidebar, ] /// - Parameters: diff --git a/KanbanTests/ToolbarTests.swift b/KanbanTests/ToolbarTests.swift index b48d75f..7339274 100644 --- a/KanbanTests/ToolbarTests.swift +++ b/KanbanTests/ToolbarTests.swift @@ -601,17 +601,18 @@ struct CardToolbarTests { return (body, raw, attachments, actions) } - @Test("The default set is the trio, Show Sidebar, and Delete Card — separated by a flexible space") + @Test("The default set is the trio, Delete Card, and Show Sidebar — separated by a flexible space") func defaultsAreSeparatedFromDeleteCard() { - // "Card window default: Edit Body · Raw Source · Add Attachment" joined by Show Sidebar (the - // toolbar-toggle card) and now Delete Card, HIG's "apart from the creation-side defaults" - // spelled as a literal `.flexibleSpace` between the two clusters — `BoardToolbar.defaultItems`' - // own leading-spacer pattern, turned trailing here. + // "Card window default: Edit Body · Raw Source · Add Attachment" joined by Delete Card (after + // the sidebar Actions section retired), then Show Sidebar (the trailing-sidebar toggle, at the + // rightmost position per macOS convention), with `.flexibleSpace` between the creation-side + // defaults and the destructive/sidebar-control cluster — `BoardToolbar.defaultItems`' own + // leading-spacer pattern, turned trailing here. #expect(CardToolbar.defaultItems == [ - .cardEditBody, .cardRawSource, .cardAddAttachment, .cardShowSidebar, .flexibleSpace, .cardDeleteCard, + .cardEditBody, .cardRawSource, .cardAddAttachment, .flexibleSpace, .cardDeleteCard, .cardShowSidebar, ]) #expect(CardToolbar.defaultItems.filter { $0 != .flexibleSpace } == [ - .cardEditBody, .cardRawSource, .cardAddAttachment, .cardShowSidebar, .cardDeleteCard, + .cardEditBody, .cardRawSource, .cardAddAttachment, .cardDeleteCard, .cardShowSidebar, ]) }