docs: mark Phase 2 done; sync architecture, readme

- ROADMAP: all Phase 2 boxes checked; done-notes (HP block already in
  the sidebar; optional Spell fields keep old JSON parseable; rows are
  plain functions inside For's let children)
- ARCHITECTURE: character/*.rs in the tree, Character route contents,
  gaps list drops the character-page items
- README: character page in 'What works today'
This commit is contained in:
yaroslav k 2026-08-16 12:44:31 +03:00
parent 0fb9329916
commit 6d0846d160
3 changed files with 22 additions and 8 deletions

View File

@ -48,6 +48,8 @@ src/
inventory.rs One inventory section (rows + money) inventory.rs One inventory section (rows + money)
item.rs One inventory row item.rs One inventory row
numput.rs Numeric input components (Numput, NumputChange) numput.rs Numeric input components (Numput, NumputChange)
character/*.rs Character page: player_card, prepared_spells,
attunements
mod.rs Pages (Character, Inventories, Wiki) + item search mod.rs Pages (Character, Inventories, Wiki) + item search
``` ```
@ -113,7 +115,8 @@ App
│ └─ SpellSlots 9 levels of clickable pips │ └─ SpellSlots 9 levels of clickable pips
├─ Nav links to the three routes ├─ Nav links to the three routes
└─ Routes └─ Routes
├─ Character stub text ├─ Character player card; prepared spells (vacant/occupied
│ slots with free-text entry); attunements (3 slots)
├─ Inventories two Inventory sections (Personal/Common) ├─ Inventories two Inventory sections (Personal/Common)
│ └─ Inventory balance (5 × Numput), rows (ForEnumerate) │ └─ Inventory balance (5 × Numput), rows (ForEnumerate)
│ └─ Item name, quantity ±, weight ±, more/swap/remove │ └─ Item name, quantity ±, weight ±, more/swap/remove
@ -164,9 +167,8 @@ currently mounted on any page.
## Current gaps ## Current gaps
- Quests, notes, contacts: models and mock data only - Quests, notes, contacts: models and mock data only
- `Character` and `Wiki` pages render placeholders - `Wiki` page renders a placeholder
- Prepared spells list is empty; `Spell` is a name-only stub; attunements - `Settings` has only `version`
have no UI; `Settings` has only `version`
- The item "+"/"…" buttons are dead - The item "+"/"…" buttons are dead
- `foundry.json` was loaded twice (fixed); ~3.9 MB of JSON is bundled - `foundry.json` was loaded twice (fixed); ~3.9 MB of JSON is bundled
into the WASM and parsed on startup into the WASM and parsed on startup

View File

@ -10,6 +10,8 @@ game. The UI is in Russian.
wipe to a blank campaign wipe to a blank campaign
- Undo/redo: header buttons and Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y over - Undo/redo: header buttons and Ctrl+Z / Ctrl+Shift+Z / Ctrl+Y over
edit bursts; Clear and import are undoable too edit bursts; Clear and import are undoable too
- Character page: player card, prepared spells (free-text slots with
level/description) and attunements (3 slots, clearable)
- Character sidebar: portrait, names, class, level, XP, hit points with - Character sidebar: portrait, names, class, level, XP, hit points with
temp HP bar, hit dice, death saves, spell slots temp HP bar, hit dice, death saves, spell slots
- Inventories page (`/inv`): personal and party-common inventories, - Inventories page (`/inv`): personal and party-common inventories,

View File

@ -133,13 +133,23 @@ in chromium (buttons, shortcuts, reload, undoable Clear). Notes:
`/` currently renders the literal string "character". `/` currently renders the literal string "character".
- [ ] player card: portrait, name, class, level, XP (data already in sidebar) - [x] player card: portrait, name, class, level, XP (data already in sidebar)
- [ ] HP block: temp / current / max, `Numput`-style editing - [x] HP block: temp / current / max, `Numput`-style editing
- [ ] prepared spells UI: render Vacant/Occupied slots; free-text spell name entry - [x] prepared spells UI: render Vacant/Occupied slots; free-text spell name entry
(upgrade the `Spell` stub from `name`-only to name + optional level/description) (upgrade the `Spell` stub from `name`-only to name + optional level/description)
- [ ] attunements UI: 3 slots, free text, clear button (model exists) - [x] attunements UI: 3 slots, free text, clear button (model exists)
- **Acceptance:** player can set prepared spells and attunements; they persist. - **Acceptance:** player can set prepared spells and attunements; they persist.
**Done (2026-08-16):** page in `src/components/character/`; e2e-verified
in chromium (add/undo/redo a spell, remove, reload persistence, attunements
with clear). Notes:
- The HP block was already in the sidebar (`hit_points.rs`, editable
`type="number"` inputs via `utils::adjust_checked`) — nothing to add.
- `Spell` fields are optional, so name-only spells in old saved JSON
still parse.
- Rows are plain functions called from `For`'s `let(...)` children:
component tags are not allowed directly inside them (view macro).
## Phase 3 — Inventory & item search end-to-end (L, ~3-5 days) ## Phase 3 — Inventory & item search end-to-end (L, ~3-5 days)
Rows are editable and move/remove works. Search exists but is orphaned; "+" and Rows are editable and move/remove works. Search exists but is orphaned; "+" and