Skip to content

feat(editor,editormcp): show live agent edits in viewport and scene tree (#1013) - #1225

Merged
houko merged 2 commits into
mainfrom
feat/editor-agent-live-edits-1013
Nov 26, 2026
Merged

houko merged 2 commits into
mainfrom
feat/editor-agent-live-edits-1013

Conversation

@houko

@houko houko commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Closes #1013

Summary

  • Live viewport overlays (packages/game/editor/agent_live.go, agent_live_ui.go): Pending agent turns compute a structural baseline diff and render inspectable overlays (ViewportLiveOverlays / VisibleViewportLiveOverlays) in both 2D and 3D viewports using SpecPalette tokens (docs/design/editor/Spec.dc.html, Working.dc.html, Main.dc.html):
    • Added: 1.5 px dashed green outline + + <name> mono pill.
    • Changed: 1.5 px dashed amber outline + <field> <old> → <new> mono pill (also synced into the Inspector's review change markers).
    • Removed: 25% grey ghost at the pre-turn bounds + 1.5 px solid red outline + struck-through <name> removed pill.
    • Agent working: 1.5 px solid pulsing violet outline (1.6 s 45%–100% pulse; solid 100% under reduced motion), no handles, violet sparkle pill with activity copy.
    • Problem: 2 px solid red outline + high-contrast filled alert pill.
    • Automatic pill collision avoidance (resolvePillRect) prevents adjacent or stacked pills from overlapping.
  • Selection coexistence & step-scoped read-only guard: When an object is both selected and actively touched by an agent step (BeginAgentStep / editormcp.Server.BeginStep), selection keeps its 2D/3D handles while the agent outline sits 3 px further out (OutsetPx: 6). Manual edits on touched objects are refused with ErrAgentTouchingObject across viewport drags, 2D/3D gizmos/handles/shapes, inspector (with a violet read-only banner), scene tree (rename/reparent), context menu, and direct Editor mutation methods until EndAgentStep, while untouched objects stay editable.
  • Scene tree markers & header pill: Scene tree shows NEW, MOD, struck-through DEL ghost rows, and the violet agent-working dot until KeepAgentTurn (collapsing to one undo step) or RevertAgentTurn. The toolbar header pill tracks Working, Waiting, and Pending Review (with Keep/Revert) states and hides when Idle.
  • Interactive top-left Overlay Legend: Shows automatically when live overlays exist (or OverlayLegendOpen() is true); each row (Selection, Agent working, Added, Changed, Removed, Problem) is an interactive RoleSwitch persisted per-user in EditorSettings.HiddenOverlayKinds (editor.yaml / apps/website/public/schemas/editor-settings.v1.json).
  • Camera invariant: Neither editormcp nor Editor moves the 2D or 3D viewport camera on the agent's behalf.
  • Docs, changelog, and agent note: Updated docs/en/editor.md and docs/zh/editor.md, added changelog.d/editor-agent-live-edits-1013.md, and recorded .agents/notes/implemented/feature/2026-11-26-editor-agent-live-edits.md.

Verification

  • env -u GOROOT go tool nsgo check (macOS and -target ios) on ./editor, ./editor/editormcp, ./editor/editorcmd — passed.
  • TMPDIR=/tmp env -u GOROOT go tool nsgo test ./editor (TestAgent*, TestOpenFromTheFileBrowserOpensTabs, TestDiscardFollowsTheProjectBack, TestLightingHandlesAlignOnParallaxLayer, TestLocaleCatalogsComplete, TestDesktopMenuBarMatchesRegistryAndExecutesActions, TestEditorSystemAppearanceLiveSwitchWithoutRestart, TestSpec*) — 18/18 passed.
  • env -u GOROOT go tool nsgo test ./editor/editormcp — 39/39 passed (including TestMCPLiveTurnOverlaysLegendReadOnlyAndKeepRevert).
  • TMPDIR=/tmp env -u GOROOT go tool nsgo test -target macos -run TestAgentLiveEditsMacOSScreenshots ./editor/editorcmd — captured and visually inspected Dark Working, Light Working, and Dark Pending Review native macOS screenshots (temporary PNGs removed before commit).
  • env -u GOROOT go tool nsgo test . -run TestFormat — 63/63 passed.
  • env -u GOROOT go run ./cmd/gameschema -check, env -u GOROOT go run ./tools/changelog check, and bun run verify-notes — all passed.

@github-actions github-actions Bot added size/XL enhancement New feature or request documentation Improvements or additions to documentation pkg/editor area/website area/agents conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-agent-live-edits-1013 branch 2 times, most recently from 4e84483 to 8d44bd6 Compare November 26, 2026 12:17
@github-actions github-actions Bot added conflict Conflicts with the target branch; resolve before merging and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-agent-live-edits-1013 branch from 8d44bd6 to 6973e14 Compare November 26, 2026 12:52
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko merged commit dd18a87 into main Nov 26, 2026
50 of 51 checks passed
@houko
houko deleted the feat/editor-agent-live-edits-1013 branch November 26, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents area/website documentation Improvements or additions to documentation enhancement New feature or request pkg/editor size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: show the agent's edits live in the viewport and scene tree while it works

1 participant