From b19b00e7065428c2fda28f09fdabb049687d4bd5 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sat, 16 May 2026 17:52:50 +0200 Subject: [PATCH] spec(textarea-editor): adopt dedicated editor.css, simplify vocab sourcing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CSS lives in a dedicated stylesheet loaded only by the editor-assets partial, not folded into components.css — keeps the editor's footprint isolated from the global widget styles. Drop the two-stage vocab sourcing in favor of a single cvarlist/cmdlist dump. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../2026-05-16-textarea-code-editor-design.md | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/docs/superpowers/specs/2026-05-16-textarea-code-editor-design.md b/docs/superpowers/specs/2026-05-16-textarea-code-editor-design.md index 4a0fffb..bb190a6 100644 --- a/docs/superpowers/specs/2026-05-16-textarea-code-editor-design.md +++ b/docs/superpowers/specs/2026-05-16-textarea-code-editor-design.md @@ -78,19 +78,12 @@ Lives at `l4d2web/l4d2web/static/data/srccfg-vocab.json`: } ``` -**Sourcing — two-stage:** - -1. **Seed from the existing cvar reference doc.** `docs/l4d2-server-cvar-reference.md` - already curates the cvars users actually touch (with descriptions and - recommended values). Extract identifiers from its tables and code fences; - carry across short descriptions where present. -2. **Optionally augment** with a `cvarlist`/`cmdlist` dump from a freshly- - started L4D2 server with the project's common SourceMod plugins loaded, - hand-trimmed for engine internals nobody touches. This is purely additive - breadth; the curated reference is the authoritative source for descriptions. - -Generated once, committed verbatim. Document the regeneration procedure in -the top-of-file comment. +**Sourcing:** dump `cvarlist` / `cmdlist` from a freshly-started L4D2 +server with the project's common SourceMod plugins loaded. Hand-trim engine +internals nobody touches. Descriptions come from the `cvarlist` output's +trailing help text where present; otherwise omitted. Generated once, +committed verbatim. Document the regeneration procedure in the top-of-file +comment of `srccfg-vocab.json`. **Loading:** lazy fetch on first `srccfg` editor mount; cached on `window.__srccfgVocab` so multiple editors on the same page share the load. @@ -129,7 +122,7 @@ per the established pattern (`app.py:86`). | `l4d2web/l4d2web/static/js/editor.js` | New — ~250 LOC widget | | `l4d2web/l4d2web/static/js/srccfg-grammar.js` | New — ~30 LOC Prism grammar | | `l4d2web/l4d2web/static/data/srccfg-vocab.json` | New — curated cvars/commands | -| `l4d2web/l4d2web/static/css/components.css` | Add `.editor-shell`, `.editor-code`, `.editor-popup` rules; reuse `tokens.css` color variables; preserve textarea visual to avoid layout shift | +| `l4d2web/l4d2web/static/css/editor.css` | New — dedicated stylesheet for `.editor-shell`, `.editor-code`, `.editor-popup`; reuses `tokens.css` color variables; preserves textarea visual to avoid layout shift. Loaded by the `_editor_assets.html` partial so it ships only on pages that mount an editor. | | `l4d2web/pyproject.toml` | Add `playwright` dev dep | | `l4d2web/tests/e2e/conftest.py` | New — boot Flask app under test, expose URL fixture | | `l4d2web/tests/e2e/test_editor.py` | New — Playwright test: type `sv_che`, assert popup, accept, assert textarea value |