Repository navigation
studio-agent: an agent edit flashes and scrolls to where it landed; the prompt box grows with the text - #255
Merged
Conversation
…he prompt box grows with the text Every agent write to the song, synth and shader editors (set_*, edit_*, run_script, auto_master) now goes through writeEditor(): only the span that changed is replaced (scroll position kept, one undo step per edit), the editor scrolls to those lines and they flash, fading out over 1.6 s. The prompt textarea grows with what is typed, from its 2-row height up to 40vh, then scrolls; it goes back to 2 rows after a send. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying webassemblymusic with
|
| Latest commit: |
3ba0b07
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://556371ac.webassemblymusic.pages.dev |
| Branch Preview URL: | https://studio-agent-edit-flash.webassemblymusic.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the agent edits the code, nothing in the editor shows where. Each write called
doc.setValue(), which replaces the whole document and loses the scroll position. Someone watching (on stage, or in a session video) sees the code change but not which part.The prompt box was also a fixed 2 rows, so a longer instruction scrolled out of view while it was being typed.
Change
Agent edits flash and scroll into view. Every agent write to the song, synth and shader editors (
set_*,edit_*,run_scriptwrites,auto_master) goes throughwriteEditor()inclient.js:replaceRange), so the editor keeps its scroll position and each agent edit is one undo step;The diff is a pure function,
changedSpan()intools-core.js, with unit tests. Faust edits are not covered: they reach the faust editor through the file list, not through these writes.The prompt box grows with the text. It starts at its 2-row height, grows as you type up to 40vh, then scrolls, and goes back to 2 rows after a send.
Testing
npm run test-agent-tools: 160/160 pass, including the newchangedSpantests.tools/session-videoat phone width: the flash and scroll follow each edit down the song, and the long prompts wrap in the growing box.🤖 Generated with Claude Code