Skip to content

style(editor): solid VSCode-style CodeMirror theme + bordered editor card (#98, #99) - #107

Merged
falbany merged 1 commit into
feat/yaml-config-editorfrom
fix/editor-vscode-theme-and-card
Nov 4, 2026
Merged

falbany merged 1 commit into
feat/yaml-config-editorfrom
fix/editor-vscode-theme-and-card

Conversation

@falbany

@falbany falbany commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Closes #98, closes #99 (sub-issues of the config editor #95). Grouped as one PR per the review plan: both issues touch the same code surface — the CodeMirror theme and its host.

Issue #98 — style(editor): solid VSCode-style CodeMirror theme

The theme painted backgroundColor: "transparent" so the editor showed the modal's frosted glass. The theme is rebuilt on new dedicated tokens:

  • index.css gains, in both data-theme blocks (dark tracks VSCode Dark Modern, light its slate/white counterparts):
    --app-editor-bg, --app-editor-gutter-bg, --app-editor-active-line, --app-editor-selection, --app-editor-border
  • Theme object: solid canvas, opaque gutter + border, visible indigo-alpha selection, active-line highlight, matching/non-matching bracket colors, and the Ctrl+F panel on the solid editor background.
  • Zero prefers-color-scheme code — the editor follows the app's light/dark flip like every surface.

Issue #99 — ui(editor): margin + bordered card

Editor body is padded (p-3 sm:p-4) and the host lives in a rounded bordered card (data-testid="editor-card" with the new background/border tokens). Loading/error states render inside the card so layout never jumps.

Verification

  • TDD RED first: 3 new vitest chrome tests (solid token canvas + gutter, tokens for both themes, card structure) failed for the right reasons before any implementation; two honest test refinements happened while red — CodeMirror merges built-in base-theme rules into the same <style> node, so the transparent ban is asserted on the shipped theme source rather than the merged stylesheet.
  • GREEN: ConfigEditorModal.test.tsx 26/26; full web suite 220/220 (14 files); tsc -b clean; vite build regenerated dist/ (precommit hooks green).
  • Python side untouched: pytest failure set identical to the branch baseline (69 pre-existing).

Visual check

Open the editor and confirm: solid dark canvas distinct from the glass modal, dark gutter band with hairline divider, padding on all four sides. Dark is VSCode-Dark-Modern derived; light uses white canvas + slate-50 gutter.

…card #98 #99

Two visual issues from the post-#95 review, landed together because they
touch exactly the same surface (the editor theme and its host).

## Issue #98 — solid VSCode-style theme

The CodeMirror theme painted `transparent` over the frosted modal glass.
New dedicated `--app-editor-*` tokens in index.css (both `data-theme`
blocks — dark tracks VSCode Dark Modern values, light its slate/white
counterparts):

  --app-editor-bg / gutter-bg / active-line / selection / border

The theme object is rebuilt on them: solid canvas, opaque gutter with a
borderRight of the new border token, visible indigo-alpha selection,
clear active-line and active-line-gutter, matching/non-matching bracket
colors, and the Ctrl+F search panel now sits on the solid editor
background instead of the glass.

## Issue #99 — margin + bordered card

The editor host now sits inside a padded body (`p-3 sm:p-4`) and a
rounded card (`data-testid="editor-card"`, rounded-lg + the editor
border/background tokens). Loading and error states render inside the
card so the layout does not jump between states; the host stays a plain
`h-full` child.

## TDD evidence

- RED: 3 new vitest chrome tests failed for the right reasons (no
  token-backed canvas rule, tokens absent from index.css, no card).
  Two test refinements while redder than the code: CodeMirror merges
  built-in base-theme rules into the same <style> node, so the
  `transparent` ban is asserted on the shipped theme source instead of
  the merged stylesheet; the token-sheet check reads index.css via
  node:fs because vitest virtual module URLs cannot be dereferenced.
- GREEN: ConfigEditorModal.test.tsx 26/26, full web suite 220/220
  (14 files).
- `tsc -b` clean; `vite build` regenerated dist (PWA precache refreshed);
  pytest unchanged (69 pre-existing failures identical to baseline);
  ruff clean.

Closes #98, closes #99
@falbany
falbany merged commit 240f7a7 into feat/yaml-config-editor Nov 4, 2026
1 check passed
falbany pushed a commit that referenced this pull request Nov 4, 2026
… dist

The manual merge of PRs #107 + #108 dropped the closing chunk of the
live-validation describe block in ConfigEditorModal.test.tsx: the final
test never closed (`});` for itself and for its describe) and the
"editor chrome" comment block lost its `/**` opening, leaving an
orphaned ` * ...` surface that stopped the whole file from parsing.

Consequences: `npm run build` (tsc) failed with TS1005/TS1434 syntax
errors from line 910 on (found by running src/profiles/web/build.py
--force as instructed), so no dist refresh could ship.

Repairs:
- Restored the missing `});`/`});` closing the
  test_live_validation_skipped_while_gate_parked test and the
  "live validation (issues #102/#100)" describe, and re-opened the
  `/**` block comment of the chrome describe.
- Rebuilt dist from the merged tree (the abort of the local conflicted
  dist merge left this branch needing a regeneration anyway).

Verification: build.py --force SUCCESS; vitest 226/226 (14 files).

No merge body changes otherwise.
@falbany
falbany deleted the fix/editor-vscode-theme-and-card branch November 4, 2026 23:29
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