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).
///
/// "**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:
+8 -7
View File
@@ -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,
])
}