diff --git a/docs/developer/app-structure.md b/docs/developer/app-structure.md index b982c545..9df36e66 100644 --- a/docs/developer/app-structure.md +++ b/docs/developer/app-structure.md @@ -46,13 +46,18 @@ Theme primitives hold palette and appearance values. Structural semantic tokens map those values to the first-level regions, and structural selectors consume the semantic tokens rather than naming the current contents. -| Structural token | Current mapping | +| Structural token | Current base mapping | | --- | --- | -| `--app-shell-background` | `--paper` | +| `--app-shell-background` | `--hover-line` | | `--app-header-background` | `--app-shell-background` | -| `--left-pane-background` | `rgb(var(--surface-rgb) / 42%)` | +| `--left-pane-background` | `--neutral-soft` | | `--center-pane-background` | `--paper` | -| `--right-pane-background` | `--accent-soft` | +| `--right-pane-background` | `--neutral-soft` | + +Palette and appearance overrides may replace a base mapping with a literal or +another theme role. For example, Olive light maps the app shell to `#dde1d2`. +The floating theme-token inspector reports each token's live computed custom- +property value so these overrides remain truthful. Use full property suffixes such as `-background` for structural tokens. Child content and component tokens keep their existing names until their vocabulary diff --git a/scripts/app-layout.ts b/scripts/app-layout.ts index afb7de67..8ff64d62 100644 --- a/scripts/app-layout.ts +++ b/scripts/app-layout.ts @@ -54,6 +54,7 @@ export const runtimeModuleNames = [ 'startup-contract', 'startup-diagnostic', 't3-thread-titles', + 'window-bounds', 'workspace-state', 'workspace-store' ] as const diff --git a/src/annotation-block.ts b/src/annotation-block.ts index c6f61f43..afb00fdf 100644 --- a/src/annotation-block.ts +++ b/src/annotation-block.ts @@ -127,13 +127,16 @@ } const onEdit = options.onEdit if (onEdit) { + if (!options.renderEditIcon) { + throw new Error('Editable annotations require an edit icon renderer') + } body.classList.add('has-edit') const edit = document.createElement('button') edit.className = 'rendered-annotation-edit' edit.type = 'button' edit.title = 'Edit annotation' edit.setAttribute('aria-label', `Edit annotation on ${view.lineLabel}`) - edit.textContent = '✎' + edit.append(options.renderEditIcon()) edit.addEventListener('click', (event) => { event.stopPropagation() onEdit(options.node) @@ -221,6 +224,7 @@ onInlineImage: options.onInlineImage, onSelect: options.onSelect, onEdit: options.onEdit, + renderEditIcon: options.renderEditIcon, renderTitle: options.renderTitle, renderMarkdown: options.renderMarkdown }) diff --git a/src/contracts.ts b/src/contracts.ts index fc87d527..2d62b0a0 100644 --- a/src/contracts.ts +++ b/src/contracts.ts @@ -506,6 +506,7 @@ declare global { onInlineImage?: ((source: string, label: string) => void) | undefined onSelect?: ((node: TNode) => void) | undefined onEdit?: ((node: TNode) => void) | null | undefined + renderEditIcon?: (() => Element) | undefined renderTitle?: ((title: string) => string) | undefined renderMarkdown: (value: string) => string } diff --git a/src/index.html b/src/index.html index 0c2705cb..ff243cf9 100644 --- a/src/index.html +++ b/src/index.html @@ -273,14 +273,7 @@