Skip to content

fix(web): Esc while resizing a spreadsheet column or row cancels without closing the sheet - #41790

Open
only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/web-spreadsheet-resize-escape-sheet
Open

only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/web-spreadsheet-resize-escape-sheet

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Pressing Esc while dragging a spreadsheet column or row border cancels the resize, but it also closes the whole Files sheet (or the attachment preview dialog). The grid's Escape handler called preventDefault() but let the key bubble to the sheet's document-level dismiss listener, which does not check defaultPrevented. The pointer capture taken for the drag was also never released.

The handler now stops the Escape there and releases the pointer capture. Like #41749, a held Escape's repeated keydowns no longer close the sheet either. A fresh Esc after the resize ends still closes it.

Testing

Setup: Linux, Chromium (T3 Browser panel), light theme, 900×700 viewport so the Files panel opens as a sheet, fresh isolated dev data (vp run dev --no-seed) with a synthetic budget.xlsx on each commit.

Steps: Open Files → open budget.xlsx → press on the right edge of the column A header and drag right → press Esc

784da01 (base) 27975fb (head)
Base 784da01b29: dragging column A's border shows the resize guide Head 27975fb8cc: dragging column A's border shows the resize guide
Dragging column A's border shows the resize guide Dragging column A's border shows the resize guide
Base 784da01b29: Esc closes the whole Files sheet Head 27975fb8cc: Esc cancels the resize and the Files sheet stays open
Esc closes the whole Files sheet Esc cancels the resize and the Files sheet stays open

On head, a second Esc closes the sheet.

An AI agent (Claude Opus 5.5, T3 Code) ran:

  • vp test run apps/web/src/components/files/office/sheet-resize.browser.test.ts: the new test fails on base (the sheet closes on the first Esc) and the file passes 6/6 on head.
  • vp run check:changed: pass.

Not shown: the drag is sent as pointer events inside the page, because the Browser panel cannot hold the mouse button while pressing a key; Esc is a real key press.

Generated with Claude Opus 5.5 in T3 Code Nightly

…out closing the sheet

Escape cancelled the resize but let the key bubble to the Files sheet or
attachment dialog, which closed it. The key now stops there, the pointer
capture is released, and a held Escape no longer closes the sheet on repeat.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Escape during spreadsheet row or column resizing now stops propagation and releases pointer capture before clearing resize state. A browser test checks that Escape does not close an open right panel during resize cancellation.

Changes: Spreadsheet resize Escape handling

Layer / File(s) Summary
Handle Escape during resize
apps/web/src/components/files/office/Spreadsheet.tsx, apps/web/src/components/files/office/sheet-resize.browser.test.ts
The spreadsheet stops Escape events from propagating and releases pointer capture when a resize is active. The browser test checks that Escape and repeated Escape keydowns leave the right panel open during resize cancellation. A later Escape closes the panel.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

  • pingdotgg/t3code#35548: Adds row and column resizing to the same spreadsheet preview, including Escape cancellation.
  • pingdotgg/t3code#41749: Addresses Escape handling in a PDF search input that shares the right-panel dismissal behavior.

Suggested reviewers: stienswout, macroscopeapp, maria-rcks

Merge Risk: Minimal · up to 27975

Pressing Esc while resizing a spreadsheet row or column should now cancel only the resize and leave the Files sheet open. The change is narrow and has test coverage, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: pressing Esc during a spreadsheet column or row resize now cancels the resize without closing the sheet. It follows the conventional commit format and matches the PR o…
Description check Passed The description covers the problem (Esc closes the Files sheet during a resize), the change (stop propagation, release pointer capture, handle repeated keydowns), and verification (new browser test fa…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: pressing Esc during a spreadsheet column or row resize now cancels the resize without closing the sheet. It follows the conventional commit format and matches the PR objectives and the Spreadsheet.tsx and test changes.

Full details: Description check

Explanation

The description covers the problem (Esc closes the Files sheet during a resize), the change (stop propagation, release pointer capture, handle repeated keydowns), and verification (new browser test fails on base and passes 6/6 on head, check:changed passes, before/after screenshots, and a note on what was not checked). The Scope section does not link an issue. It cites #41749 as related and says the PR is fixing a bug, but it does not explain why no issue is needed. The title is also 90 characters, which is longer than the template example.

Resolution

Optional: add a link to the issue that reports the bug, or state why no issue is needed, in the Scope section. The description otherwise meets the template.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8a3b1bd and 27975fb.

Files selected for processing: 2

  • apps/web/src/components/files/office/Spreadsheet.tsx
  • apps/web/src/components/files/office/sheet-resize.browser.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). takeover:in-progress A takeover lead is working on this PR vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants