Build the style, details, and actions sidebar sections
The sidebar completes: the shared style editor gains a second anchor — StyleEditorLayout carries the geometry (the popover keeps its settled 268/14/7/8 untouched as the default; the sidebar packs columns to its width with no inner scroller) while every well, the batch display, the arrow grammar, and the one applyStyle bracket stay the shared component's. The card anchor is fixed, not tracking: the target is this card, and the fate walk retires the window when the card goes. Details renders every unknown frontmatter key read-only in file order — Card.document already carried them — showing the author's own bytes where the raw span is a value and the engine's rendering for block scalars and empties; reserved enhanced-schema keys are ordinary unknowns, and no keys means no section. Actions: Delete rides the same tombstone bytes as Backspace and drop-on-trash through a one-line seam, says nothing about selection, and lets the fate walk dismiss; Reveal in Finder resolves through the attachment scope so the two paths cannot disagree. History reserves its m7 slot without drawing a header no base board can honor. Claude-Session: https://claude.ai/code/session_01SR4XGjmBE16ZUYWpfFHXwY
This commit is contained in:
@@ -66,6 +66,16 @@ enum CardWindowMetrics {
|
||||
columnWidth(characters: sidebarCharacters, bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
/// What a sidebar *section* actually gets to lay out in: the column minus its two gutters.
|
||||
///
|
||||
/// Named because one section needs a number rather than a proposal — the embedded style editor's
|
||||
/// grids are a fixed count of fixed-size wells per row, and the count has to be decided before
|
||||
/// the layout runs (`StyleEditorLayout.sidebar(contentWidth:)`). Everything else in the sidebar
|
||||
/// simply fills what it is proposed and never asks.
|
||||
static func sidebarContentWidth(bodyPointSize: CGFloat) -> CGFloat {
|
||||
sidebarWidth(bodyPointSize: bodyPointSize) - 2 * gutter(bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
// MARK: - The body column
|
||||
|
||||
/// The narrowest the body column is allowed to get — a measure of prose short enough to be a
|
||||
@@ -79,6 +89,15 @@ enum CardWindowMetrics {
|
||||
columnWidth(characters: bodyMinimumCharacters, bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
// MARK: - A sidebar section
|
||||
|
||||
/// The gap between a sidebar section's header and its content, and between two rows of it —
|
||||
/// half a gutter, which is the attachment rows' inset and the rendered body's rhythm too, so the
|
||||
/// whole window is spaced by one unit rather than by three that happen to agree.
|
||||
static func sidebarRowSpacing(bodyPointSize: CGFloat) -> CGFloat {
|
||||
previewPadding(bodyPointSize: bodyPointSize)
|
||||
}
|
||||
|
||||
// MARK: - The attachments section
|
||||
|
||||
/// An attachment row's thumbnail: a **small** square, one and a half ems on a side
|
||||
|
||||
Reference in New Issue
Block a user