Commit Graph

63 Commits

Author SHA1 Message Date
yaroslav k
cc57da0d83 e2e: ignore node_modules and playwright artifacts 2026-08-16 11:50:51 +03:00
yaroslav k
9c4d95220d docs: mark Phase 1 done; sync architecture, modernize, readme
- ROADMAP: all Phase 1 boxes checked, done-notes added
- MODERNIZE: serde item marked APPLIED (persistence uses the derives)
- ARCHITECTURE: persist module + modal in the component tree, gaps list
  updated (persistence no longer a gap)
- README: header buttons + autosave in 'What works today', tests section
  describes both specs, playwright command pins the chromium project
2026-08-16 11:50:41 +03:00
yaroslav k
cc11700621 e2e: persistence tests, verified against a live server
- campaign name survives a reload (autosave debounce respected)
- export/import round trip: Save downloads dashboard.json with the
  current state, Clear blanks it via the confirm modal, Load restores it
- specs take BASE_URL env override (default stays localhost:3000)
- both new tests and the three smoke tests pass on chromium
2026-08-16 11:49:00 +03:00
yaroslav k
b9a399be64 header: Save/Load/Clear buttons wired to persistence
Save downloads dashboard.json, Load opens a file picker and imports
through apply_import with errors reported in the modal, Clear asks for
confirmation then wipes to Dashboard::blank(). App provides the store
and ModalState and mounts the modal; init_hydrated starts autosave.
2026-08-16 11:28:19 +03:00
yaroslav k
0c2eda7621 modal: in-app dialog for confirms and import errors
ModalState carries title/message/action as RwSignals; the action is
read at click time so a late confirm wins. Overlay click and Cancel
close; the confirm button runs the stored action. Edition-2024 note:
method calls on non-Copy captures move by value inside nested move
closures, so handlers touch state.open/state.action fields directly.
2026-08-16 11:28:19 +03:00
yaroslav k
043977cc1f persist: localStorage autosave + JSON export/import engine
- STORAGE_KEY aex.dashboard, 500 ms debounced autosave via store.track()
- deferred load after hydration keeps SSR markup authoritative
- parse_dashboard version-checks the file (the migration hook), errors
  are RU messages via ImportError (thiserror)
- clear writes the blank dashboard back so a reload stays blank
- export_download builds a Blob URL and revokes it after the click
- 5 unit tests: round trip, blank, garbage, newer and older versions
2026-08-16 11:28:19 +03:00
yaroslav k
0409d8edad add web-sys as a direct dependency
Needed for localStorage, FileReader and Blob download in the client.
The features were already enabled transitively by leptos-use; this
makes the dependency explicit.
2026-08-16 11:28:19 +03:00
yaroslav k
f3b0ceb3e7 derive serde on all persisted entities; add Settings.version and Dashboard::blank
Store and serde derives coexist on all 23 dashboard types (prototype
confirmed). Settings carries the saved-format version (1) as the
migration hook anchor; Dashboard::blank() is the post-Clear empty
campaign. mock() now builds Settings via Default.
2026-08-15 15:14:43 +03:00
yaroslav k
a11e86e839 update docs for phase 0 completion
ARCHITECTURE: LazyLock, tracked Cargo.lock, dedup'd foundry.json, warnings
cleared. ROADMAP: phase 0 checkboxes closed; MODERNIZE: lazy_static marked
applied, rest pending.
2026-08-15 14:58:01 +03:00
yaroslav k
8bdf1c9be3 rewrite README; replace example e2e spec with a smoke test
README is now project-specific (features, stack, dev commands, docs).
The Playwright spec checks home/inventories/wiki render and asserts no
console errors.
2026-08-15 14:57:35 +03:00
yaroslav k
6a07bd668d clear all compiler warnings
Remove unused imports (nav, sidebar, state, mock, inventory, item,
numput), the unused qty closure, the unused #![feature] gate, and a
module-scoped allow(dead_code) for the unmounted search stubs.
2026-08-15 14:56:57 +03:00
yaroslav k
444f046990 replace lazy_static with std::sync::LazyLock; commit Cargo.lock
lazy_static removed from Cargo.toml (the only dependency removal for
now, per decision). ITEMS_REFS/ITEMS_NAMES are now LazyLock statics; the
duplicate foundry.json load is dropped and the no-op HashMap roundtrip
is gone. Cargo.lock is now tracked: the app is a binary and builds
should be reproducible.
2026-08-15 14:56:54 +03:00
yaroslav k
6b792734b6 note kept dependencies in MODERNIZE.md and ROADMAP
itertools, thiserror, anyhow, pretty_env_logger, dotenvy stay for
certain; the rest of the unused-dependency list is under consideration.
2026-08-04 14:53:52 +03:00
yaroslav k
af60019fa2 add MODERNIZE.md: dependency and idiom cleanup list
Verified dependency reductions (13 unused or replaceable crates) and
idiomatic cleanups for the current codebase. Not applied yet; linked from
ROADMAP phase 0. Toolchain stays on nightly.
2026-08-04 09:39:37 +03:00
yaroslav k
ec4e771792 add ARCHITECTURE.md: concise overview of the codebase
State model (Store<Dashboard> via context), bundled item data, SSR/hydrate
pipeline, component tree, conventions, and current gaps.
2026-08-04 09:21:25 +03:00
yaroslav k
257f254b13 document every function, trait and struct in src/
Doc comments on all modules, components, entities, helpers and type
aliases; larger comments on the important entities (Dashboard, PlayerData,
Context, App, Numput, item data). No behavior changes.
2026-08-04 09:21:25 +03:00
yaroslav k
da405758ce add ROADMAP.md: phased plan to MVP
Covers full campaign dashboard scope (character, inventory, quests,
notes, contacts, wiki) with localStorage + export/import persistence.
Phases 0-8 with acceptance criteria and effort estimates.
2026-08-04 09:13:51 +03:00
yaroslav k
8eee42c6dd bump leptos to 0.8.20
- leptos 0.8.2 -> 0.8.20, meta/router/actix to latest 0.8.x
- reactive_stores 0.2.5 -> 0.4.3 (matches reactive_graph used by leptos 0.8.20)
- wasm-bindgen =0.2.101 -> =0.2.126, js-sys =0.3.78 -> =0.3.103

Fixes the build with the current nightly (tachys 0.2.18 no longer
needs the re-gated min_adt_const_params feature).
2026-08-04 06:40:38 +03:00
YK
6c7ba86018 item rendering, custom numput components 2025-09-23 15:44:06 +03:00
YK
c38fe1e3bc remove tyolka 2025-09-23 15:37:56 +03:00
YK
38c6c7bb78 <Inventory/> component, basic markup + styles, balance (with <Numput>) 2025-09-20 11:08:03 +03:00
YK
b581802c32 styles 2025-09-20 11:06:55 +03:00
YK
0620207877 basic routing, <Nav> component 2025-09-20 11:06:39 +03:00
YK
ae1193e6ce proper import spacing 2025-09-20 11:04:51 +03:00
YK
c54ca148f5 Numput component: custom number <input /> with relative value changes 2025-09-20 11:02:11 +03:00
YK
94befe3cd1 feature flag 2025-09-20 11:00:16 +03:00
YK
63da2898e1 reorder services 2025-09-20 11:00:10 +03:00
YK
2e742629dd InventoryKind entity definition and Display impl 2025-09-20 10:59:52 +03:00
YK
8471deef8c deps 2025-09-20 10:59:05 +03:00
YK
377051cf4f assets 2025-09-20 10:58:50 +03:00
YK
ce0365963a add missing component 2025-09-13 17:02:00 +03:00
YK
4b45e33cea refactor: extract all sidebar blocks into separate modules/components 2025-09-13 16:54:10 +03:00
YK
17fba36476 chore: add entities generated fields to prelude, fix imports / # 2025-09-13 16:53:48 +03:00
YK
5870ec2def css: change dst reset button appearance 2025-09-13 16:50:14 +03:00
YK
05563c18ec sidebar part 4: spell slot block 2025-09-13 16:28:44 +03:00
YK
ef5fb1dfa2 expand header 2025-09-13 16:28:33 +03:00
YK
260dbc6b27 css fix 2025-09-13 16:05:48 +03:00
YK
8f1ec42e48 dst reset button functionality 2025-09-13 12:58:15 +03:00
YK
e956e986fb todo 2025-09-13 12:57:50 +03:00
YK
809e13ce06 fix heading 2025-09-13 12:48:40 +03:00
YK
4e232e97e0 sidebar part 3: death save throws block 2025-09-13 12:48:01 +03:00
YK
fc13befcfb font experiments 2025-09-13 12:47:31 +03:00
YK
697e7db055 make return type for closure explicit 2025-09-13 12:47:16 +03:00
YK
1c0c0a2b5f sidebar part 2: hit dice block 2025-09-13 11:53:59 +03:00
YK
5fa38ad67d remove unused mixin/font 2025-09-13 11:53:21 +03:00
YK
9a820583a7 set min field on number inputs 2025-09-13 10:09:42 +03:00
YK
f13db5cd9f update entities defs 2025-09-13 10:09:20 +03:00
YK
37f2232af1 sidebar part 1: character image, name, class, level, xp, hp 2025-09-12 11:44:55 +03:00
YK
9c211d46de remove debug code, fix <input> tag 2025-09-12 10:21:25 +03:00
YK
58879c7463 update entity defs, Name struct, mock data updated 2025-09-12 10:20:59 +03:00