Repository navigation
Conversation
…n editor `AgentView::route_paste` listed every input-less frame owner except the factory page, so a bracketed paste with the page open fell through to the editor hidden behind it and showed up in the prompt once the page closed. The factory page has no text input; it now consumes the paste like the other input-less owners.
This branch has not been 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.
A paste while the
/factorypage is open no longer goes into the prompt editor hidden behind the page.Bug
AgentView::route_paste(view.rs) routes a bracketed paste to whatever owns the frame.SessionUi::handle_pastepromises that a paste never lands in the hidden editor behind an overlay. But the input-less group inroute_pastewas missingfactory_view. So a paste with the factory page open fell through toview.editor.handle_paste. When the page closed, the text was sitting in the prompt.Fix
Add
factory_viewto the input-less group inroute_paste; the comment lists it too. The factory page has no text input: itshandle_keyonly moves the selection, opens, stops and resumes. So it consumes the paste like the heartbeats picker, bash view, goal and info panels do.Onboarding needs no change. Its pane runs its own input loop (
interactive/onboarding.rs), which handlesUiInput::Pasteitself, and it takesview.onboardingout while it waits.SessionUi::handle_pastenever runs while onboarding is shown.Test
New headless test
a_paste_on_the_factory_page_stays_out_of_the_hidden_editorincrates/pa-tui/tests/factory_command_headless.rs. It uses the file's existing page pattern:zq-stray-paste.Failing output on main (main code + this test, Prime sandbox):
Validation
All green in a Prime sandbox with toolchain 1.98.1:
cargo fmt --all --checkcargo clippy --workspace --all-targets -- -D warningscargo test -p pa-tui --no-fail-fastcargo build -p pa-cliOverlap
#3893 touches
view.rs; #3356 touches the factory view andkeys.rs. The production change here is one added condition inroute_paste. A follow-up refactor (stacked on this branch) replaces the overlayOptionfields with one enum.Note
Low Risk
Single guard in paste routing plus a regression test; no auth, data, or API surface changes.
Overview
Paste routing while
/factoryis open no longer leaks into the prompt editor behind the overlay.AgentView::route_pastenow treats an openfactory_viewlike other input-less frame owners (heartbeats picker, bash view, etc.) and consumes the paste instead of returningfalseand lettinghandle_pastefill the hidden editor.A headless test opens the factory page from the dock, pastes while it is visible, closes with Esc, and asserts the pasted text never appears in captured frames. The changes file records the user-facing fix.
Reviewed by Cursor Bugbot for commit a51a416. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix paste landing in hidden editor while /factory page is open
Adds the factory page to the set of input-less frame owners in
AgentView.route_pasteso a paste is consumed instead of falling through to the hidden prompt editor. Adds a headless test in factory_command_headless.rs that pastes on the factory page and asserts the text does not appear in captured frames. Includes a changeset entry.Macroscope summarized a51a416.