spec(textarea-editor): adopt dedicated editor.css, simplify vocab sourcing
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) <noreply@anthropic.com>
This commit is contained in:
parent
bef6f0cdd9
commit
b19b00e706
1 changed files with 7 additions and 14 deletions
|
|
@ -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 |
|
||||
|
|
|
|||
Loading…
Reference in a new issue