replace symbol grid in card window sidebar with a compact symbol picker
The card window sidebar's Style section embedded StyleEditorView symbols-only (showsBackground: false, showsSymbols: true), drawing the curated grid whole inside the sidebar's own scroll view — a permanently open 5-7 row grid ahead of every other section. Replace it with the reusable compact SymbolPicker (already used by BoardInfoPopover for the board's glyph): a single well at rest, the grid only inside its own popover. - CardStyleSection no longer instantiates StyleEditorView at all. A new "Symbol" row mirrors the existing "Background" row's inspector shape (caption leading, control trailing), wiring SymbolPicker's onSelect/ onSelectColor to icon/iconColor through StyleCommand.apply(...on: undo), the exact funnel the background combo already rides — so the card window's undo session semantics (13-native-undo.md) are unchanged. - The picker is fed CuratedSymbols.available rather than its own smaller general-purpose default, so a card's curated vocabulary doesn't shrink. - StyleEditorLayout.sidebar and showsBackground stay in StyleEditor.swift (still correct, still tested) rather than being cut as dead code — a separate, larger cleanup this card doesn't make (recorded on the card). - DESIGN/03-board-ui.md and DESIGN/05-card-window.md: updated the sentences describing the sidebar hosting the style editor's symbol grid to describe the compact picker instead. - Tests: CardSessionUndoTests gains a symbol/tint analogue of the existing background-combo session-routing test; CardSidebarTests gains a curated-set tripwire and an updated file-header note. Claude-Session: https://claude.ai/code/session_014PtZdPwqZuqEDLc6wZMtEy
This commit is contained in:
@@ -68,10 +68,12 @@ enum CardWindowMetrics {
|
||||
|
||||
/// 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.
|
||||
/// Named because a section can need a number rather than a proposal — originally the embedded
|
||||
/// style editor's grids, a fixed count of fixed-size wells per row whose count had to be decided
|
||||
/// before the layout ran (`StyleEditorLayout.sidebar(contentWidth:)`); the Style section's compact
|
||||
/// `SymbolPicker` (2026-08-08) replaced that embed, but the Background color combo it sits beside
|
||||
/// still sizes itself off this figure (`CardStyleSection.backgroundComboRow`). 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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user