docs: update architecture and plan for tree inspector UI

Record the viewer-registry decision and refresh the extract/web
descriptions and repo layout.
This commit is contained in:
2026-08-08 12:19:47 +08:00
parent a8e84c8b9d
commit 08c767f399
3 changed files with 33 additions and 6 deletions
+13 -3
View File
@@ -78,7 +78,9 @@ tts-workshop/
│ │ ├── SearchPage.tsx
│ │ └── ModPage.tsx
│ ├── components/
│ │ ── SearchResults.tsx
│ │ ── SearchResults.tsx
│ │ ├── ObjectTree.tsx # containment-tree sidebar
│ │ └── viewers.tsx # viewer registry + default viewer
│ └── stores/
│ ├── searchStore.ts # zustand
│ └── modStore.ts # zustand
@@ -145,6 +147,9 @@ Isomorphic analysis of a parsed `TTSMod`. No Node-specific APIs.
- `flattenObjects(mod)` — all objects in the tree.
- `filterObjects(mod, predicate)` — filter by name, GUID, type, etc.
- `findObject(mod, guid)` — lookup by GUID.
- `buildTree(mod)` — containment tree (`{ object, label, children }`),
mirroring how TTS nests objects; `label` is `Nickname` when present,
else the class `Name`.
- `traverseMod` / `markParent` (moved from `tts`).
- Returns lightweight graph shapes: `{ guid, name, type, parentGuid,
childrenGuids, refs }`.
@@ -195,9 +200,14 @@ proxy API and `packages/extract` directly for analysis.
`modFileUrl` helper for the raw-file download.
- `pages/SearchPage.tsx` — search form, drives `searchStore`.
- `pages/ModPage.tsx` — loads the mod via `modStore`, uses `@tts/extract`
(`flattenObjects`, `collectRefs`) to render objects and asset refs, and links
to the raw save file.
(`buildTree`, `collectRefs`) to render a containment-tree sidebar and an
inspector pane for the selected object, and links to the raw save file.
- `components/SearchResults.tsx` — result grid + pagination.
- `components/ObjectTree.tsx` — recursive tree sidebar; each entry shows a
class tag + display label, indented by depth. Clicking selects an object.
- `components/viewers.tsx` — viewer registry (`registerViewer` /
`resolveViewer`) plus a `DefaultViewer` that renders an object's fields;
custom per-class viewers can be registered later.
- `stores/searchStore.ts` / `stores/modStore.ts` — Zustand stores for search
and mod state.
- `vite.config.ts` — dev proxy for `/search`, `/items`, `/health` →