Map editor: top-anchored command bar, and the harness must not persist the author's UI state #286

Open
opened 2026-08-08 15:57:33 +02:00 by panda · 0 comments
Collaborator

The tools panel is a floating ImGui window that Tab hides, and the hidden state is remembered
between sessions
. The owner opened the editor and the panel was simply gone, with nothing on screen to
say why or how to get it back — because a screenshot run had sent ui off over the automation channel and
that flag was persisted into editor-view.json.

Owner's call: "io lo metterei come anchor in cima tipo una barra comandi apribile" — a top-anchored,
openable command bar.

It fixes a second, older problem too, already recorded in docs/map-editor.md: the 3D view exists to judge
relief, and the panel covered most of the window, so it could not do the one thing it is for. Tab-hiding
was the plaster. A bar one row tall removes the need for the plaster.

Agreed design

  • A top-anchored bar, always present. It cannot be hidden, only collapsed, and collapsing leaves the
    bar itself plus a status strip (cursor, Z, dirty chunks, px/cell). The state the owner hit becomes
    unreachable.
  • A contextual second row, shown only when the active tool has parameters. Today Landform, Ridge,
    Caldera and Road stack all their sliders permanently, whatever tool is selected; ~40 controls are on
    screen at all times.
  • The palette is a popup with a search box — every terrain and every static is a long list, and it is
    a pick-once-then-paint action.
  • Tab collapses, it no longer hides. "Hide everything" survives only as a harness verb for clean
    captures, and it is never persisted.
  • Chrome drawing leaves EditorGame. DrawToolsWindow is ~280 lines in one method; the authoring
    parameters move to their own type and the drawing to its own, so EditorGame stays the thin coordinator
    its CLAUDE.md requires (the editor's mirror of the Screen HARD GATE).

Invariants Check

Walked against CLAUDE.md ## Design checklist, plus the editor's own guardrails. No violations.

Scope ok - editor chrome plus the harness bug that caused it - Server-authoritative N/A, the editor is
offline and issues no intent - GM authorization N/A - Identity model N/A - Protocol versioned N/A, no
wire type - String catalog N/A, internal tool, not player-facing copy - Single-threaded sim N/A, no
World - World.cs HARD GATE untouched - Screen HARD GATE this is the point: 280 lines of ImGui in
one method become focused units the coordinator orchestrates - Client engine-independence drawing is
ImGui glue and stays in MapEditor; the one pure piece (persisted view state) moves to Core and becomes
unit-tested - Gameplay/Networking N/A - Act on the instance N/A - Extend by type no new switch on a
type - Typed content-def N/A - Server-paced actions N/A - Persistence N/A: editor-view.json is
neither the world save nor a DB - Process separation N/A - Typed options tunables stay typed fields
with one default each - Broadcasts/AoI N/A - Multi-platform ImGui.NET on DesktopGL, already portable -
Assets no new art - Asset naming N/A - Walkability by slope N/A - Occupancy contains render N/A -
Cutaway is structural N/A - ModernUO no equivalent (its editing is in-game via GM gumps); we diverge
because ours is an offline tool - Docs & DoD docs/map-editor.md Controls section rewritten in the same
change.

Editor guardrails: UI stays off-the-shelf ImGui, no hand-rolled widgets; no map logic moves into drawing;
the canvas stays a bitmap.

Verification plan

Honest about this: it is chrome, and there is almost nothing unit-testable. What there is, is isolated on
purpose.

  • Unit (MapEditor.Core): the persisted view state becomes a pure type with one testable rule -
    a change that came from the harness is never written to disk. Today's bug, pinned by a test instead of
    by memory.
  • Screenshots, driven through the automation channel on a copy of the authored world: the bar with each
    tool selected; the bar collapsed; the contextual row for Ridge / Caldera / Road; a pending proposal with
    Commit/Discard visible; and the 3D view with the bar, to show it no longer covers the relief.
  • Targeted manual check: painting under the bar, and under an open popup, must not touch the map.

Definition of Done

Beyond the base DoD (tests green, whole solution builds, zero warnings) and the multi-platform requirement:

  1. Opening the editor after any harness session shows the bar. Demonstrable: run a harness capture with
    the hide verb, quit, reopen - the bar is there, and editor-view.json still has chrome enabled.
  2. There is no input that leaves the window with no chrome at all. Tab collapses to the status strip;
    the strip always shows cursor, Z, dirty chunk count and px/cell.
  3. Only the active tool's parameters are on screen. Selecting Terrain shows no Ridge or Caldera slider.
  4. The pending-proposal numbers and its Commit/Discard are visible without opening anything whenever a
    proposal exists - it is a decision the author must make, so it may never sit behind a popup.
  5. Clicking or dragging over the bar, the contextual row or an open popup does not edit the map.
  6. EditorGame no longer contains the chrome drawing, and no method of it exceeds the coordinator role.
  7. docs/map-editor.md describes the bar, what Tab does, and that the harness view verbs are
    session-only.
The tools panel is a floating ImGui window that `Tab` hides, and the hidden state is **remembered between sessions**. The owner opened the editor and the panel was simply gone, with nothing on screen to say why or how to get it back — because a screenshot run had sent `ui off` over the automation channel and that flag was persisted into `editor-view.json`. Owner's call: *"io lo metterei come anchor in cima tipo una barra comandi apribile"* — a top-anchored, openable command bar. It fixes a second, older problem too, already recorded in `docs/map-editor.md`: the 3D view exists to judge relief, and the panel covered most of the window, so it could not do the one thing it is for. `Tab`-hiding was the plaster. A bar one row tall removes the need for the plaster. ## Agreed design - **A top-anchored bar, always present.** It cannot be hidden, only collapsed, and collapsing leaves the bar itself plus a status strip (cursor, Z, dirty chunks, px/cell). The state the owner hit becomes unreachable. - **A contextual second row**, shown only when the active tool has parameters. Today Landform, Ridge, Caldera and Road stack *all* their sliders permanently, whatever tool is selected; ~40 controls are on screen at all times. - **The palette is a popup with a search box** — every terrain and every static is a long list, and it is a pick-once-then-paint action. - **`Tab` collapses**, it no longer hides. "Hide everything" survives only as a harness verb for clean captures, and it is **never persisted**. - **Chrome drawing leaves `EditorGame`.** `DrawToolsWindow` is ~280 lines in one method; the authoring parameters move to their own type and the drawing to its own, so `EditorGame` stays the thin coordinator its `CLAUDE.md` requires (the editor's mirror of the `Screen` HARD GATE). ## Invariants Check Walked against `CLAUDE.md` `## Design checklist`, plus the editor's own guardrails. No violations. `Scope` ok - editor chrome plus the harness bug that caused it - `Server-authoritative` N/A, the editor is offline and issues no intent - `GM authorization` N/A - `Identity model` N/A - `Protocol versioned` N/A, no wire type - `String catalog` N/A, internal tool, not player-facing copy - `Single-threaded sim` N/A, no `World` - `World.cs HARD GATE` untouched - `Screen HARD GATE` **this is the point**: 280 lines of ImGui in one method become focused units the coordinator orchestrates - `Client engine-independence` drawing is ImGui glue and stays in `MapEditor`; the one pure piece (persisted view state) moves to `Core` and becomes unit-tested - `Gameplay/Networking` N/A - `Act on the instance` N/A - `Extend by type` no new switch on a type - `Typed content-def` N/A - `Server-paced actions` N/A - `Persistence` N/A: `editor-view.json` is neither the world save nor a DB - `Process separation` N/A - `Typed options` tunables stay typed fields with one default each - `Broadcasts/AoI` N/A - `Multi-platform` ImGui.NET on DesktopGL, already portable - `Assets` no new art - `Asset naming` N/A - `Walkability by slope` N/A - `Occupancy contains render` N/A - `Cutaway is structural` N/A - `ModernUO` no equivalent (its editing is in-game via GM gumps); we diverge because ours is an offline tool - `Docs & DoD` `docs/map-editor.md` Controls section rewritten in the same change. Editor guardrails: UI stays off-the-shelf ImGui, no hand-rolled widgets; no map logic moves into drawing; the canvas stays a bitmap. ## Verification plan Honest about this: it is chrome, and there is almost nothing unit-testable. What there is, is isolated on purpose. - **Unit (`MapEditor.Core`)**: the persisted view state becomes a pure type with one testable rule - *a change that came from the harness is never written to disk*. Today's bug, pinned by a test instead of by memory. - **Screenshots**, driven through the automation channel on a copy of the authored world: the bar with each tool selected; the bar collapsed; the contextual row for Ridge / Caldera / Road; a pending proposal with Commit/Discard visible; and the 3D view with the bar, to show it no longer covers the relief. - **Targeted manual check**: painting under the bar, and under an open popup, must not touch the map. ## Definition of Done Beyond the base DoD (tests green, whole solution builds, zero warnings) and the multi-platform requirement: 1. Opening the editor after any harness session shows the bar. Demonstrable: run a harness capture with the hide verb, quit, reopen - the bar is there, and `editor-view.json` still has chrome enabled. 2. There is no input that leaves the window with no chrome at all. `Tab` collapses to the status strip; the strip always shows cursor, Z, dirty chunk count and px/cell. 3. Only the active tool's parameters are on screen. Selecting Terrain shows no Ridge or Caldera slider. 4. The pending-proposal numbers and its Commit/Discard are visible **without opening anything** whenever a proposal exists - it is a decision the author must make, so it may never sit behind a popup. 5. Clicking or dragging over the bar, the contextual row or an open popup does not edit the map. 6. `EditorGame` no longer contains the chrome drawing, and no method of it exceeds the coordinator role. 7. `docs/map-editor.md` describes the bar, what `Tab` does, and that the harness view verbs are session-only.
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
marco/IsoMmo#286
No description provided.