Files
museion/Museion/DesignTokens.swift
T
AlexKucera 42a27cc8a3
CI / ci (push) Canceled after 0s
feat(settings): sidebar + detail Settings page (#135)
Profiles S2 over the variant C verdict (#130): Settings becomes a
sidebar + detail shell — Content (the #17 Home control, unchanged) ·
Pass 1 · Pass 2 · Chat ('· Sessions' rides it) · Provider Keys. Each
surface page edits its model block in memory: provider menu, an
NSComboBox sourcing hermes' registry cache with first-class free text
(the #132 seed claude-sonnet-5-5 is NOT in the cache — custom is the
default state, pinned), per-provider effort menus led by
'unset · provider default' (zai low/high/max; OpenAI + Anthropic the
five-rung ladder), variant B's current-model headline, and a
user-requested Restore Defaults back to the seed. Provider Keys carries
endpoint, the z.ai key-type toggle swapping the endpoint family
(paas/v4 ↔ coding/paas/v4 — a custom endpoint survives), and masked
keys with reveal; no Keychain (#131).

Persistence is S3's job: every change routes through an injectable
SettingsWriting seam whose implementer contract is frozen now (MUST
debounce — the key field fires per keystroke; secrets via stdin/env,
never argv; error text redacted before it renders). Write failures
surface in an orange strip, cleared by the next success.

Dogfood fix, log-observed via os_log probes on the live app:
comboBoxSelectionDidChange fires BEFORE stringValue updates — the pick
is read from objectValueOfSelectedItem and the box re-synced by hand,
or the model never learns a dropdown pick. Two blind fixes failed
before the probe round settled it; pinned against the stale-string
fixture and filed to the swift wiki.

Finish-audit fanout (ponytail/security/general): Ship/SHIP/APPROVE —
applied the SettingsWriting contract, an inlined one-caller wrapper,
a corrected registry-leniency comment, and a seed-provider pin;
declined deleting the hydration clamp (trust-boundary validation for
S3's config.yaml reads); deferred endpoint scheme validation to S3's
write boundary. Suite: 432 passed / 432 (xcresult-verified). DOX:
Museion/AGENTS.md, MuseionTests/AGENTS.md, CHANGELOG, session log.

Closes #135
2026-10-27 11:52:39 +01:00

42 lines
1.8 KiB
Swift

//
// DesignTokens.swift
// Museion
//
// Visual tokens from the design contract (ref/Web-Prototype/museion-workspace.html, #17).
//
import SwiftUI
/// Colors, radii, and column geometry extracted from the export's `:root`
/// and workspace grid. Light-only on purpose — the export defines one palette.
/// #89 calibration (2026-10-09): two-color world, deliberately departed from
/// the export — page (edit+read+cards share it) vs background (chrome/focus).
/// Values are live-calibrated with Alexander, not contract-fixed.
enum DesignTokens {
static let background = Color(red: 0xFA / 255, green: 0xF9 / 255, blue: 0xF3 / 255)
static let surface = Color(red: 0xFF / 255, green: 0xFE / 255, blue: 0xFB / 255)
static let foreground = Color(red: 0x1A / 255, green: 0x19 / 255, blue: 0x16 / 255)
static let muted = Color(red: 0x6B / 255, green: 0x69 / 255, blue: 0x64 / 255)
static let border = Color(red: 0xE8 / 255, green: 0xE5 / 255, blue: 0xDF / 255)
static let accent = Color(red: 0xC9 / 255, green: 0x64 / 255, blue: 0x42 / 255)
static let radius: CGFloat = 10
/// #135 (prototype `.vC`): the Settings sidebar column and the detail
/// form's max width.
static let settingsSidebarWidth: CGFloat = 190
static let settingsFormWidth: CGFloat = 480
/// The workspace grid: rail | posts library | editor | mentor (grid-template-columns
/// `56px 232px minmax(420px, 1fr) 356px`). Editor min (420) has no enforcement
/// yet — the editor column arrives with #19.
static let railWidth: CGFloat = 56
static let libraryWidth: CGFloat = 232
static let mentorWidth: CGFloat = 356
/// The serif display face maps to the system serif design (export stack:
/// Iowan Old Style / Charter / Georgia); mono to the system monospaced.
static let serif: Font.Design = .serif
static let mono: Font.Design = .monospaced
}