refactor/design: align app chrome with the Main-Theme spec #1

Merged
BlackHatMagic merged 9 commits from refactor/design into master 2026-10-14 04:37:04 +00:00

Summary

Aligns the 5e Monster Maker app chrome with the BlackHatMagic Main-Theme design language and fixes several defects found while auditing it. The Monster Manual stat-block theme is intentionally left visually unchanged (only the bug below).

Design alignment

  • Theme tokens. Every palette now carries the full semantic role set (surface-muted, on-surface-muted, border-strong, on-primary, error, on-error) and matches Main-Theme/DESIGN.md value-for-value in all eleven themes. Adds System mode (with per-mode preferences) alongside Light/Dark.
  • Fonts. Self-hosts Space Grotesk (display/controls) and Figtree (copy) via @fontsource-variable, keeps Noto Serif scoped to the stat block, and removes the Google Fonts links. The Monster Manual fonts it already referenced (Noto Sans, Libre Baskerville) are now actually loaded.
  • Surfaces and elevation. Removes the blurred header/rail shadows in favor of the spec's hard offset shadows, uses opaque surface-muted fills instead of ad-hoc translucent mixes, and uses the background-tinted modal scrim.
  • Controls. Introduces shared .editor-control, .editor-button, and .shell-button classes with spec heights (40/44/32), border-strong field outlines, on-primary text, and correct primary/quiet/danger hover states.
  • Shapes and a11y. Squares the help trigger and selector chips, restores visible focus rings, and adds the four-square theme swatches.
  • Breakpoints. Consolidates responsive variants to the spec's 560px and 820px breakpoints.

Bug fixes

  • fix/editor: switching tabs faster than a lazy editor's dynamic import resolved left the panel stuck on "Loading …" forever; the pending import is no longer cancelled on deactivation.
  • fix/editor: section navigation could scroll to a stale offset because lazy content and web fonts grow the panel after the first scroll; the heading is now re-aligned while the panel settles.
  • fix/proficiencies: two malformed Tailwind arbitrary variants (repeat(2,minmax(0,1fr)))) that silently dropped the responsive grid.
  • test: vendored the portable-format TOML fixture so the unit suite no longer depends on a sibling Obsidian-Stat-Blocks checkout.

Testing

  • bun run check — 0 errors, 0 warnings
  • bun run test — 269 passed
  • bunx playwright test — 29 passed
  • bun run build — Cloudflare adapter output generated

Notes / risks

  • Theme colors now follow Main-Theme rather than the previous hand-tuned values; several dark themes intentionally swap background/surface to match the spec (e.g. Catppuccin Mocha, Gruvbox Dark, Dracula).
  • The stat-block artifact's own 720px two-column collapse and the Monster Manual box-shadow were left as-is; only the artifact's non-Monster-Manual corner radius and the missing MM fonts were corrected.
  • Off-scale spacing values (13px/22px/etc.) remain; the spec treats spacing explicitly as guidance rather than a hard constraint, and changing them all is out of scope for this alignment pass.

Review responses

Round 1 (review #17) raised two P2 findings; both were handled and rechecked in review #19.

  • [P2] scroll-settle observer yanks the viewport — fixed. Replaced the ResizeObserver with a bounded requestAnimationFrame pass that waits for the heading to mount and hold its offset for two frames before scrolling once, so later edits that resize the panel no longer move the scroll. The automated recheck marked it resolved.
  • [P2] max-w-60 defeated by .editor-control — marked incorrect, with evidence. .editor-control no longer declares max-width, so the layered max-w-60 utility applies. In Chromium at desktop width the stat-block theme select computes max-width: 240px and renders width: 240px inside a 696px grid cell; width: 100% and max-width: 15rem compose normally. tests/e2e/monster-maker.spec.ts now asserts the cap.
## Summary Aligns the 5e Monster Maker app chrome with the BlackHatMagic Main-Theme design language and fixes several defects found while auditing it. The Monster Manual stat-block theme is intentionally left visually unchanged (only the bug below). ### Design alignment - **Theme tokens.** Every palette now carries the full semantic role set (`surface-muted`, `on-surface-muted`, `border-strong`, `on-primary`, `error`, `on-error`) and matches `Main-Theme/DESIGN.md` value-for-value in all eleven themes. Adds System mode (with per-mode preferences) alongside Light/Dark. - **Fonts.** Self-hosts Space Grotesk (display/controls) and Figtree (copy) via `@fontsource-variable`, keeps Noto Serif scoped to the stat block, and removes the Google Fonts links. The Monster Manual fonts it already referenced (`Noto Sans`, `Libre Baskerville`) are now actually loaded. - **Surfaces and elevation.** Removes the blurred header/rail shadows in favor of the spec's hard offset shadows, uses opaque surface-muted fills instead of ad-hoc translucent mixes, and uses the background-tinted modal scrim. - **Controls.** Introduces shared `.editor-control`, `.editor-button`, and `.shell-button` classes with spec heights (40/44/32), `border-strong` field outlines, on-primary text, and correct primary/quiet/danger hover states. - **Shapes and a11y.** Squares the help trigger and selector chips, restores visible focus rings, and adds the four-square theme swatches. - **Breakpoints.** Consolidates responsive variants to the spec's 560px and 820px breakpoints. ### Bug fixes - `fix/editor`: switching tabs faster than a lazy editor's dynamic import resolved left the panel stuck on "Loading …" forever; the pending import is no longer cancelled on deactivation. - `fix/editor`: section navigation could scroll to a stale offset because lazy content and web fonts grow the panel after the first scroll; the heading is now re-aligned while the panel settles. - `fix/proficiencies`: two malformed Tailwind arbitrary variants (`repeat(2,minmax(0,1fr)))`) that silently dropped the responsive grid. - `test`: vendored the portable-format TOML fixture so the unit suite no longer depends on a sibling `Obsidian-Stat-Blocks` checkout. ### Testing - `bun run check` — 0 errors, 0 warnings - `bun run test` — 269 passed - `bunx playwright test` — 29 passed - `bun run build` — Cloudflare adapter output generated ### Notes / risks - Theme colors now follow Main-Theme rather than the previous hand-tuned values; several dark themes intentionally swap background/surface to match the spec (e.g. Catppuccin Mocha, Gruvbox Dark, Dracula). - The stat-block artifact's own 720px two-column collapse and the Monster Manual box-shadow were left as-is; only the artifact's non-Monster-Manual corner radius and the missing MM fonts were corrected. - Off-scale spacing values (13px/22px/etc.) remain; the spec treats spacing explicitly as guidance rather than a hard constraint, and changing them all is out of scope for this alignment pass. --- ## Review responses Round 1 (review #17) raised two P2 findings; both were handled and rechecked in review #19. - **[P2] scroll-settle observer yanks the viewport** — *fixed.* Replaced the `ResizeObserver` with a bounded `requestAnimationFrame` pass that waits for the heading to mount and hold its offset for two frames before scrolling once, so later edits that resize the panel no longer move the scroll. The automated recheck marked it resolved. - **[P2] `max-w-60` defeated by `.editor-control`** — *marked incorrect, with evidence.* `.editor-control` no longer declares `max-width`, so the layered `max-w-60` utility applies. In Chromium at desktop width the stat-block theme select computes `max-width: 240px` and renders `width: 240px` inside a 696px grid cell; `width: 100%` and `max-width: 15rem` compose normally. `tests/e2e/monster-maker.spec.ts` now asserts the cap.
Palettes now carry the full semantic role set (border-strong, on-surface-muted, on-primary, error, on-error) and match every value in BlackHatMagic/Main-Theme. Self-host Space Grotesk, Figtree, Noto Serif, Noto Sans, and Libre Baskerville instead of loading Google Fonts, and keep the artifact fonts scoped to the stat block. Add System mode plus per-mode preferences, and sync app.css with palettes.ts behind a test.
Drop the blurred header shadow, restore 40px icon buttons and hard-offset shadows, open the theme picker on click with System/Light/Dark tabs and four-square swatches, use the background-tinted modal scrim at the spec width, and route danger/error styling through the error role.
Consolidate the duplicated input/select/textarea styling into .editor-control (surface fill, border-strong outline, 44px height), give buttons and icon buttons spec heights and hover states, square the help trigger and selector chips, replace hover-only rounding and glows, and fix the malformed responsive grid classes in the proficiencies editor.
Limit responsive variants to the spec's 560px and 820px breakpoints, normalize Hugeicons stroke width to 1.8, use opaque surface-muted fills instead of ad-hoc translucent mixes, and shrink inline button icons.
Do not drop a pending lazy-editor import when a tab deactivates; switching tabs faster than the import resolves left the panel stuck on its loading placeholder. Re-align the selected section heading while lazy content and fonts finish growing the panel, so navigation lands on the heading rather than a stale offset.
test: update browser flows for the new theme picker and controls
All checks were successful
/ deploy (push) Successful in 2m33s
3c631f3aaa
Exercise the click-to-open theme picker and its System/Light/Dark tabs, assert the square chip, help, and stat-block affordances, and vendor the portable TOML fixture so the unit suite no longer depends on a sibling Obsidian-Stat-Blocks checkout.
BlackHatMagic left a comment

Pi code review

2 new actionable findings

  • [P2] Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule — src/lib/components/preview/PreviewThemePicker.svelte:53
  • [P2] Scroll-settle observer yanks the user's scroll position on any panel resize after section navigation — src/lib/components/editor/EditorWorkspace.svelte:57

Outside the diff

[P2] Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule

The PR introduces .editor-control as an unlayered top-level rule in src/app.css, which sets width: 100% and max-width: 100%. PreviewThemePicker's stat-block theme keeps the max-w-60 utility class alongside the new class. Tailwind v4 (@import "tailwindcss" in app.css) emits utilities inside the utilities @layer, and per the CSS cascade, unlayered author styles take precedence over any layered styles regardless of order. The max-w-60 (max-width: 15rem) declaration therefore always loses to .editor-control's max-width: 100%, so the select silently stretches to the full toolbar/preview-column width instead of the 15rem cap the retained class documents, on every theme and every viewport. The class was kept precisely to cap the width, so the rendered layout contradicts the source intent.

Trigger: Any page load; the width cap is dropped whenever the select renders, most visibly on wide (desktop) screens where the preview column exceeds 15rem.

Impact: Visible layout regression in the live-preview toolbar: the stat-block theme select is much wider than designed in all eleven themes; the stale utility also misleads future maintainers.

Evidence: src/app.css (unlayered, after the layered @import "tailwindcss") declares .editor-control { width: 100%; max-width: 100%; ... }; src/lib/components/preview/PreviewThemePicker.svelte select uses class editor-control max-w-60 and no other max-width mechanism — unlike every other control in this PR, where conflicting width/padding utilities were removed when .editor-control was adopted (e.g. ActionCard inputs).

Suggested fix:

@@ src/app.css: .editor-control
 .editor-control {
 	width: 100%;
-	max-width: 100%;
 	min-height: var(--editor-control-height, 44px);

Location: src/lib/components/preview/PreviewThemePicker.svelte:53 (outside the diff; posted here because it can't anchor inline).

Reviewed the design-alignment refactor across theme tokens/palettes, controls markup, ThemePicker/theme-store behavior, and the three claimed bug fixes (lazy editor import, scroll settle, Tailwind arbitrary variants) against the pinned head. Tool budget prevented reading stat-block-themes.ts, theme-palettes.test.ts and the fixture-consuming unit tests, and no build/test browser runs were possible, so those reads and the runtime claims in the PR description remain unverified. Reviewed the design-alignment refactor across palettes, theme CSS, theme store, and the two editor fixes plus the vendored fixture. Theme blocks in app.css match palettes.ts value-for-value, the LazyEditor deactivation fix and the ProficienciesEditor Tailwind grid fix check out, but the new scroll-settle observer re-aligns on any panel resize, not just lazy-load growth.

Change walkthrough
Area Files Changes
Other code (12) src/app.css, src/lib/theme/palettes.ts, src/lib/state/theme-store.ts, src/lib/components/app-shell/ThemePicker.svelte (+8 more) Adds per-theme token blocks mirroring palettes.ts plus shared .editor-control/.editor-button/.shell-button classes and squared shapes Palettes now carry the full Main-Theme semantic role set (borderStrong, error, onError, etc.) Adds a system mode preference with a live prefers-color-scheme listener and per-mode saved themes Replaced hover-on toggle with a click-opened appearance dialog: three mode tabs, single tabpanel, swatches, outside-pointerdown and Escape closing
Tests (4) tests/fixtures/ancient-red-dragon.toml, tests/e2e/monster-maker.spec.ts, tests/unit/theme-palettes.test.ts, tests/unit/toml.test.ts Added vendored portable-format TOML fixture for the unit suite Updated theme-picker interactions to click/Escape dialogs and system-mode tab assertions New test keeps app.css theme blocks in sync with palettes.ts and pins Main-Theme spec values Fixture path moved to vendored tests/fixtures/ancient-red-dragon.toml

Review effort: 4/5.

Static observations (not validation results)
Observation Detail
⚠️ Diff size 37 files, +915/-406. Large diff; review coverage may be incomplete.
Binary changes No binary changes reported by this diff.
Credential patterns No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit.

Reviewed 3c631f3aaa831b3e5cc4c8c17009a91fc6375856 with opencode-go/glm-5.3-flash. Automated advisory review; no project commands or tests were executed.

<!-- forgejo-pi-review:a37e82e3335ccb03405ad019385615b4920a67436fd8b73a363ee19467eacef4 --> ## Pi code review **2 new actionable findings** - **[P2] Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule** — `src/lib/components/preview/PreviewThemePicker.svelte:53` - **[P2] Scroll-settle observer yanks the user's scroll position on any panel resize after section navigation** — `src/lib/components/editor/EditorWorkspace.svelte:57` ### Outside the diff **[P2] Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule** The PR introduces `.editor-control` as an unlayered top-level rule in src/app.css, which sets `width: 100%` and `max-width: 100%`. PreviewThemePicker's stat-block theme <select> keeps the `max-w-60` utility class alongside the new class. Tailwind v4 (@import "tailwindcss" in app.css) emits utilities inside the `utilities` @layer, and per the CSS cascade, unlayered author styles take precedence over any layered styles regardless of order. The `max-w-60` (max-width: 15rem) declaration therefore always loses to `.editor-control`'s `max-width: 100%`, so the select silently stretches to the full toolbar/preview-column width instead of the 15rem cap the retained class documents, on every theme and every viewport. The class was kept precisely to cap the width, so the rendered layout contradicts the source intent. **Trigger:** Any page load; the width cap is dropped whenever the select renders, most visibly on wide (desktop) screens where the preview column exceeds 15rem. **Impact:** Visible layout regression in the live-preview toolbar: the stat-block theme select is much wider than designed in all eleven themes; the stale utility also misleads future maintainers. **Evidence:** src/app.css (unlayered, after the layered @import "tailwindcss") declares `.editor-control { width: 100%; max-width: 100%; ... }`; src/lib/components/preview/PreviewThemePicker.svelte select uses class `editor-control max-w-60` and no other max-width mechanism — unlike every other control in this PR, where conflicting width/padding utilities were removed when .editor-control was adopted (e.g. ActionCard inputs). Suggested fix: ```diff @@ src/app.css: .editor-control .editor-control { width: 100%; - max-width: 100%; min-height: var(--editor-control-height, 44px); ``` Location: `src/lib/components/preview/PreviewThemePicker.svelte:53` (outside the diff; posted here because it can't anchor inline). Reviewed the design-alignment refactor across theme tokens/palettes, controls markup, ThemePicker/theme-store behavior, and the three claimed bug fixes (lazy editor import, scroll settle, Tailwind arbitrary variants) against the pinned head. Tool budget prevented reading stat-block-themes.ts, theme-palettes.test.ts and the fixture-consuming unit tests, and no build/test browser runs were possible, so those reads and the runtime claims in the PR description remain unverified. Reviewed the design-alignment refactor across palettes, theme CSS, theme store, and the two editor fixes plus the vendored fixture. Theme blocks in app.css match palettes.ts value-for-value, the LazyEditor deactivation fix and the ProficienciesEditor Tailwind grid fix check out, but the new scroll-settle observer re-aligns on any panel resize, not just lazy-load growth. <details> <summary>Change walkthrough</summary> | Area | Files | Changes | | --- | --- | --- | | Other code (12) | `src/app.css`, `src/lib/theme/palettes.ts`, `src/lib/state/theme-store.ts`, `src/lib/components/app-shell/ThemePicker.svelte` (+8 more) | Adds per-theme token blocks mirroring palettes.ts plus shared .editor-control/.editor-button/.shell-button classes and squared shapes Palettes now carry the full Main-Theme semantic role set (borderStrong, error, onError, etc.) Adds a system mode preference with a live prefers-color-scheme listener and per-mode saved themes Replaced hover-on toggle with a click-opened appearance dialog: three mode tabs, single tabpanel, swatches, outside-pointerdown and Escape closing | | Tests (4) | `tests/fixtures/ancient-red-dragon.toml`, `tests/e2e/monster-maker.spec.ts`, `tests/unit/theme-palettes.test.ts`, `tests/unit/toml.test.ts` | Added vendored portable-format TOML fixture for the unit suite Updated theme-picker interactions to click/Escape dialogs and system-mode tab assertions New test keeps app.css theme blocks in sync with palettes.ts and pins Main-Theme spec values Fixture path moved to vendored tests/fixtures/ancient-red-dragon.toml | Review effort: **4/5**. </details> <details> <summary>Static observations (not validation results)</summary> | Observation | Detail | | --- | --- | | ⚠️ Diff size | 37 files, +915/-406. Large diff; review coverage may be incomplete. | | Binary changes | No binary changes reported by this diff. | | Credential patterns | No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit. | </details> --- Reviewed `3c631f3aaa831b3e5cc4c8c17009a91fc6375856` with `opencode-go/glm-5.3-flash`. Automated advisory review; no project commands or tests were executed.
@ -26,0 +54,4 @@
const observer = new ResizeObserver(() => {
if (firstCallback) {
firstCallback = false;
return;
Author
Owner

[P2] Scroll-settle observer yanks the user's scroll position on any panel resize after section navigation

settleSectionScroll() re-aligns the section heading on every ResizeObserver callback for the editor panel, not only when lazy content or fonts grow the panel. Every re-alignment also pushes the hard-stop timeout out by another 300ms (it clears and resets the same settleStopTimer), so the window extends as long as the panel keeps resizing. Any height change after navigating to a section — typing text that wraps, adding/removing a list entry, toggling a control that changes layout — triggers an instant (behavior: 'auto') scrollIntoView back to the section heading, snapping the user away from what they were editing. The comment claims the observer 'stops so the user can scroll freely', but scrolling is only preserved because scrolling itself does not resize the panel; user-driven layout changes during the window defeat that guarantee.

Trigger: Navigate to any editor section (starting the settle observer for up to ~1.5s, extended by further resizes) and then perform any edit that changes the panel's height within that window, e.g. typing a new line in a textarea or adding a repeatable entry.

Impact: The user's scroll position is visibly and repeatedly reset to the top of the section while they edit, losing their place and creating a jarring instant jump during normal editing.

Evidence: EditorWorkspace.svelte: the ResizeObserver callback runs alignSection(panel, 'auto') on every resize callback after skipping only the first (firstCallback), and each callback resets settleStopTimer via clearTimeout/setTimeout(cancelScrollSettle, 300), replacing the one-time 1500ms deadline. The observer is attached to the editor section panel itself, so any content growth inside it — not just the lazy-editor load the fix targets — re-aligns the scroll.

**[P2] Scroll-settle observer yanks the user's scroll position on any panel resize after section navigation** settleSectionScroll() re-aligns the section heading on every ResizeObserver callback for the editor panel, not only when lazy content or fonts grow the panel. Every re-alignment also pushes the hard-stop timeout out by another 300ms (it clears and resets the same settleStopTimer), so the window extends as long as the panel keeps resizing. Any height change after navigating to a section — typing text that wraps, adding/removing a list entry, toggling a control that changes layout — triggers an instant (behavior: 'auto') scrollIntoView back to the section heading, snapping the user away from what they were editing. The comment claims the observer 'stops so the user can scroll freely', but scrolling is only preserved because scrolling itself does not resize the panel; user-driven layout changes during the window defeat that guarantee. **Trigger:** Navigate to any editor section (starting the settle observer for up to ~1.5s, extended by further resizes) and then perform any edit that changes the panel's height within that window, e.g. typing a new line in a textarea or adding a repeatable entry. **Impact:** The user's scroll position is visibly and repeatedly reset to the top of the section while they edit, losing their place and creating a jarring instant jump during normal editing. **Evidence:** EditorWorkspace.svelte: the ResizeObserver callback runs alignSection(panel, 'auto') on every resize callback after skipping only the first (firstCallback), and each callback resets settleStopTimer via clearTimeout/setTimeout(cancelScrollSettle, 300), replacing the one-time 1500ms deadline. The observer is attached to the editor section panel itself, so any content growth inside it — not just the lazy-editor load the fix targets — re-aligns the scroll.
fix/design: cap editor-control width and settle scroll without a live observer
All checks were successful
/ deploy (push) Successful in 2m47s
96c5d7508f
Review findings:\n- Drop the redundant max-width from the unlayered .editor-control rule so the layered max-w-60 utility on the preview theme select takes effect again.\n- Replace the ResizeObserver scroll correction with a bounded requestAnimationFrame pass that waits for the section heading to mount and stabilize, then scrolls once. The observer re-aligned on every later panel resize and kept extending its own deadline, which could yank the viewport back to the heading while editing.
BlackHatMagic left a comment

Pi code review

0 new actionable findings

No new actionable findings. Previously reported issues, if any, are tracked below.

Earlier findings: 2 rechecked
  • Resolved: Scroll-settle observer yanks the user's scroll position on any panel resize after section navigation (src/lib/components/editor/EditorWorkspace.svelte:57, first reported in review #17) — Current EditorWorkspace.svelte has no ResizeObserver-driven re-alignment: alignSectionWhenSettled uses a rAF loop that runs alignSection once after the heading's offsetTop stays stable for 2 frames (capped at 90 frames), and cancelScrollSettle is only called on rAF teardown and via the $effect cleanup; no listener reacts to panel resizes, so edits that change panel height no longer yank the scroll position after section navigation. Source of record for this recheck: src/lib/components/editor/EditorWorkspace.svelte alignedSectionWhenSettled loop (lines 44-70) and its only caller in the sectionScrollRequest $effect (lines 104-119).
  • Still open (not reposted): Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule (src/lib/components/preview/PreviewThemePicker.svelte:53, first reported in review #17) — Still present in current code: src/app.css defines unlayered .editor-control { width: 100%; ... } (no max-width declaration, but width:100% is unlayered author authority) while PreviewThemePicker.svelte renders the stat-block theme select with class="editor-control max-w-60", and no other max-width mechanism exists on that select. Tailwind v4 emits utilities in @layer utilities via the @import "tailwindcss" in app.css, and unlayered author styles beat layered ones regardless of order — so max-w-60 cannot win for max-width. However, the original finding cited max-width: 100% in .editor-control; the current rule has no max-width declaration at all, which stat-block→width interplay means max-w-60 SHOULD still apply for max-width... but since width:100% also comes from the unlayered block, the select still stretches beyond 15rem within its grid cell.

Re-checked both prior findings against head (scroll-settle logic, editor-control cascade cap); verified the lazy-editor retained-import fix and the System-mode theme store wiring by reading the current implementation and callers. Automated checks could not be run; residual gap is that CSS cascade and scroll behavior claims rest on code reading rather than browser execution. Reviewed the theme-system alignment and the four stated bug fixes by comparing head vs base for the lazy-editor loading logic, section scroll alignment, proficiency grids, theme palettes/store, and the vendored TOML fixture, plus the pre-hydration theme script. No evidence-backed defects were found in the inspected code; the 30-operation repository budget was exhausted before the remaining styling-only components (stat-block.css, remaining editors, footer) could be diffed, so that surface is unverified.

Change walkthrough
Area Files Changes
Tests (3) tests/unit/theme-palettes.test.ts, tests/unit/toml.test.ts, tests/fixtures/ancient-red-dragon.toml Rewrote palette assertions to Main-Theme spec values and added a palettes.ts ↔ app.css sync test Switched the ancient-red-dragon fixture to a vendored file, removing the sibling-checkout dependency Added vendored portable-format TOML fixture matching the test's import/round-trip assertions
Other code (7) src/lib/components/editor/LazyEditor.svelte, src/lib/components/editor/EditorWorkspace.svelte, src/lib/components/editor/ProficienciesEditor.svelte, src/lib/theme/palettes.ts (+3 more) No longer cancels a pending editor import on deactivation; guards assignment with a destroyed flag Section navigation now re-aligns the heading while the panel settles (stability-framed rAF loop) Fixed malformed responsive grid variants and moved controls to shared .editor-control classes Extended ThemeColors with the full semantic role set and Main-Theme spec values per palette

Review effort: 3/5.

Static observations (not validation results)
Observation Detail
⚠️ Diff size 37 files, +917/-406. Large diff; review coverage may be incomplete.
Binary changes No binary changes reported by this diff.
Credential patterns No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit.

Reviewed 96c5d7508f6e83e2f9e5e7ef9babc914249bb079 with opencode-go/glm-5.3-flash. Automated advisory review; no project commands or tests were executed.

<!-- forgejo-pi-review:4998aa7acb6f55fa5c7f5efd250157bac89a75cae2410aa57db24e725025cef5 --> ## Pi code review **0 new actionable findings** No new actionable findings. Previously reported issues, if any, are tracked below. <details> <summary>Earlier findings: 2 rechecked</summary> - **Resolved:** Scroll-settle observer yanks the user's scroll position on any panel resize after section navigation (`src/lib/components/editor/EditorWorkspace.svelte:57`, first reported in review #17) — Current EditorWorkspace.svelte has no ResizeObserver-driven re-alignment: alignSectionWhenSettled uses a rAF loop that runs alignSection once after the heading's offsetTop stays stable for 2 frames (capped at 90 frames), and cancelScrollSettle is only called on rAF teardown and via the $effect cleanup; no listener reacts to panel resizes, so edits that change panel height no longer yank the scroll position after section navigation. Source of record for this recheck: src/lib/components/editor/EditorWorkspace.svelte alignedSectionWhenSettled loop (lines 44-70) and its only caller in the sectionScrollRequest $effect (lines 104-119). - **Still open (not reposted):** Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule (`src/lib/components/preview/PreviewThemePicker.svelte:53`, first reported in review #17) — Still present in current code: src/app.css defines unlayered .editor-control { width: 100%; ... } (no max-width declaration, but width:100% is unlayered author authority) while PreviewThemePicker.svelte renders the stat-block theme select with class="editor-control max-w-60", and no other max-width mechanism exists on that select. Tailwind v4 emits utilities in @layer utilities via the @import "tailwindcss" in app.css, and unlayered author styles beat layered ones regardless of order — so max-w-60 cannot win for max-width. However, the original finding cited max-width: 100% in .editor-control; the current rule has no max-width declaration at all, which stat-block→width interplay means max-w-60 SHOULD still apply for max-width... but since width:100% also comes from the unlayered block, the select still stretches beyond 15rem within its grid cell. </details> Re-checked both prior findings against head (scroll-settle logic, editor-control cascade cap); verified the lazy-editor retained-import fix and the System-mode theme store wiring by reading the current implementation and callers. Automated checks could not be run; residual gap is that CSS cascade and scroll behavior claims rest on code reading rather than browser execution. Reviewed the theme-system alignment and the four stated bug fixes by comparing head vs base for the lazy-editor loading logic, section scroll alignment, proficiency grids, theme palettes/store, and the vendored TOML fixture, plus the pre-hydration theme script. No evidence-backed defects were found in the inspected code; the 30-operation repository budget was exhausted before the remaining styling-only components (stat-block.css, remaining editors, footer) could be diffed, so that surface is unverified. <details> <summary>Change walkthrough</summary> | Area | Files | Changes | | --- | --- | --- | | Tests (3) | `tests/unit/theme-palettes.test.ts`, `tests/unit/toml.test.ts`, `tests/fixtures/ancient-red-dragon.toml` | Rewrote palette assertions to Main-Theme spec values and added a palettes.ts ↔ app.css sync test Switched the ancient-red-dragon fixture to a vendored file, removing the sibling-checkout dependency Added vendored portable-format TOML fixture matching the test's import/round-trip assertions | | Other code (7) | `src/lib/components/editor/LazyEditor.svelte`, `src/lib/components/editor/EditorWorkspace.svelte`, `src/lib/components/editor/ProficienciesEditor.svelte`, `src/lib/theme/palettes.ts` (+3 more) | No longer cancels a pending editor import on deactivation; guards assignment with a destroyed flag Section navigation now re-aligns the heading while the panel settles (stability-framed rAF loop) Fixed malformed responsive grid variants and moved controls to shared .editor-control classes Extended ThemeColors with the full semantic role set and Main-Theme spec values per palette | Review effort: **3/5**. </details> <details> <summary>Static observations (not validation results)</summary> | Observation | Detail | | --- | --- | | ⚠️ Diff size | 37 files, +917/-406. Large diff; review coverage may be incomplete. | | Binary changes | No binary changes reported by this diff. | | Credential patterns | No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit. | </details> --- Reviewed `96c5d7508f6e83e2f9e5e7ef9babc914249bb079` with `opencode-go/glm-5.3-flash`. Automated advisory review; no project commands or tests were executed.
BlackHatMagic left a comment

Review round 2 response

  • Resolved [P2] scroll-settle observer: replaced the ResizeObserver with a bounded requestAnimationFrame pass that waits for the heading to mount and hold its offset for two frames, then scrolls once. Confirmed resolved by the bot recheck in review #19.
  • Marked incorrect [P2] max-w-60 on the stat-block theme select: .editor-control no longer declares max-width, so the layered max-w-60 utility applies. Verified in Chromium at desktop width: the select computes max-width: 240px and renders width: 240px inside a 696px grid cell. width: 100% and max-width: 15rem compose normally (the cap wins), so the select is not stretching. An e2e assertion now locks this in tests/e2e/monster-maker.spec.ts.
## Review round 2 response - **Resolved [P2] scroll-settle observer:** replaced the ResizeObserver with a bounded requestAnimationFrame pass that waits for the heading to mount and hold its offset for two frames, then scrolls once. Confirmed resolved by the bot recheck in review #19. - **Marked incorrect [P2] `max-w-60` on the stat-block theme select:** `.editor-control` no longer declares `max-width`, so the layered `max-w-60` utility applies. Verified in Chromium at desktop width: the select computes `max-width: 240px` and renders `width: 240px` inside a 696px grid cell. `width: 100%` and `max-width: 15rem` compose normally (the cap wins), so the select is not stretching. An e2e assertion now locks this in `tests/e2e/monster-maker.spec.ts`.
test/e2e: lock the stat-block theme select width cap
All checks were successful
/ deploy (push) Successful in 2m48s
82d4378c81
Asserts the layered max-w-60 utility still caps the select at 15rem now that .editor-control only sets width, answering the review recheck.
BlackHatMagic left a comment

Pi code review

0 new actionable findings

No new actionable findings. Previously reported issues, if any, are tracked below.

Earlier findings: 1 rechecked
  • Resolved: Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule (src/lib/components/preview/PreviewThemePicker.svelte:53, first reported in review #17) — Current head src/app.css defines .editor-control with width:100%, padding, border, and font rules but no max-width declaration at all, so the retained max-w-60 utility (15rem) composes normally with width:100% and the 240px cap applies. The layered/unlayered conflict described previously no longer exists; tests/e2e/monster-maker.spec.ts additionally asserts toHaveCSS('max-width','240px') on #preview-theme.

Reviewed the head (82d4378) against base (ad38c27), focusing on the theme-system rework (system-mode preference, palette role expansion), shared control classes, the lazy-editor and scroll-settle fixes, and the prior max-w-60 finding. Context budget limited late repo re-verification, but the diff plus head reads of app.css, ThemePicker, LazyEditor, and app.html covered the cited defects. Reviewed the two test-file diffs in the PR description against the head tree, tracing the app.css theme blocks, palettes.ts, theme store, LazyEditor, EditorWorkspace scroll-settle logic, and the ProficienciesEditor variant fixes. The palette values, CSS token sync, vendored fixture path, lazy-editor retention, and corrected Tailwind arbitrary variants all check out; remaining verification was limited by the repository read budget (ThemePicker and e2e spec could not be inspected).

Change walkthrough
Area Files Changes
Other code (7) src/app.css, src/lib/theme/palettes.ts, src/lib/state/theme-store.ts, src/lib/components/app-shell/ThemePicker.svelte (+3 more) Full theme-role expansion (surface-muted, border-strong, error/on-error), Space Grotesk/Figtree font tokens, shared .editor-control/.editor-button/.shell-button styles, scrim and selection fixes. ThemeColors gains borderStrong/accentForeground/error/onError roles; palettes updated to Main-Theme values; adds ALL_PALETTES. Adds system mode preference with per-mode light/dark theme storage, OS scheme listener, and validated localStorage migration. Click-opened Appearance dialog with mode tabs (System/Light/Dark), swatches, outside-click and Escape close
Tests (5) tests/fixtures/ancient-red-dragon.toml, tests/components/app-shell.test.ts, tests/e2e/monster-maker.spec.ts, tests/unit/theme-palettes.test.ts (+1 more) Added vendored portable-format TOML fixture Updated theme-picker test for click-to-open behavior and swatches Updated theme-picker flows for System tab, Escape close, swatches, and the max-width assertion Rewrites palette tests to assert Main-Theme spec values and keep app.css theme blocks synced to palettes.ts via a jsdom/Node fs read.

Review effort: 3/5.

Static observations (not validation results)
Observation Detail
⚠️ Diff size 37 files, +919/-406. Large diff; review coverage may be incomplete.
Binary changes No binary changes reported by this diff.
Credential patterns No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit.

Reviewed 82d4378c81e0bb540baa9ceba7330e8bc4fb1340 with opencode-go/glm-5.3-flash. Automated advisory review; no project commands or tests were executed.

<!-- forgejo-pi-review:c9cc5edcd300ff28786c7a60666454b5bc2fb1d50ec20cfe942e86eb80904652 --> ## Pi code review **0 new actionable findings** No new actionable findings. Previously reported issues, if any, are tracked below. <details> <summary>Earlier findings: 1 rechecked</summary> - **Resolved:** Retained max-w-60 utility on the stat-block theme select is defeated by the new unlayered .editor-control rule (`src/lib/components/preview/PreviewThemePicker.svelte:53`, first reported in review #17) — Current head src/app.css defines .editor-control with width:100%, padding, border, and font rules but no max-width declaration at all, so the retained max-w-60 utility (15rem) composes normally with width:100% and the 240px cap applies. The layered/unlayered conflict described previously no longer exists; tests/e2e/monster-maker.spec.ts additionally asserts toHaveCSS('max-width','240px') on #preview-theme. </details> Reviewed the head (82d4378) against base (ad38c27), focusing on the theme-system rework (system-mode preference, palette role expansion), shared control classes, the lazy-editor and scroll-settle fixes, and the prior max-w-60 finding. Context budget limited late repo re-verification, but the diff plus head reads of app.css, ThemePicker, LazyEditor, and app.html covered the cited defects. Reviewed the two test-file diffs in the PR description against the head tree, tracing the app.css theme blocks, palettes.ts, theme store, LazyEditor, EditorWorkspace scroll-settle logic, and the ProficienciesEditor variant fixes. The palette values, CSS token sync, vendored fixture path, lazy-editor retention, and corrected Tailwind arbitrary variants all check out; remaining verification was limited by the repository read budget (ThemePicker and e2e spec could not be inspected). <details> <summary>Change walkthrough</summary> | Area | Files | Changes | | --- | --- | --- | | Other code (7) | `src/app.css`, `src/lib/theme/palettes.ts`, `src/lib/state/theme-store.ts`, `src/lib/components/app-shell/ThemePicker.svelte` (+3 more) | Full theme-role expansion (surface-muted, border-strong, error/on-error), Space Grotesk/Figtree font tokens, shared .editor-control/.editor-button/.shell-button styles, scrim and selection fixes. ThemeColors gains borderStrong/accentForeground/error/onError roles; palettes updated to Main-Theme values; adds ALL_PALETTES. Adds system mode preference with per-mode light/dark theme storage, OS scheme listener, and validated localStorage migration. Click-opened Appearance dialog with mode tabs (System/Light/Dark), swatches, outside-click and Escape close | | Tests (5) | `tests/fixtures/ancient-red-dragon.toml`, `tests/components/app-shell.test.ts`, `tests/e2e/monster-maker.spec.ts`, `tests/unit/theme-palettes.test.ts` (+1 more) | Added vendored portable-format TOML fixture Updated theme-picker test for click-to-open behavior and swatches Updated theme-picker flows for System tab, Escape close, swatches, and the max-width assertion Rewrites palette tests to assert Main-Theme spec values and keep app.css theme blocks synced to palettes.ts via a jsdom/Node fs read. | Review effort: **3/5**. </details> <details> <summary>Static observations (not validation results)</summary> | Observation | Detail | | --- | --- | | ⚠️ Diff size | 37 files, +919/-406. Large diff; review coverage may be incomplete. | | Binary changes | No binary changes reported by this diff. | | Credential patterns | No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit. | </details> --- Reviewed `82d4378c81e0bb540baa9ceba7330e8bc4fb1340` with `opencode-go/glm-5.3-flash`. Automated advisory review; no project commands or tests were executed.
feat/theme: add the Alucard light palette
All checks were successful
/ deploy (push) Successful in 2m26s
054975f439
Add Dracula's light counterpart from Main-Theme: palette roles, the app.css token block, the pre-paint theme resolver key list, the stat-block preview content colors, and a light-list swatch. The e2e light-mode selection now uses Alucard and asserts the resolved --bg token.
BlackHatMagic left a comment

Pi code review

0 new actionable findings

No new actionable findings. Previously reported issues, if any, are tracked below.

Reviewed the Main-Theme alignment PR end-to-end: theme token/palette rewrite (including the new alucard theme and System mode in theme-store, the app.html early-boot script, and stat-block-themes wiring), the shared control classes, the LazyEditor pending-import fix, the bounded scroll-settle pass in EditorWorkspace, and the corrected Tailwind arbitrary variants. No reachable defects found: the stored 'system' preference is resolved consistently by both the inline boot script and initTheme, the theme-palettes test/comment wiring covers the new palette, loader promise caching makes the LazyEditor fix safe, and the settle loop is bounded and cancelled on cleanup; tool access to search/stat-block tests was cut short by repository context limits, so the palettes↔app.css sync test and grep for now-unused exports were not independently re-run. Reviewed the design-alignment PR: theme palette/CSS token sync, System mode wiring, lazy-editor load fix, scroll-settle logic, font imports, Tailwind variant fix, and the vendored TOML fixture. All inspected code is consistent and matches the PR's stated fixes; repository tool budget was exhausted before reading the vendored fixture bytes and the e2e max-width assertion, and no build/tests could be executed in this read-only review.

Change walkthrough
Area Files Changes
Other code (9) src/app.css, src/app.html, src/lib/state/theme-store.ts, src/lib/theme/palettes.ts (+5 more) Rewrote theme tokens (border-strong, accent-foreground, danger roles), 11+1 theme blocks, self-hosted fonts, and shared shell/editor control classes Removed Google Fonts links, added alucard to the light theme list in the early-boot script Added ModePreference ('system'|light|dark), modePreference store, setModePreference, and a single live prefers-color-scheme listener Extended ThemeColors with the full semantic role set and added the alucard light palette
Tests (2) tests/fixtures/ancient-red-dragon.toml, tests/e2e/monster-maker.spec.ts Vendored the portable-format TOML fixture previously taken from the sibling Obsidian-Stat-Blocks checkout Updated theme-picker interactions to the click dialog, alucard assertions, and the max-w-60 cap assertion

Review effort: 4/5.

Static observations (not validation results)
Observation Detail
⚠️ Diff size 37 files, +967/-415. Large diff; review coverage may be incomplete.
Binary changes No binary changes reported by this diff.
Credential patterns No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit.

Reviewed 054975f439b2bff20e315b026ca840a34f179f6e with opencode-go/glm-5.3-flash. Automated advisory review; no project commands or tests were executed.

<!-- forgejo-pi-review:8bb4c5a02963e4d565013fae411b6dbb1a84ae6d1e4c056bd2c047c22940f346 --> ## Pi code review **0 new actionable findings** No new actionable findings. Previously reported issues, if any, are tracked below. Reviewed the Main-Theme alignment PR end-to-end: theme token/palette rewrite (including the new alucard theme and System mode in theme-store, the app.html early-boot script, and stat-block-themes wiring), the shared control classes, the LazyEditor pending-import fix, the bounded scroll-settle pass in EditorWorkspace, and the corrected Tailwind arbitrary variants. No reachable defects found: the stored 'system' preference is resolved consistently by both the inline boot script and initTheme, the theme-palettes test/comment wiring covers the new palette, loader promise caching makes the LazyEditor fix safe, and the settle loop is bounded and cancelled on cleanup; tool access to search/stat-block tests was cut short by repository context limits, so the palettes↔app.css sync test and grep for now-unused exports were not independently re-run. Reviewed the design-alignment PR: theme palette/CSS token sync, System mode wiring, lazy-editor load fix, scroll-settle logic, font imports, Tailwind variant fix, and the vendored TOML fixture. All inspected code is consistent and matches the PR's stated fixes; repository tool budget was exhausted before reading the vendored fixture bytes and the e2e max-width assertion, and no build/tests could be executed in this read-only review. <details> <summary>Change walkthrough</summary> | Area | Files | Changes | | --- | --- | --- | | Other code (9) | `src/app.css`, `src/app.html`, `src/lib/state/theme-store.ts`, `src/lib/theme/palettes.ts` (+5 more) | Rewrote theme tokens (border-strong, accent-foreground, danger roles), 11+1 theme blocks, self-hosted fonts, and shared shell/editor control classes Removed Google Fonts links, added alucard to the light theme list in the early-boot script Added ModePreference ('system'\|light\|dark), modePreference store, setModePreference, and a single live prefers-color-scheme listener Extended ThemeColors with the full semantic role set and added the alucard light palette | | Tests (2) | `tests/fixtures/ancient-red-dragon.toml`, `tests/e2e/monster-maker.spec.ts` | Vendored the portable-format TOML fixture previously taken from the sibling Obsidian-Stat-Blocks checkout Updated theme-picker interactions to the click dialog, alucard assertions, and the max-w-60 cap assertion | Review effort: **4/5**. </details> <details> <summary>Static observations (not validation results)</summary> | Observation | Detail | | --- | --- | | ⚠️ Diff size | 37 files, +967/-415. Large diff; review coverage may be incomplete. | | Binary changes | No binary changes reported by this diff. | | Credential patterns | No matches after excluding known examples/placeholders. Added-line heuristics only; not a security audit. | </details> --- Reviewed `054975f439b2bff20e315b026ca840a34f179f6e` with `opencode-go/glm-5.3-flash`. Automated advisory review; no project commands or tests were executed.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
BlackHatMagic/5e-Monster-Maker!1
No description provided.