Repository navigation
feat(web): copy and add notes on text selected in agent pages - #1063
Merged
Merged
Conversation
Selecting text in an agent page did nothing, while chat text gets the Copy / Add note bar. Pages run in a sealed frame, so the app cannot see a selection inside one. The page bootstrap now reports the reader's selection (text, its box cut to the page's own scroll boxes, and the page's viewport width) after the reader's own click or key, again on scroll and resize, and when it is gone. The transcript selection layer places the bar from that report, inside the chat and in the page's full-size view at any zoom. A report only opens the bar while the reader is in that page and window, and a click with nothing selected in any page closes it, as a click elsewhere in the chat does. Highlights gain a "page" source: the prompt names the page by the id show_page gave the agent, and saved drafts accept it. Escape anywhere in the note form closes only the note, and the full-size view keeps the page mounted behind Source so a note being written survives.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This branch was previously deployed
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.
Selecting text in an agent page (a show_page page) did nothing, while text in the chat gets the Copy / Add note bar. Pages run in a sealed frame, so the app can't see a selection inside one.
How it works now:
pagesource. The prompt block names the page by the id show_page gave the agent (- page <pageId>), and saved drafts accept it. Older drafts still load.Known gap: selecting in a page within about 1.5s of typing in the app shows no bar. AgentPageFrame's focus guard treats that as the page taking focus and hands focus back. This is left as is on purpose.
Tests: new browser tests in
AgentPageFrame.browser.tsxcover inline and full-size selection, zoom, a page's forged report, clicking into a second page, Escape on the note buttons, and Source keeping the note. There's also a prompt round-trip case intranscriptHighlightContext.test.ts. The existing transcript selection browser tests still pass.