Skip to content

fix(polish): 0.11.1 hunt #2 — dark-theme Shiki appearance, widget glyph heal, calendar chip clipping, fence aliases - #362

Merged
th3-br41n merged 2 commits into
mainfrom
fix/polish-0.11.1-hunt
Jul 29, 2026
Merged

fix(polish): 0.11.1 hunt #2 — dark-theme Shiki appearance, widget glyph heal, calendar chip clipping, fence aliases#362
th3-br41n merged 2 commits into
mainfrom
fix/polish-0.11.1-hunt

Conversation

@th3-br41n

Copy link
Copy Markdown
Contributor

Second polish hunt for the 0.11.1 patch — dark theme + deep content states (the smoke sweep ran light-only, one shot per app). Four defect classes found and fixed; verified in the running shell via the apply-diff loop (session 916-polish-0111-hunt-verify + DOM probe 916b-cal-chip-probe).

Fixes

1. Code editor (dark): Shiki Auto theme followed the OS scheme, not the shell appearance.
prefersDarkScheme() read prefers-color-scheme — a Dark-appearance shell on a light-mode OS painted github-light tokens on the near-black editor (strings/console/punctuation at ascender-tip contrast). The shell never sets nativeTheme.themeSource, so the media query cannot track the shell theme.

  • New SDK helper shellAppearanceDark() (@brainstorm-os/sdk/code-highlight): reads <body>'s computed color-scheme — the one element the preload's #brainstorm-tokens rule wins on (every app's own :root { color-scheme: light dark } masks it on <html>).
  • The pane re-tokenises on brainstorm:theme-changed, so a live appearance flip recolours the open buffer in place (verified: 05-code-editor-back-to-light.png).
  • Before/after: 022-dark-mode-sweep/11-dark-codeeditor.png (broken) → 916…/04-code-editor-dark.png (readable).

2. Notes/Journal/Tasks code blocks: permanently github-dark in BOTH themes.
packages/editor's resolvedTheme() read <html>'s computed color-scheme — the constant "light dark" — and .includes("dark") pinned every code block to the dark palette on light paper. Same shellAppearanceDark() helper; <html> read kept only as the no-shell fallback.
Bonus (found verifying): the fence aliases people actually type (```ts, js, py, sh, yml, …) were unmapped and silently painted plain — added to the alias map. After: 916…/02-notes-code-block-light.png (github-light TS tokens).

3. Dashboard widget header glyph pinned to initials ("RN").
An app-icon request racing the dev-seeder's uninstall→install window 404s ([dashboard] http404: brainstorm://app-icon/io.brainstorm.notes), AppIcon falls back to initials, and the constant src pinned the fallback for the whole session. The F-380 heal already re-resolves the widget title + iframe entry on apps:changed — the glyph now rides the same epoch (?e= cache-buster). Evidence: 022-dark-mode-sweep/01-dashboard-dark.png. Unit test added.

4. Calendar week/day block chips: meta lines flex-shrunk into mid-glyph clips.
DOM probe (916b): the ⋯ object-menu button — invisible at rest but 28px tall — stacks in the block chip's column flex, squeezing the time line to 6px on a 64px chip; guests/timezone meta additionally rendered at every density. Fixed: ⋯ overlays top-right in block mode (chip is already position:relative), density bands re-tuned to measured metrics (18px lines: tight <44 / compact <72 / roomy <100 / spacious ≥100 min) with every .cal-chip__meta variant gated, via a ChipDensity enum + pure densityForDuration (unit-tested).
Before/after: 228-deep-calendar/04-01-view-week.png (clipped tips) → 916…/03-calendar-week-light.png (clean 11:00 – 12:00 line).

Also formats two whiteboard visual specs that landed unformatted on main (bun run lint was red repo-wide).

Tests

  • Full worktree suite green (bun run test, exit 0); bun run lint + bun run typecheck (packages + apps) green; per-app tsc for calendar + code-editor green.
  • New: shell-appearance.test.ts (SDK), prefersDarkScheme cases (code-editor), widget-glyph epoch retry (widgets-layer), densityForDuration bands (calendar).
  • Dark all-apps sweep: 20/20 apps, 0 console/page errors.

🤖 Generated with Claude Code

brainstorm-os and others added 2 commits July 29, 2026 13:41
…lyph heal, calendar chip density

Four defects from the 2026-07-29 dark-theme + deep-state polish hunt:

- SDK code-highlight: new shellAppearanceDark() — the shell paints the
  resolved appearance as color-scheme on <body> (#brainstorm-tokens);
  <html> is masked by every app's own `:root { color-scheme: light dark }`
  and the OS media query can disagree with the shell theme outright.
- Code editor: Auto syntax theme resolved from prefers-color-scheme, so a
  Dark-appearance shell on a light-mode OS painted github-light tokens on
  the near-black editor (strings/punctuation unreadable). Now reads the
  painted appearance and re-tokenises on brainstorm:theme-changed.
- packages/editor code blocks: resolvedTheme() read <html>'s computed
  color-scheme — the constant "light dark" — and includes("dark") pinned
  every Notes/Journal/Tasks code block to github-dark in BOTH themes.
- Dashboard widget header glyph: an app-icon request racing the seeder's
  uninstall→install window 404s and the constant src pinned the initials
  fallback ("RN") for the whole session; the icon URL now carries the
  apps:changed epoch so it retries like the title/entry already do (F-380).
- Calendar week/day block chips: guests/timezone meta lines were never
  density-gated, so 35–85min chips flex-shrunk their meta into mid-glyph
  clipping; ChipDensity gains a spacious band and the CSS gates every
  .cal-chip__meta variant per band.

Also formats two whiteboard visual specs that landed unformatted on main
(bun run lint was red repo-wide).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Verification (916/916b probes) showed the chip clipping root cause is the
⋯ object-menu button: even at opacity 0 its 28px box stacks in the block
chip's column flex and shrinks the meta lines (a 64px chip's time line
measured 6px). Overlay it top-right in block mode and re-tune the density
bands to the measured line metrics (18px lines + 2px gaps + 8px padding →
tight <44 / compact <72 / roomy <100 / spacious ≥100 min).

Also map the fence aliases people actually type (```ts/js/py/sh/yml/…) to
their Shiki grammars — an unmapped alias silently painted the block plain,
which masked the theme fix on any ```ts block.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@th3-br41n
th3-br41n merged commit 66327fe into main Jul 29, 2026
3 checks passed
@th3-br41n
th3-br41n deleted the fix/polish-0.11.1-hunt branch July 29, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant