Skip to content

feat(editor,editormcp): resolve review conflicts and hand-edit YAML in review (#1032) - #1239

Open
houko wants to merge 1 commit into
mainfrom
feat/editor-review-conflicts-yaml-edit-1032
Open

houko wants to merge 1 commit into
mainfrom
feat/editor-review-conflicts-yaml-edit-1032

Conversation

@houko

@houko houko commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Closes #1032

Summary

Implements conflict resolution with concurrent manual edits and in-place YAML editing inside the full-window agent Review screen (docs/design/editor/Review.dc.html), strictly styled with docs/design/editor/Spec.dc.html Dark and Light tokens and built cleanly on top of agent.go, agent_ui.go, and spec_theme.go:

  • Three-way conflict detection & auto-merge (packages/game/editor/review.go):
    • Tracks pending agent review turns (StartReviewTurn / OpenReviewTurn) and automatically syncs concurrent manual edits made through editor commands (syncReviewAfterMutate) via sceneformat.Merge(BaseDoc, PersonDoc, AgentDoc).
    • Edits to different fields of the same object merge cleanly without asking.
    • Overlapping edits to the same field or list (such as door_1's on_open list) display both sides with line authors (you, agent) and a Mine / Agent's / Both segmented control (ResolveReviewConflict), where Both preserves both entries, yours first.
    • Unresolved conflicts disable Keep with "Choose how <object> merges", and pressing Keep or the header blocker jumps straight to that change.
  • In-place YAML editing, parse errors & one-step fixes (review.go, review_ui.go):
    • Clicking Edit (BeginReviewYAMLEdit) on an added or changed object makes the right-hand YAML pane editable in place (SetReviewYAMLDraft).
    • Valid edits update the Review viewport live and tag edited lines you.
    • Parse errors mark the exact scene line, show "Fix YAML on line N" in the header blocker and "Line N isn't valid YAML" in the alert card, disable Done and Keep, offer mechanical one-step fixes (ApplyReviewYAMLFix, including Add the colon for x 444, Close the quote, Add the closing brace/bracket, and Replace tabs with spaces), and offer Undo my typing (UndoReviewYAMLTyping).
  • Single undo step & MCP visibility (packages/game/editor/editormcp/review.go):
    • Merge choices and YAML hand edits land and undo together with the turn in one Editor.History step (KeepReviewTurn), gating autosave (HasOpenReview) until kept.
    • Adds the review_status MCP tool returning conflict choices, active blockers, and hand-edited fields/lines tagged "you" for round 2.
  • Review keyboard scope, docs, changelog, and DeepSeek note:
    • Adds ScopeReview shortcuts (J, K, X, B, ⌘↵, ⌘⌫) and strictly-sorted en.yaml / zh.yaml locale entries.
    • Updates docs/en/editor.md, docs/zh/editor.md, docs/en/mcp.md, docs/zh/mcp.md, adds changelog.d/editor-review-conflicts-yaml-edit-1032.md, and adds .agents/notes/implemented/feature/2026-11-26-editor-review-conflicts-yaml-edit.md.

Verification

  • env -u GOROOT go tool nsgo check ./editor, ./editor/editormcp, ./editor/editorcmd (default + -target ios)
  • TMPDIR=/tmp env -u GOROOT go tool nsgo test ./editor -run "TestReview|TestLocaleCatalogsComplete|TestAutoSave|TestAgent|TestShortcuts|TestCommands|TestSpec"
  • env -u GOROOT go tool nsgo test ./editor/editormcp (47 passed)
  • env -u GOROOT go tool nsgo test -target macos -run TestReviewConflictsAndYAMLEditMacOSScreenshots ./editor/editorcmd (visually inspected 5 real macOS screenshots in Spec Dark and Spec Light: unresolved conflict, Both resolved, YAML parse error, fixed YAML tagged you, and Spec Light parity)
  • env -u GOROOT go run ./tools/changelog check & bun run verify-notes

@github-actions github-actions Bot added size/XL conflict Conflicts with the target branch; resolve before merging documentation Improvements or additions to documentation pkg/editor area/agents enhancement New feature or request and removed conflict Conflicts with the target branch; resolve before merging labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-review-conflicts-yaml-edit-1032 branch 2 times, most recently from b08e011 to 857a1b7 Compare November 26, 2026 11:35
@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-review-conflicts-yaml-edit-1032 branch from e6800a8 to 1c327cd Compare November 26, 2026 11:59
@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-review-conflicts-yaml-edit-1032 branch from 1c327cd to 4f26728 Compare November 26, 2026 12:14
@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-review-conflicts-yaml-edit-1032 branch 2 times, most recently from 7141674 to e17c0d5 Compare November 26, 2026 12:47
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-review-conflicts-yaml-edit-1032 branch from e17c0d5 to 8b6b972 Compare November 26, 2026 13:00
@github-actions github-actions Bot added the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko force-pushed the feat/editor-review-conflicts-yaml-edit-1032 branch from 8b6b972 to 29e3dc8 Compare November 26, 2026 13:05
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents 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: resolve conflicts with your own edits and hand-edit YAML inside a review

1 participant