Skip to content

fix: preserve renderDeferred set during beforerestart handler#127

Merged
rohal12 merged 1 commit into
mainfrom
fix/126-preserve-renderdeferred-on-restart
Mar 26, 2026
Merged

fix: preserve renderDeferred set during beforerestart handler#127
rohal12 merged 1 commit into
mainfrom
fix/126-preserve-renderdeferred-on-restart

Conversation

@rohal12

@rohal12 rohal12 commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • restart() unconditionally set renderDeferred = false, overriding any Story.deferRender() call made in a beforerestart handler
  • Now resets renderDeferred before firing callbacks, then checks if a handler set it back to true and preserves that state through the restart
  • Enables the deferred-render pattern for async restart workflows (e.g. showing StoryLoading while an engine rebuilds)

Closes #126

Test plan

  • New test: restart() preserves renderDeferred if set during beforerestart
  • Existing test: restart() resets renderDeferred to false (no handler) still passes
  • Full suite: 1025 tests pass
  • Type check clean

🤖 Generated with Claude Code

restart() unconditionally reset renderDeferred to false, overriding any
Story.deferRender() call made in a beforerestart handler. Now resets
renderDeferred before firing callbacks so it can detect if a handler
set it back to true, and preserves that state through the restart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Release preview: merging this PR will publish v0.39.1 (patch bump from v0.39.0)

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.48% 2725 / 3517
🔵 Statements 76.58% 2986 / 3899
🔵 Functions 68.21% 500 / 733
🔵 Branches 73.79% 1501 / 2034
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/store.ts 79.74% 72.16% 72.04% 81.56% 90, 124, 313-314, 377, 386-389, 420-425, 517, 565, 588-591, 605, 609-612, 624-696
Generated in workflow #197 for commit 5e0cdbb by the Vitest Coverage Report Action

@rohal12 rohal12 merged commit 70a028d into main Mar 26, 2026
5 checks passed
@rohal12 rohal12 deleted the fix/126-preserve-renderdeferred-on-restart branch March 26, 2026 10:37
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.

restart() should not override renderDeferred set in beforerestart

1 participant