Repository navigation
Add a pause/play toggle for automatic rendering in the repl - #2281
Conversation
The toolbar gets a pause button. While paused (`?autorender=off`), edits do not compile, and a Render button compiles the current text on demand. The paused state lives in the URL, so shared links and embeds keep it. The output input comes from reactiveweb's keepLatest, which holds the last rendered file while paused. reactiveweb 1.9.4 fixes keepLatest dropping its initial value, which a page that loads paused needs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
|
Footnotes
|
| #seenRenderRequests = -1; | ||
|
|
||
| render = () => { | ||
| this.renderRequests++; |
There was a problem hiding this comment.
never do this, this is stupid
There was a problem hiding this comment.
Removed in c90cacd. The Render button now stores a snapshot of the text and format in pausedFile, and the output reads that snapshot while paused.
| @use renderInput = keepLatest({ | ||
| when: () => !this.autoRender, | ||
| value: () => { | ||
| if (!this.autoRender && this.renderRequests === this.#seenRenderRequests) { |
There was a problem hiding this comment.
we don't need to check render requests at all
There was a problem hiding this comment.
Removed in c90cacd, together with keepLatest. renderInput is now this.pausedFile ?? <current file>. The first edit after a Render click no longer compiles again, so that test is a normal test now.
The Render button and the pause now store the current text and format in `pausedFile`. While paused, the output reads that snapshot, so edits do not invalidate it. This replaces the `renderRequests` counter and `keepLatest`. The first edit after a Render click no longer compiles the same text again, so that test is no longer a QUnit `todo`. Without `keepLatest`, the repl does not need reactiveweb 1.9.4, so the dependency bump is reverted. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Adds a pause button to the editor toolbar. While paused, edits do not compile the output. A Render button, shown only while paused, compiles the current text on demand. Automatic rendering stays the default.
?autorender=off, so shared links and embeds keep it. A page that loads paused still renders once.editor.pausedFile, a snapshot of the text and format. The pause and each Render click set it, so edits do not invalidate the output.Tests: new
tests/application/auto-render-test.gts(6 pass). The fullapps/replsuite passes: 73 pass, 7 skipped.🤖 Generated with Claude Code