Skip to content

feat(web): World Import Review / Edit UI (v0 fixture, mock intake) - #47

Closed
guilaile95 wants to merge 1 commit into
ackness:mainfrom
guilaile95:dongfang/world-import-review-ui
Closed

feat(web): World Import Review / Edit UI (v0 fixture, mock intake)#47
guilaile95 wants to merge 1 commit into
ackness:mainfrom
guilaile95:dongfang/world-import-review-ui

Conversation

@guilaile95

Copy link
Copy Markdown

Summary / 摘要

Implements the Dongfang World Import Review / Edit UI: the owner-facing gate between AI world extraction and the approved WorldImportDraft. The owner must be able to see what was extracted, where each entry came from, and resolve conflicts before approving.

  • New route /world-import-review (lazy-loaded, no changes to the existing nav system).
  • Fixed WorldImportDraft v0 contract encoded as Zod schemas (apps/web/src/features/world-import-review/types.ts); all external input (fixture, saved drafts) is validated on load.
  • Overview with per-category counts and filtering across 人物/势力/地点/物品/规则/力量体系/事件/关系; every entry visibly shows 原文支持 / AI 推断 / 存在冲突 provenance.
  • Entry editor: rename, alias add/remove, content edit, source locator viewer (source title + locator + quote), accept AI inference, delete AI inference (confirm-guarded), edit conflict notes, mark conflict resolved.
  • Every content edit stamps userEdited = true.
  • Draft persistence in a small dedicated Dexie DB (covel-world-import-review) → save / reopen / refresh keeps all data. Reopen prefers the saved draft and falls back to the fixture.
  • Export button downloads the approved draft as JSON (world-import-draft-<id>.json), with an unresolved-conflict warning.
  • Intake is a mock seam (draft-service.ts serving the frozen v0 fixture) so this branch does not depend on the extraction pipeline.
  • Fixture: fixture/world-import-draft-v0.json with 9 representative entries covering all 8 categories and all 3 provenance statuses (source-backed character, aliased character, AI-inferred faction, conflicting rule, location, item, power system, event, AI-inferred relation). Content is UI-development placeholder, not canon.
  • Bilingual i18n (zh-CN / en-US) under worldImport.*; fixture content lives in a JSON data file, UI strings go through i18next (passes check:i18n).

Two additive optional fields extend the fixed contract for review decisions that must survive reopen (documented in types.ts): aiAccepted? (owner accepted an AI-inferred entry) and conflictResolved? (owner marked a conflict resolved). Everything else follows the contract exactly.

Type of change / 变更类型

  • New feature / 新功能 (feat)

Verification / 验证方式

  • pnpm lint (tsc + tailwind canonical, clean)
  • pnpm test — full @covel/web suite: 104 files / 650 tests passed (24 new)
  • pnpm e2e (not run; covered by component-level flow tests)
  • Manual check / 手动验证: real-browser walk-through of the full loop on the dev server — load fixture → browse categories → open entry → view source locators → edit (userEdited stamped) → accept AI inference → delete AI inference (confirm dialog) → resolve conflict → save → refresh → all data persists (verified on two fresh origins) → export JSON (payload contains aiAccepted / conflictResolved decisions). Screenshots: devs/docs/review-ui-screenshots/ (local, gitignored).
  • New tests (24): schema parsing (fixture acceptance/rejection), pure draft transitions, Dexie store round-trip incl. corrupted-record rejection, and a component-level review-flow suite covering load/filter/edit/accept/delete/resolve/save/reopen/reset.

Baseline: branch cut at ackness/covel@15f009d50d73ca985852bdb00322dcc721f56b6e (exact frozen baseline).

Related issue / context / 关联

Dongfang v1 work-stream C (World Import Review UI), developed against the fixed WorldImportDraft v0 contract; intake seam ready to be swapped for the real extraction pipeline handoff.

Docs sync / 文档同步

  • No framework-visible contract changed (feature-local module; no docs/reference/ update required)

Owner-facing gate between AI world extraction and the approved
WorldImportDraft: category-filtered overview, per-entry provenance
(source-backed / AI-inferred / conflict), source locators, alias and
content editing with userEdited stamping, AI accept/delete, conflict
resolution, Dexie-backed draft save/reopen, and JSON export.

Served at /world-import-review on a frozen representative fixture
(mock intake seam, no dependency on the extraction pipeline).
Additive optional fields aiAccepted/conflictResolved persist review
decisions across reopen; everything else follows the fixed v0 contract.
@guilaile95 guilaile95 closed this Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant