Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused desktop preview bug fix that moves annotation keyboard handling into the preload phase so inspected-page shortcuts cannot consume overlay input. The change is isolated, tested, and does not alter schemas, defaults, deployment behavior, or static-analysis configuration. You can add or adjust custom eligibility rules. Learn more. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
Addressed the synthetic-event concern in CodeRabbit's security review in e087d2e. I reproduced it in the Chromium harness: page JavaScript could dispatch Ctrl+Enter on the visible overlay host while the comment was focused and cause a send. Annotation actions now require The rebuilt preload ignored all four synthetic events without submitting or closing, then accepted a real Ctrl+Enter. All 26 focused tests, desktop typechecking, targeted lint and formatting pass. The PR description and reproduction archive include the follow-up verification. |
|
The failed Build and Typecheck job reported one error: Merged main in 83044d9 to include the upstream fix from #21274, which replaces the affected test's After syncing dependencies, desktop and web typechecks both pass. All 28 focused desktop tests, targeted lint, formatting, and |
|
Taking over this one. I’ll reduce the tests to the useful coverage, update the implementation against current main, and verify it before publishing the changes. |
Collapse the per-event-type and duplicated isolation cases into four behavior tests: overlay typing hidden from page shortcuts, submission with multiline and IME editing, page-dispatched events ignored, and Escape plus tool shortcuts outside the overlay. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d handler The keyboard helper now owns the AnnotationTool union and resolves tool shortcuts through a lookup instead of redeclaring the union in PickPreload and switching on keys. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The preload shares the inspected page's JavaScript realm, so a plain object lookup keyed by event.key also reads properties the page plants on Object.prototype. A page setting Object.prototype.x = "send" turned a genuine x key outside the overlay into a submission. Compare the four tool keys directly again and pin the inherited-property case in the existing outside-overlay test. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Typing an annotation in desktop Preview could lose spaces or ignore cursor movement when the inspected page handled those keys first. This moves annotation keyboard handling into the preload's early capture listeners, keeping normal editor defaults while isolating page shortcuts. Only trusted key events trigger keyboard actions, and teardown returns input to the page.
Based on @Lenoridev's original implementation in #20398. The takeover reduces the added tests to four behavioral cases, preserves contributor history, removes a prototype-sensitive shortcut lookup found during review, and integrates current main's viewport-cropping changes.
Fixes #20364.
Validation: 24 focused tests, desktop typecheck, scoped lint and formatting pass. Fresh full Opus and Sol reviews found no remaining source findings at d625e4d.
Native evidence was captured on d3b7e8b in a real Electron 44.4.5 webview running the complete production preload. The baseline produced
abcdX; the corrected preload preserved the intendedab Xcdand blocked page key handlers during editing. Native multiline/attach, Ctrl+Enter send gating, synthetic-action rejection, inherited-key protection, tools/focus, teardown and reload were exercised. The later merge changes only viewport crop bounds/comment in this preload; both reviewers accepted bounded reuse for the unchanged keyboard path.Reused native keyboard evidence: baseline 10b8682, corrected d3b7e8b. These captures are not executions of the final merged head.
ab XcdSupplemental native focus/teardown continuation at the same corrected proof head (2.67 seconds; not the baseline comparison):
Limits: this was a native preload fixture, not full-app verification. The final merged bundle and new cropping behavior were not executed; OS IME, macOS Cmd+Enter, full PreviewManager permissions/screenshots, composer persistence, real provider sending, network/relay and normal OS sandbox operation were not tested. The fixture used
--no-sandbox; its regenerated stylesheet differed by one extra.shadowutility. This change is not a security boundary against deliberately malicious code sharing the page's JavaScript realm.Current-head CI remains a landing gate.
Implemented with Claude Fable 5.1 in Claude Code; reviewed independently with Claude Opus 5.5 and GPT-6.1-Sol in Codex. Native evidence collected with GPT-6.1-Sol in Codex through T3 Code.