Commit graph

146 commits

Author SHA1 Message Date
Uglyboy
078e389803 chore(deps): upgrade dependencies and clean up dev dependencies
- Upgrade @inkweave packages to ^1.3.2
- Upgrade dev dependencies (vite, vitest, jsdom, @types/node)
- Remove unused eslint dependencies and esbuild
- Update bun.lock with new dependency versions
2026-04-08 08:59:04 +08:00
Uglyboy
1d3e647453 chore(ci): update release workflow to use release notes from changelog 2026-03-31 13:06:42 +08:00
Uglyboy
7401024a64 chore(changelog): regenerate with correct tag references 2026-03-31 12:59:16 +08:00
InkWeave Bot
9e77df9e3f chore(release): v2.0.1 2026-03-31 12:09:49 +08:00
Uglyboy
c6cbf66243 fix(ci): upgrade Node.js to 22.x in release workflow 2026-03-31 12:09:19 +08:00
InkWeave Bot
7780393630 chore(release): v2.0.0 2026-03-31 12:06:38 +08:00
Uglyboy
a2336a6f94 fix(release): correct branch name in release script 2026-03-31 12:06:15 +08:00
Uglyboy
868c9eb182 Merge branch 'refactor/inkweave-rename' 2026-03-31 12:00:37 +08:00
Uglyboy
6dabc3a3ed chore(release): add release automation scripts and changelog
- Add changelog generation script (scripts/changelog.mjs)
- Add release automation script (scripts/release.mjs)
- Add CHANGELOG.md with project history
- Update package.json scripts for release workflow
2026-03-31 11:58:01 +08:00
Uglyboy
7642fb4239 chore(deps): update dependencies and package structure 2026-03-31 11:25:35 +08:00
Uglyboy
0bc22e7ac1 refactor(components): refactor InkWeave components 2026-03-31 11:25:23 +08:00
Uglyboy
99af3b6e38 refactor(utils): refactor utility functions and compiler 2026-03-31 11:25:23 +08:00
Uglyboy
bcc7ddcc1d refactor(settings): refactor settings system with separate tab 2026-03-31 11:25:23 +08:00
Uglyboy
3e5cdef742 feat(autosave): implement automatic save and restore functionality 2026-03-31 11:25:23 +08:00
Uglyboy
b56993104c feat(commands): add command system 2026-03-31 11:25:23 +08:00
Uglyboy
17cfafb071 refactor(styles): refactor styles to modular css 2026-03-31 11:25:23 +08:00
Uglyboy
819c7a4140 docs(i18n): update translation files 2026-03-31 11:25:23 +08:00
Uglyboy
d66edc729e test(mocks): update obsidian mock for testing 2026-03-31 11:25:23 +08:00
Uglyboy
16c87eaa7d chore(tooling): replace eslint with biome 2026-03-31 11:11:38 +08:00
Uglyboy
d5749875a7 chore(build): migrate from esbuild to vite 2026-03-31 11:11:29 +08:00
Uglyboy
6de9a0c44b docs(i18n): add autosave slot translation keys
- Add 'modal_autosave_slot' key to all language files
- Update English, Polish, and Chinese translations
2026-03-27 21:13:12 +08:00
Uglyboy
a87c00bf4b refactor(session): remove legacy session restore flag and logic
- Remove SESSION_RESTORE_FLAG constant
- Clean up localStorage session restore logic
- Update compiler to remove session flag handling
2026-03-27 21:13:02 +08:00
Uglyboy
0521c87b2c feat(autosave): implement automatic save and restore functionality
- 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
2026-03-27 21:12:51 +08:00
Uglyboy
6882f32c28 chore(tests): remove legacy test file
- Delete session-persistence.test.ts as it's no longer compatible
- Test suite will be updated in future commits for @inkweave architecture
2026-03-27 14:57:23 +08:00
Uglyboy
c7f6ad2f18 style(css): update styles for InkWeave components
- Adapt CSS styles for new InkWeave component structure
- Update class names and selectors for compatibility
- Maintain visual consistency with new architecture
2026-03-27 14:56:54 +08:00
Uglyboy
44cc256012 refactor(utils): migrate to @inkweave utilities
- 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
2026-03-27 14:56:44 +08:00
Uglyboy
0ce41644cb feat(components): add InkWeave components
- Add InkWeaveMenu.tsx for story menu functionality
- Add InkWeaveMenuModal.tsx for modal interactions
- Add InkWeavePlayer.tsx as main player component using @inkweave/react
2026-03-27 14:56:32 +08:00
Uglyboy
61abf43b9e refactor(components): remove legacy Ink components
- Delete Ink.tsx, InkChoices.tsx, InkContents.tsx, InkImage.tsx
- Delete InkMenu.tsx, InkMenuModal.tsx, InkStory.tsx
- Update components/index.ts exports
2026-03-27 14:56:21 +08:00
Uglyboy
7502722c2f refactor(core): migrate plugin architecture to @inkweave
- 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
2026-03-27 14:56:09 +08:00
Uglyboy
c8ed42f421 chore(deps): migrate to @inkweave libraries
- Add @inkweave/core, @inkweave/react, @inkweave/plugins dependencies
- Remove custom inkjs implementation dependencies
- Update TypeScript configuration
- Add bun.lock for dependency management
2026-03-27 14:55:58 +08:00
Uglyboy
7ceae90727 chore(manifest): bump version to 1.2.1 2026-03-23 16:24:32 +08:00
Uglyboy
4088415822 style(i18n): unify tag format in translations 2026-03-23 15:25:29 +08:00
Uglyboy
65122fb339 refactor(plugin): improve markdown content reading logic 2026-03-23 15:25:21 +08:00
Uglyboy
0753e92804 style(error-message): unify error message dash format 2026-03-23 15:25:12 +08:00
Uglyboy
d49556a2be perf(ink-story): prevent duplicate initialization with useRef 2026-03-23 15:25:04 +08:00
Uglyboy
a47b7df5e2 refactor(session): extract SESSION_RESTORE_FLAG constant 2026-03-23 15:24:56 +08:00
Uglyboy
7cadb3cb74 refactor(constants): rename INK_DIVIDER to CHOICE_SEPARATOR for clarity 2026-03-23 15:24:47 +08:00
Uglyboy
4f05a0734f Merge PR #4 2026-03-23 14:53:57 +08:00
Uglyboy
21edc363db Merge commit 'refs/pull/3/head' 2026-03-23 14:52:44 +08:00
Uglyboy
d02fc60228 Merge commit 'refs/pull/2/head' 2026-03-23 14:52:29 +08:00
Uglyboy
09a1c97f26 Merge origin/master into feat/ui-modal 2026-03-23 13:45:22 +08:00
田陆
d40acb43ff
Merge pull request #2 from Jabuk/feat/i18n
feat(i18n): add Polish locale, restyle choices, fix locale issues
2026-03-23 13:43:27 +08:00
田陆
5e7c32f8ad
Merge pull request #1 from Jabuk/fix/activation
fix: resolve intermittent ink story activation failures
2026-03-23 13:43:25 +08:00
Yabuk
6bdd2cee63 fix(deps): bump @types/node to ^20.0.0 for vitest 4.x compatibility
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>
2026-03-23 01:27:12 +01:00
Yabuk
ad1261e134 test(session): add full simulation round-trip and real useStory tests
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>
2026-03-23 01:23:27 +01:00
Yabuk
61c6628cda fix(session): prevent double compiledStory() race in view.setState()
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>
2026-03-23 01:23:27 +01:00
Yabuk
22f11bbfec fix(session): use useContents.subscribe() for reliable auto-save
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>
2026-03-23 01:23:27 +01:00
Yabuk
c412855046 feat: session persistence, modal UX fixes, storage bugfixes
- 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>
2026-03-23 01:23:27 +01:00
Yabuk
175d7af698 fix(ui): rewrite save/restore modal with custom styles
- Replace Obsidian modal classes with fully custom ink-modal CSS
- Add visible close button (✕) with hover effect
- Fix scroll: height fit-content, overflow hidden
- Fix header/title styling via Obsidian CSS variables
- Add modal_* i18n keys to EN, PL, ZH locales

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 01:23:27 +01:00
Yabuk
1657a37c79 feat(i18n): add Polish locale, improve EN/ZH settings descriptions
- 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>
2026-03-23 01:23:27 +01:00