Campaign Editor UI — tracking (done + remaining) #159

Open
opened 2026-06-27 10:19:13 -07:00 by nelsong6 · 1 comment
nelsong6 commented 2026-06-27 10:19:13 -07:00 (Migrated from github.com)

Tracking issue for the campaign editor UI (/campaigns-next). Context for the next agent.

Files: frontend/src/ui/CampaignEditor.tsx, frontend/src/ui/LevelInfoCompact.tsx, the .ce-* block in frontend/src/style.css (between .ce-screen { and the generic @media (prefers-reduced-motion)).

Working agreement / lessons (read first)

  • Match the established system; don't invent. When unsure of a visual treatment, look at the Settings screen (Settings.tsx + .settings-* CSS) and copy it — it's the accepted reference. Rounds were lost inventing backgrounds/frames instead of matching Settings (e.g. panels are panel.png 24 fill / 16px round with a dark fill from the frame art — no invented gradient/lighter variant; section heads are the gold #c9a877 eyebrow + a fading gold gradient rule — never a bright cyan divider).
  • Chrome is kit, never raw CSS (ADR-0002/0011/0012/0014): every frame/button/card/divider is a kit 9-slice via border-image; never hand-roll bg/border/gradient/box-shadow as chrome.
  • Type is tokenized (ADR-0024): --ds-text-* / --ds-font-* only, no raw font-size/font-family. Colors go through --ce-* tokens.
  • Inspect at zoom before claiming done. npm run shot handles ambient (rain) pages now; for tiny elements use a high-DPR crop (frontend/tmp-shots/zoom.mjs <url> <css-sel> <out> 5).
  • Sync the worktree to origin/main at session start — code + tooling drift behind main.

Done — merged (PR #154)

  • Chrome migrated off the magenta placeholders onto the baked kit (panels/buttons/rows/fields/shields) via border-image; campaignEditorAssets deleted.
  • Allies/Enemies readout moved from the top bar into the level header.
  • Compact Level Info toggle added (board size + terrain mix, unit roster by piece, zones, rules).
  • Scope fix: level-metadata editing (name/objective/difficulty/economy/notes) pulled OUT — editing a level belongs in the level editor, not here.

Done — branch claude/naughty-bhabha-a129a5 (PR linked below)

  • Typography → tokens (every raw size/family migrated; fixed row title/subtitle size inversions).
  • Color → consolidated --ce-* tokens (ally/enemy, label, cyan-bright, slate, gold-bright, eyebrow) — killed 6 forked cyans / 4 golds / duplicated ally-enemy.
  • Chrome → kit border-image: panel no longer double-chromes; info chips, unit badge, level thumbnail framed; icon-buttons + name field use border-image; skew gimmick + ~50 lines of dead .ce-brand CSS removed.
  • Panels match Settings exactly; section heads = gold eyebrow + gradient rule.
  • Selected rows = blue row-active palette swap (ADR-0018), replacing the interim cyan ring.
  • Level-row action buttons = universal panel.png frame + plain ▲/▼/✕ glyphs; retired the mis-assembled kit icon-button.png/-active.png (manifest regenerated); trimmed dead CE_ICONS.

Left to do (structural/UX — the user owns these; confirm before redesigning)

A multi-agent audit surfaced these; they verge on restructuring rather than pure compliance:

  • Dedupe redundant controls — per-row up/down/delete vs .ce-mid-actions move vs footer Delete Level (3× duplication); Save duplicated in topbar + footer. Keep one locus per action.
  • Stat strip — render Chapters/Levels/Difficulty as kit rows (the settings-row pattern) instead of the reinvented dl with raw border-left dividers.
  • Spacing — normalize panel padding + inter-panel gaps to the clamp() spacing tokens Settings uses.
  • Merge the duplicate .ce-icon-button rule block (low).
  • Focus/darkness: panels are dark now (Settings-matched). If "too hard to focus" recurs, it's a Settings-wide decision — do NOT re-invent a lighter campaign-editor fill.

Deliberately NOT doing

  • The concept's level-metadata form (objective/difficulty/funds/income/notes as field-select/field-input rows) stays OUT — editing belongs in the level editor.
  • /edit theme dropdown is dead (hardcoded "Grassland", onChange no-op).
  • /edit buildLevel() writes zones: [] → saving a level destroys its zones (data loss). A spawned task exists for this.

Reference

  • Concept art: frontend/public/assets/artwork/inspiration/ui-screen-concepts/02-campaign-editor.png
  • ADRs: 0002/0011/0012/0014 (chrome-is-kit), 0016–0018 (registry/palettes/swaps), 0020–0024 (typography), 0006 (UI decision criteria).
Tracking issue for the **campaign editor UI** (`/campaigns-next`). Context for the next agent. **Files:** `frontend/src/ui/CampaignEditor.tsx`, `frontend/src/ui/LevelInfoCompact.tsx`, the `.ce-*` block in `frontend/src/style.css` (between `.ce-screen {` and the generic `@media (prefers-reduced-motion)`). ## Working agreement / lessons (read first) - **Match the established system; don't invent.** When unsure of a visual treatment, **look at the Settings screen** (`Settings.tsx` + `.settings-*` CSS) and copy it — it's the accepted reference. Rounds were lost inventing backgrounds/frames instead of matching Settings (e.g. panels are `panel.png 24 fill / 16px round` with a dark fill from the frame art — **no invented gradient/lighter variant**; section heads are the gold `#c9a877` eyebrow + a fading gold gradient rule — **never a bright cyan divider**). - **Chrome is kit, never raw CSS** (ADR-0002/0011/0012/0014): every frame/button/card/divider is a kit 9-slice via `border-image`; never hand-roll bg/border/gradient/box-shadow as chrome. - **Type is tokenized** (ADR-0024): `--ds-text-*` / `--ds-font-*` only, no raw `font-size`/`font-family`. Colors go through `--ce-*` tokens. - **Inspect at zoom before claiming done.** `npm run shot` handles ambient (rain) pages now; for tiny elements use a high-DPR crop (`frontend/tmp-shots/zoom.mjs <url> <css-sel> <out> 5`). - **Sync the worktree to origin/main at session start** — code + tooling drift behind main. ## Done — merged (PR #154) - Chrome migrated off the magenta placeholders onto the baked kit (panels/buttons/rows/fields/shields) via `border-image`; `campaignEditorAssets` deleted. - Allies/Enemies readout moved from the top bar into the level header. - Compact Level **Info** toggle added (board size + terrain mix, unit roster by piece, zones, rules). - **Scope fix:** level-metadata *editing* (name/objective/difficulty/economy/notes) pulled OUT — editing a level belongs in the level editor, not here. ## Done — branch `claude/naughty-bhabha-a129a5` (PR linked below) - **Typography → tokens** (every raw size/family migrated; fixed row title/subtitle size inversions). - **Color → consolidated `--ce-*` tokens** (ally/enemy, label, cyan-bright, slate, gold-bright, eyebrow) — killed 6 forked cyans / 4 golds / duplicated ally-enemy. - **Chrome → kit border-image**: panel no longer double-chromes; info chips, unit badge, level thumbnail framed; icon-buttons + name field use `border-image`; skew gimmick + ~50 lines of dead `.ce-brand` CSS removed. - **Panels match Settings** exactly; **section heads** = gold eyebrow + gradient rule. - **Selected rows** = blue `row-active` palette swap (ADR-0018), replacing the interim cyan ring. - **Level-row action buttons** = universal `panel.png` frame + plain ▲/▼/✕ glyphs; retired the mis-assembled kit `icon-button.png`/`-active.png` (manifest regenerated); trimmed dead `CE_ICONS`. ## Left to do (structural/UX — the user owns these; confirm before redesigning) A multi-agent audit surfaced these; they verge on restructuring rather than pure compliance: - [ ] **Dedupe redundant controls** — per-row up/down/delete vs `.ce-mid-actions` move vs footer Delete Level (3× duplication); **Save** duplicated in topbar + footer. Keep one locus per action. - [ ] **Stat strip** — render Chapters/Levels/Difficulty as kit rows (the `settings-row` pattern) instead of the reinvented `dl` with raw border-left dividers. - [ ] **Spacing** — normalize panel padding + inter-panel gaps to the `clamp()` spacing tokens Settings uses. - [ ] Merge the duplicate `.ce-icon-button` rule block (low). - [ ] **Focus/darkness:** panels are dark now (Settings-matched). If "too hard to focus" recurs, it's a **Settings-wide** decision — do NOT re-invent a lighter campaign-editor fill. ## Deliberately NOT doing - The concept's level-metadata **form** (objective/difficulty/funds/income/notes as `field-select`/`field-input` rows) stays OUT — editing belongs in the level editor. ## Related bugs (separate — in the level editor `/edit`, not this UI) - `/edit` **theme dropdown is dead** (hardcoded "Grassland", `onChange` no-op). - `/edit` `buildLevel()` writes `zones: []` → **saving a level destroys its zones** (data loss). A spawned task exists for this. ## Reference - Concept art: `frontend/public/assets/artwork/inspiration/ui-screen-concepts/02-campaign-editor.png` - ADRs: 0002/0011/0012/0014 (chrome-is-kit), 0016–0018 (registry/palettes/swaps), 0020–0024 (typography), 0006 (UI decision criteria).
nelsong6 commented 2026-06-27 15:49:20 -07:00 (Migrated from github.com)

Landed two of the three remaining items via #171 (squash-merged):

  • ✅ Stat strip → kit rows — Chapters/Levels/Difficulty are now row.png-framed .ce-stat-rows (settings-row pattern, editor-scoped --ce-* tokens), replacing the <dl> + raw border-left dividers. Visually confirmed.

  • ✅ Merge duplicate .ce-icon-button — two back-to-back base blocks collapsed into one.

  • ⏹️ Spacing → tokens: closed without doing it. Investigation found the premise doesn't hold — the --ds-space-* tokens are fixed px (not clamp()) and Settings itself doesn't consume them, so "normalize to the spacing tokens Settings uses" isn't a real target. Tokenizing the editor ahead of Settings would make it more tokenized than the reference (backwards); snapping off-scale values (6/7/9/10/14/18px) to the 6-step scale is an unmotivated visual change. A real spacing system should be a holistic Settings-first design-system pass, tracked separately if wanted.

Landed two of the three remaining items via #171 (squash-merged): - ✅ **Stat strip → kit rows** — Chapters/Levels/Difficulty are now `row.png`-framed `.ce-stat-row`s (settings-row pattern, editor-scoped `--ce-*` tokens), replacing the `<dl>` + raw `border-left` dividers. Visually confirmed. - ✅ **Merge duplicate `.ce-icon-button`** — two back-to-back base blocks collapsed into one. - ⏹️ **Spacing → tokens: closed without doing it.** Investigation found the premise doesn't hold — the `--ds-space-*` tokens are fixed px (not `clamp()`) and Settings itself doesn't consume them, so "normalize to the spacing tokens Settings uses" isn't a real target. Tokenizing the editor ahead of Settings would make it *more* tokenized than the reference (backwards); snapping off-scale values (6/7/9/10/14/18px) to the 6-step scale is an unmotivated visual change. A real spacing system should be a holistic **Settings-first** design-system pass, tracked separately if wanted.
Sign in to join this conversation.
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
romaine-life/chess-tactics#159
No description provided.