You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): Escape cancels a sidebar drag without leaving Pull Requests - #48036
Pressing Escape to cancel a sidebar thread drag on the standalone Pull Requests page also triggered the page's own Escape handler, so the app navigated away. The sidebar drag sensor now recognizes Escape by its logical key (so remapped keys work too), and when it cancels an active drag it claims the keypress so page-level Escape handlers leave it alone. Escape pressed outside an active drag still reaches the page as before.
Commit 52682d10f9 (main). The drag cancels and the app navigates back to the previous screen. Expected: The drag cancels and Pull Requests stays open.
Open the standalone Pull Requests page with no selection or dialog open.
Drag a sidebar thread past the sidebar edge without releasing it.
Press Escape.
The cause is at apps/web/src/components/Sidebar.pointer.ts:107. Ran pnpm scenarios:prove scripts/scenarios/sidebar-drag-escape-keeps-pull-requests-open.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean boat.dev VM, with expected false to be true in the output.
Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout on a boat.dev VM reset before each run.
The sidebar drag sensor cancelled the drag on Escape but left the key
unclaimed, so the Pull Requests page's Escape handler also navigated back.
An active drag now claims the key when Escape cancels it.
Co-authored-by: Claude Opus 5.5 <[email protected]>
Macroscope's review found this PR approvable — Escape now claims the key while cancelling an active drag, preventing page-level handlers from also navigating away. The change is limited to drag interaction handling and retains the existing cancellation cleanup.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 99b7468 and 0297bdb.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The sidebar pointer handler now identifies Escape by event.key and prevents its default action during an active drag before cancelling. Browser tests cover Escape handling across pointer states, and an end-to-end test checks that cancelling a drag keeps the Pull Requests page open.
Changes: Sidebar Escape drag cancellation
Layer / File(s)
Summary
Escape handling and lifecycle tests apps/web/src/components/Sidebar.pointer.ts, apps/web/src/components/Sidebar.pointer.browser.test.tsx, apps/web/src/components/Sidebar.drag.browser.test.tsx
The handler matches Escape using event.key and prevents its default action during an active drag before cancelling. Browser tests check Escape handling in pending, active-drag, and post-cancellation states.
The end-to-end scenario presses Escape during a sidebar thread drag, waits for the drag ghost to disappear, and checks that the pathname remains /pull-requests.
Pressing Escape during a sidebar thread drag now cancels only the drag and no longer navigates away from the Pull Requests page. Escape outside an active drag behaves as before. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: Escape now cancels an active sidebar thread drag without navigating away from the Pull Requests page. It follows the conventional commit format and matches the changes…
Description check
The description follows the template well. It has a Problem section (Escape on the Pull Requests page navigates away during a sidebar drag), a Change section (matches logical key and claims the keypre…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: Escape now cancels an active sidebar thread drag without navigating away from the Pull Requests page. It follows the conventional commit format and matches the changeset (Sidebar.pointer.ts keydown handling, the new lifecycle test, and the e2e scenario). It is 69 characters and 10 words, which is concise enough.
Full details: Description check
Explanation
The description follows the template well. It has a Problem section (Escape on the Pull Requests page navigates away during a sidebar drag), a Change section (matches logical key and claims the keypress during an active drag), a Scope note that describes a bug fix, and a detailed Verification section with before/after evidence, repro steps, and commit references. It also has the required model attribution. Minor gaps: the Scope section does not link a specific issue that shows the bug. It lists related issues (#43835, #24355, #40350, #40397, #44941) but does not say which one shows this bug, and it does not explain why no issue is needed. The Verification section says the Linux environment was used, which the template asks for. The Change section also does not say why the change needs no issue. The 'Who did the work' section and the 'Not in this change' note are extra but acceptable.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Seed demo and Release checklist through the real server with Replay (dev), open the thread then /pull-requests, press its sidebar row, move 150px then 450px right while holding the mouse, press Escape, release, and capture the resulting page.
Environment on both sides: web browser, 1440×900, light theme, isolated fresh databases, synthetic demo project, Replay (dev).
Scenario: Escape cancels a sidebar drag while keeping Pull Requests open
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
size:M30-99 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Pressing Escape to cancel a sidebar thread drag on the standalone Pull Requests page also triggered the page's own Escape handler, so the app navigated away. The sidebar drag sensor now recognizes Escape by its logical key (so remapped keys work too), and when it cancels an active drag it claims the keypress so page-level Escape handlers leave it alone. Escape pressed outside an active drag still reaches the page as before.
Related: #43835, #24355, #40350, #40397, #44941
Reproduction on main
Commit 52682d10f9 (main). The drag cancels and the app navigates back to the previous screen. Expected: The drag cancels and Pull Requests stays open.
The cause is at
apps/web/src/components/Sidebar.pointer.ts:107. Ranpnpm scenarios:prove scripts/scenarios/sidebar-drag-escape-keeps-pull-requests-open.e2e.ts --target webwith the repro scenario added: it failed in 2 of 2 runs on a clean boat.dev VM, withexpected false to be truein the output.Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout on a boat.dev VM reset before each run.
Proven: the repro fails at the test commit 30b1e7fddc and passes on the head 99b7468196, both on main 3fa429150c.
The drag cancels and the app navigates back to the previous screen.
The drag cancels and Pull Requests stays open.
Tests
pnpm exec vp run check:changed 3fa429150c7666e342d5b687df09b5f54dbaf652passed on head.Not in this change
Who did the work
Made in T3 Code by GPT 6.2 Sol and Claude Opus 5.5