Skip to content

feat(editor): review agent data table changes row by row with old → new and Δ% - #1241

Merged
houko merged 2 commits into
mainfrom
feat/editor-review-datatable-1033
Nov 26, 2026
Merged

houko merged 2 commits into
mainfrom
feat/editor-review-datatable-1033

Conversation

@houko

@houko houko commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements row-by-row agent Data Table review matching docs/design/editor/ReviewData.dc.html and docs/design/editor/Spec.dc.html.

Closes #1033

Key changes

  • Line metadata in tooling/datatable: added Document.RowLine and Document.CellLine so the right-hand YAML diff pane reports exact 1-based YAML line numbers without altering lossless serialization.
  • Row-by-row Data Table review engine (packages/game/editor/datatable_review.go):
    • Multi-file turns with per-file summaries (27 of 40 changed, new · 0 records), filter chips (All, Changed, Unchanged, Reverted, Yours) with counts, text filter, and non-destructive column sorting cycling ascending → descending → file order with aria-sort (DataTableReviewAriaSort). Numeric columns with changes show a Δ header and sort by percentage delta.
    • Per-cell old → new and Δ% formatting (numeric zero renders as —), per-record Revert / Restore, in-place cell value editing (validated against any registered Go RowType or inferred ValueKind), and row reordering — both joining the review under Yours and tagged you in the focused record's +/- YAML diff.
    • Agent check figures (DataTableReviewCheck: label, value, before, basis) that automatically become marked Out of date whenever the person reverts, restores, edits, or reorders a record, until refreshed.
    • Esc pauses the review (PauseDataTableReview), keeps autosave paused (HasOpenReview), shows a "Review paused" toast with Resume, and surfaces a "Review waiting" card in AgentPanelView (without duplicating RightRailView, AgentPanelView, or AgentTurn).
    • Keep N of M composes from base.Clone() and patches only kept and edited cells via SetCell, leaving untouched and reverted lines byte-for-byte identical, and commits all files in one atomic Undo step (Undo restores every file byte for byte and removes newly created files). Revert all leaves disk untouched and is undoable with ⌘Z.
  • Spec-styled full-window UI (packages/game/editor/datatable_review_ui.go): uses exclusively SpecPalette tokens (Dark and Light), dashed Changed borders on agent-edited cells, solid Accent borders on person-edited cells, drag-to-reorder via dragdrop, empty new-file state ("No records — ask the agent to add some"), and WCAG AA contrast on Keep and Restore controls.
  • Editor MCP tools (packages/game/editor/editormcp/datatable_review.go): added datatable_review_propose, datatable_review_checks, and datatable_review_status.
  • Docs, locales, changelog, and agent note: updated packages/game/editor/locales/{en,zh}.yaml, docs/{en,zh}/editor.md, docs/{en,zh}/mcp.md, changelog.d/editor-review-datatable.md, and .agents/notes/implemented/feature/2026-11-26-editor-datatable-review.md.

Verification

  • cd packages/game && env -u GOROOT go tool nsgo check (host and -target ios) on ./tooling/datatable, ./editor, ./editor/editormcp, ./editor/editorcmd — all passed.
  • cd packages/game && env -u GOROOT go tool nsgo test ./tooling/datatable — 29 passed.
  • cd packages/game && TMPDIR=/tmp env -u GOROOT go tool nsgo test ./editor -run "TestDataTable|TestLocaleCatalogsComplete|TestSpecTheme|TestAutoSave|TestAgent" — all passed (including 27-of-40 shop review, price Δ sort, revert 2, edit 1, lossless Keep diff, single-step byte-for-byte Undo, out-of-date agent checks, and Esc pause/resume).
  • cd packages/game && TMPDIR=/tmp env -u GOROOT go tool nsgo test ./editor/editormcp — 47 passed.
  • cd packages/game && TMPDIR=/tmp env -u GOROOT go tool nsgo test -target macos -screenshots tmp-dt-shots -run TestDataTableReviewMacOSScreenshots ./editor/editorcmd — passed; visually inspected all 4 captured macOS PNGs (Dark open, Dark sorted + stale checks, Light parity, Dark empty new file) and deleted temporary PNGs before commit.
  • env -u GOROOT go run ./tools/changelog check and bun run verify-notes — passed.

@github-actions github-actions Bot added enhancement New feature or request size/XL documentation Improvements or additions to documentation pkg/tooling pkg/editor area/agents conflict Conflicts with the target branch; resolve before merging and removed enhancement New feature or request labels Nov 26, 2026
@houko
houko force-pushed the feat/editor-review-datatable-1033 branch from 7fccab8 to 310ec4c Compare November 26, 2026 11:58
@github-actions github-actions Bot added the enhancement New feature or request label Nov 26, 2026
@houko
houko force-pushed the feat/editor-review-datatable-1033 branch from 310ec4c to 240449d Compare November 26, 2026 12:09
@houko
houko force-pushed the feat/editor-review-datatable-1033 branch from 240449d to cd7415d Compare November 26, 2026 12:44
@github-actions github-actions Bot removed the conflict Conflicts with the target branch; resolve before merging label Nov 26, 2026
@houko
houko merged commit 14f99b9 into main Nov 26, 2026
50 of 51 checks passed
@houko
houko deleted the feat/editor-review-datatable-1033 branch November 26, 2026 12:53
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 pkg/tooling size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editor: review an agent's data table changes row by row with old → new and Δ%

1 participant