feat: select browser tabs explicitly and preserve pasted text - #11
Conversation
Keep input bound to the selected tab and require another selection after target loss. Preserve multiline pasted text until insertion is confirmed, without sending Enter to the page.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds explicit CDP tab selection, target-loss invalidation, target-aware input guards, and bracketed-paste support. It updates the renderer, adapter tests, integration tests, changelog, README, and readiness documentation. ChangesTarget selection and lifecycle
Literal input and validation
Priority: ⬇️ Low Estimated code review effort: 4 (Complex) | ~60 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Operator
participant Renderer
participant makeCdpBrowser
participant Chromium
Operator->>Renderer: open target picker
Renderer->>makeCdpBrowser: listTargets()
makeCdpBrowser->>Chromium: enumerate page targets
Chromium-->>makeCdpBrowser: target metadata
makeCdpBrowser-->>Renderer: selectable targets
Operator->>Renderer: select target
Renderer->>makeCdpBrowser: selectTarget(targetId)
makeCdpBrowser->>Chromium: attach selected target
Chromium-->>makeCdpBrowser: target_selected
makeCdpBrowser-->>Renderer: selected target state
Operator->>Renderer: paste literal text and press Enter
Renderer->>makeCdpBrowser: type(text)
makeCdpBrowser->>Chromium: insert text
Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking defect remains; the replacement-session race cannot occur through the implemented close path. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The Browser pane now selects attached and locally launched tabs from a title/URL picker. Closing or detaching the selected tab clears its image and pending text, drops queued input, and requires an explicit selection before input resumes. Selection stays bound to a stable target identity.
The text prompt preserves whitespace, Unicode, tabs, and multiline bracketed paste until insertion is confirmed. Insertion does not send Enter to the page. Shared agent-browser sessions retain their existing active-tab model and gain verbatim text insertion.
Validation
npm run validate: 331 passed, two expected skips.npm run test:integration: all three required real-browser tests passed.The streaming fixture now subscribes before navigating and includes event diagnostics after full-suite runs exposed missing initial frames. Multiline paste requires terminal bracketed-paste support.
Summary by CodeRabbit
New Features
Documentation