Skip to content

feat: watch/unwatch triggers, button convention flip, macro-agnostic StoryInit#36

Merged
rohal12 merged 1 commit intomainfrom
feat/watch-triggers
Mar 8, 2026
Merged

feat: watch/unwatch triggers, button convention flip, macro-agnostic StoryInit#36
rohal12 merged 1 commit intomainfrom
feat/watch-triggers

Conversation

@rohal12
Copy link
Owner

@rohal12 rohal12 commented Mar 8, 2026

Summary

  • Watch/Unwatch system: Edge-triggered {watch}/{unwatch} macros and Story.watch()/Story.unwatch() JS API for reactive triggers (dialog, goto, run actions)
  • Button convention flip: Label in opening tag args (with interpolation), executable macros ({set}, {do}, etc.) in the body
  • Macro-agnostic StoryInit: Replaced hand-rolled walkAndExecute with detached Preact render — any macro (including custom ones) now works in StoryInit
  • E2e auto-build: Added globalSetup to e2e config so story.html is always freshly compiled before tests

Test plan

  • 673 unit tests pass
  • 186 e2e tests pass (including 4 new watch trigger tests)
  • TypeScript compiles cleanly

release-npm

🤖 Generated with Claude Code

…StoryInit

- Add edge-triggered {watch}/{unwatch} macros and Story.watch()/unwatch() API
- Flip button/dialog convention: label in args, executable macros in body
- Make StoryInit macro-agnostic via detached Preact render (no special cases)
- Auto-build story.html before e2e tests via globalSetup
- Button/link children execute through normal Preact pipeline on click

release-npm

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 8, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 71.45% 1855 / 2596
🔵 Statements 70.61% 2033 / 2879
🔵 Functions 64.73% 347 / 536
🔵 Branches 62.13% 927 / 1492
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/index.tsx 0% 0% 0% 0% 20-170
src/store.ts 90.39% 81.69% 85.45% 91.9% 81, 115, 246-247, 302, 311-314, 345-350, 442, 476, 496-499, 513, 517-520
src/story-api.ts 2.12% 0% 4% 2.24% 91-320
src/story-init.ts 100% 100% 100% 100%
src/triggers.ts 12.32% 0% 6.25% 14.51% 32-92, 99-136, 147-160
src/components/App.tsx 0% 0% 0% 0% 4-32
src/components/TriggerDialogHost.tsx 0% 0% 0% 0% 7-40
src/components/macros/Button.tsx 100% 66.66% 100% 100%
src/components/macros/Dialog.tsx 25% 0% 0% 25% 8-28
src/components/macros/MacroLink.tsx 84.61% 69.23% 80% 84.61% 28, 71-73
src/components/macros/Watch.tsx 4.87% 0% 0% 5.12% 8-57, 64-73
Generated in workflow #95 for commit a30758e by the Vitest Coverage Report Action

@rohal12 rohal12 merged commit b3e3e53 into main Mar 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant