fix(polish): 0.11.1 hunt #2 — dark-theme Shiki appearance, widget glyph heal, calendar chip clipping, fence aliases - #362
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 probe916b-cal-chip-probe).Fixes
1. Code editor (dark): Shiki
Autotheme followed the OS scheme, not the shell appearance.prefersDarkScheme()readprefers-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 setsnativeTheme.themeSource, so the media query cannot track the shell theme.shellAppearanceDark()(@brainstorm-os/sdk/code-highlight): reads<body>'s computedcolor-scheme— the one element the preload's#brainstorm-tokensrule wins on (every app's own:root { color-scheme: light dark }masks it on<html>).brainstorm:theme-changed, so a live appearance flip recolours the open buffer in place (verified:05-code-editor-back-to-light.png).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'sresolvedTheme()read<html>'s computedcolor-scheme— the constant"light dark"— and.includes("dark")pinned every code block to the dark palette on light paper. SameshellAppearanceDark()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-iconrequest racing the dev-seeder's uninstall→install window 404s ([dashboard] http404: brainstorm://app-icon/io.brainstorm.notes), AppIcon falls back to initials, and the constantsrcpinned the fallback for the whole session. The F-380 heal already re-resolves the widget title + iframe entry onapps: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 alreadyposition:relative), density bands re-tuned to measured metrics (18px lines: tight <44 / compact <72 / roomy <100 / spacious ≥100 min) with every.cal-chip__metavariant gated, via aChipDensityenum + puredensityForDuration(unit-tested).Before/after:
228-deep-calendar/04-01-view-week.png(clipped tips) →916…/03-calendar-week-light.png(clean11:00 – 12:00line).Also formats two whiteboard visual specs that landed unformatted on main (
bun run lintwas red repo-wide).Tests
bun run test, exit 0);bun run lint+bun run typecheck(packages + apps) green; per-apptscfor calendar + code-editor green.shell-appearance.test.ts(SDK),prefersDarkSchemecases (code-editor), widget-glyph epoch retry (widgets-layer),densityForDurationbands (calendar).🤖 Generated with Claude Code