- Add autosave loading logic to InkWeavePlayer
- Extend save slots from 3 to 5 with autosave slot support
- Replace localStorage session restore with @inkweave/plugins memory module
- Update menu modal to handle autosave slot display
- Adapt CSS styles for new InkWeave component structure
- Update class names and selectors for compatibility
- Maintain visual consistency with new architecture
- Remove legacy hooks/ directory with custom implementations
- Remove legacy lib/ directory with custom ink parser and utilities
- Add new utils/ directory with compiler.ts, file.ts, error.ts
- Implement FileHandler and state management for @inkweave integration
- Add InkWeaveMenu.tsx for story menu functionality
- Add InkWeaveMenuModal.tsx for modal interactions
- Add InkWeavePlayer.tsx as main player component using @inkweave/react
- Update plugin.ts to use @inkweave/core and @inkweave/react
- Refactor view.ts for InkWeaveStoryView integration
- Update patches.ts to work with @inkweave plugins
- Modify main.ts entry point
vitest@4.x requires @types/node@^20 || ^22 || >=24.
The old ^16.11.6 constraint caused ERESOLVE in CI.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 tests total covering:
- useContents.subscribe mechanics
- Real plugin subscription (reads from useStory.getState().ink, not closure)
- Guards: no save when ink is null or filePath is empty
- memory.load() correctness
- Race condition documentation
- Full play→save→reload→restore simulation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: view.setState() entered its if-block before onLayoutReady fired,
hit `await vault.read()`, suspended; onLayoutReady then called activateView()
creating InkStory #1 which restored the session and cleared the restore flag;
when setState() resumed it called compiledStory() again, creating InkStory #2
which found no flag and called restart(), overwriting the session with the
beginning-of-story state.
Fix: after the await, check if ink.title already matches filePath (meaning
onLayoutReady already compiled the story) and skip compiledStory() if so.
Also adds 19 unit tests covering save/restore logic and documenting the race.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
onunload() is not reliably called on Obsidian "Reload app" (window.location.reload()),
so session state was never saved. Replace with a Zustand subscription that saves
session to localStorage after every content change.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Close save/restore modal immediately after selecting a slot
- Persist game state to localStorage on view close, restore on reload
(only on automatic reload, not on manual story activation)
- Fix save slots not persisting between sessions: default storage
changed from sessionStorage to localStorage
- Fix modal not updating after second save: always create new Map
reference in setStorage to properly trigger zustand re-renders
- Add onLayoutReady restore with session flag in plugin
- Add getState/setState to InkStoryView for workspace persistence
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add pl.json with full Polish translation
- Rewrite all English setting titles and descriptions for clarity
- Fill in missing descriptions and update Chinese translations to match
- Register Polish locale in i18n.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>