A card window toolbar control shows and hides the trailing sidebar — View ▸ Show Sidebar joins Edit Body, Raw Source and Add Attachment
The card window's trailing attributes sidebar has always been unconditional since m6; this adds View ▸ Show Sidebar (a checkmark toggle, ShowComments' shape) and a matching toolbar item on the customizable card toolbar (NSToolbar/WindowToolbarController), a fourth default beside Edit Body, Raw Source and Add Attachment. sidebar.right for the trailing pane; one shared animated write path (AppPreferences.setShowCardSidebar) both faces call, structural-voice reflow with a trailing slide-and-fade transition (Motion.cardSidebarTransition), Reduce Motion respected throughout. CardWindowMetrics.minimumSize gains a sidebar: Bool = true parameter so a hidden sidebar shrinks the window's floor, composing with the existing commentsColumn parameter. The toolbar item's read/write are injectable closures (defaulted to the real UserDefaults-backed pair) so its plumbing is testable without touching the developer's own preferences domain. WindowToolbarController's observation tracking only sees @Observable reads, so a small HostedWindowController.revalidateToolbar() plus an onChange nudge keeps the toolbar button's on-state in step with the View-menu row's write. Scope held narrowly to visibility, per the card: no sidebar section reordering, no action-moving. Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -107,6 +107,13 @@ struct FindSteppingCommands: View {
|
||||
/// The comments pane's two rows join them (11-command-nexus.md lists Show Comments and Comments
|
||||
/// Beside Body between Edit Body and Raw Source): both are live, both are app-wide persisted bits,
|
||||
/// and both are scoped to the card window (`ShowCommentsCommand`, `CommentsBesideBodyCommand`).
|
||||
///
|
||||
/// **Show Sidebar joined at the end** (05-card-window.md ▸ Composition, the toolbar-toggle card):
|
||||
/// the trailing attributes sidebar's own visibility bit, `ShowCommentsCommand`'s shape exactly and
|
||||
/// mirroring the toolbar's own item (`CardToolbar`) the way View ▸ Show Trash mirrors its toolbar
|
||||
/// twin. Appended rather than interleaved with the comments pair, to leave the block 11 already
|
||||
/// documents (Edit Body · Show Comments · Comments Beside Body · Raw Source) in the order it names —
|
||||
/// this row is additive, not a resequencing.
|
||||
struct CardViewCommands: View {
|
||||
var body: some View {
|
||||
EditBodyCommand()
|
||||
@@ -114,5 +121,6 @@ struct CardViewCommands: View {
|
||||
CommentsBesideBodyCommand()
|
||||
RawSourceCommand()
|
||||
FutureCommand(title: "History")
|
||||
ShowSidebarCommand()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user