The card window's sidebar-toggle move rightmost in its toolbar — the conventional macOS position for trailing-sidebar controls

Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
2026-08-09 12:06:01 -04:00
parent 10f4e9b452
commit 98bbe551ea
2 changed files with 21 additions and 21 deletions
+13 -14
View File
@@ -16,17 +16,16 @@ extension NSToolbarItem.Identifier {
/// The card window's toolbar (03-board-ui.md Toolbar; 05-card-window.md Window). /// 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 /// "**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 /// functions, all discoverable from its toolbar." **Delete Card joined them** (05 Actions, retired
/// Composition, the toggle added beside the toolbar-customization work): a fourth default item, the /// Pipeline card bcd3b323): the sidebar's Actions section is gone, and its destructive Delete moved here
/// trailing sidebar's own show/hide control, the `Show Trash` precedent applied to the card window's /// (separated by a `.flexibleSpace` from the creation-and-view items ahead) HIG's "destructive actions
/// one collapsible pane. **Delete Card joined them too** (05 Actions, retired Pipeline card /// read as separate from the everyday cluster", `Mail.app`'s own toolbar Delete being the nearest system
/// bcd3b323): the sidebar's Actions section is gone, and its destructive Delete moved here as the /// precedent for a one-click, no-confirm, recoverable-by-trash button. **Show Sidebar joined them too**
/// fifth default item, trailing a `.flexibleSpace` so it sits apart from the four creation-and-view /// (05-card-window.md Composition, the toggle added beside the toolbar-customization work), positioned
/// items ahead of it HIG's "destructive actions read as separate from the everyday cluster", /// rightmost as the conventional macOS place for a trailing-sidebar toggle the `Show Trash` precedent
/// `Mail.app`'s own toolbar Delete being the nearest system precedent for a one-click, no-confirm, /// applied to the card window's one collapsible pane. **Reveal in Finder joined the catalog** the same
/// recoverable-by-trash button. **Reveal in Finder joined the catalog** the same day, catalog-only /// day, catalog-only it already has a menu-bar twin with no default chord (`RevealInFinderCommand`),
/// it already has a menu-bar twin with no default chord (`RevealInFinderCommand`), so nothing was /// so nothing was unreachable before this; the toolbar item is Customize's shortcut to it, not its only path.
/// 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 /// ### 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 /// 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 /// 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 /// `.flexibleSpace` separates the creation-side defaults from Delete Card, and Show Sidebar sits
/// Card is still a default, just not adjacent to the four items ahead of it. /// rightmost (the conventional macOS position for a trailing-sidebar toggle).
static let defaultItems: [NSToolbarItem.Identifier] = [ static let defaultItems: [NSToolbarItem.Identifier] = [
.cardEditBody, .cardEditBody,
.cardRawSource, .cardRawSource,
.cardAddAttachment, .cardAddAttachment,
.cardShowSidebar,
.flexibleSpace, .flexibleSpace,
.cardDeleteCard, .cardDeleteCard,
.cardShowSidebar,
] ]
/// - Parameters: /// - Parameters:
+8 -7
View File
@@ -601,17 +601,18 @@ struct CardToolbarTests {
return (body, raw, attachments, actions) 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() { func defaultsAreSeparatedFromDeleteCard() {
// "Card window default: Edit Body · Raw Source · Add Attachment" joined by Show Sidebar (the // "Card window default: Edit Body · Raw Source · Add Attachment" joined by Delete Card (after
// toolbar-toggle card) and now Delete Card, HIG's "apart from the creation-side defaults" // the sidebar Actions section retired), then Show Sidebar (the trailing-sidebar toggle, at the
// spelled as a literal `.flexibleSpace` between the two clusters `BoardToolbar.defaultItems`' // rightmost position per macOS convention), with `.flexibleSpace` between the creation-side
// own leading-spacer pattern, turned trailing here. // defaults and the destructive/sidebar-control cluster `BoardToolbar.defaultItems`' own
// leading-spacer pattern, turned trailing here.
#expect(CardToolbar.defaultItems == [ #expect(CardToolbar.defaultItems == [
.cardEditBody, .cardRawSource, .cardAddAttachment, .cardShowSidebar, .flexibleSpace, .cardDeleteCard, .cardEditBody, .cardRawSource, .cardAddAttachment, .flexibleSpace, .cardDeleteCard, .cardShowSidebar,
]) ])
#expect(CardToolbar.defaultItems.filter { $0 != .flexibleSpace } == [ #expect(CardToolbar.defaultItems.filter { $0 != .flexibleSpace } == [
.cardEditBody, .cardRawSource, .cardAddAttachment, .cardShowSidebar, .cardDeleteCard, .cardEditBody, .cardRawSource, .cardAddAttachment, .cardDeleteCard, .cardShowSidebar,
]) ])
} }