Registry Mirror
Skip to content

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

Problem

When arrowing into a merged cell whose first row or column is hidden, settleMerges moves focus to that hidden anchor and skipHidden skips past the merge or snaps back instead of selecting the visible cell.

Change

Extract a hidden-aware mergeFocus helper in apps/web/src/components/files/office/sheet-cells.ts shared by settleMerges and skipHidden so focus stays on the visible cell when a merge's top-left cell is hidden. Pass layout.hidden from apps/web/src/components/files/office/Spreadsheet.tsx and extend apps/web/src/components/files/office/sheet-cells.test.ts for direct ArrowLeft/ArrowUp and merge-to-merge moves.

Scope

Small bug fix (size:S, +16/-11 non-test lines) for wrong arrow-key selection on merged cells with hidden leading rows/columns; follow-up to #45583 (4ae8e8de74); obvious bug needs no issue.

Verification

Linux repro:

  1. Open an .xlsx in Files on Linux with column B hidden and B1:C1 merged.
  2. Focus the grid and press ArrowRight to D1.
  3. Press ArrowLeft; base selects A1 instead of C1.

Setup: Linux, Browser panel in T3 Code (Chromium, Incognito profile), light theme, 1280x800 viewport, fresh isolated data on each commit. Server addresses are redacted.

Steps: Open T3 web app → select demo-sheet → new thread → Files → merged-hidden.xlsx → focus grid → ArrowRight until D1 is selected → ArrowLeft.

06d91822a0ff 0b3d6ae8fbe3
Pressing ArrowLeft from D1 skips visible C1 of merged B1:C1 and jumps to A1
Pressing ArrowLeft from D1 skips visible C1 of merged B1:C1 and jumps to A1
Pressing ArrowLeft from D1 selects visible C1 of merged B1:C1
Pressing ArrowLeft from D1 selects visible C1 of merged B1:C1

Driven in the Browser panel on 06d91822a0ff (A1) and 0b3d6ae8fbe3 (C1). Fail-first unit test failed on 06d91822a0ff (1/5 failed) and passed on 0b3d6ae8fbe3 (5/5 in sheet-cells.test.ts; 36/36 in apps/web/src/components/files/office/); vp run check:changed passed on 0b3d6ae8fbe3.

Not shown:

  • macOS/Windows desktop Electron apps (shared web sheet-cells.ts logic).
  • Hidden-row ArrowUp and merge-to-merge ArrowLeft (covered by sheet-cells.test.ts, not separate screenshots).
Test and check output (base 06d91822a0ff fail-first, candidate 0b3d6ae8fbe3 office suite, check:changed)

Fail-first unit test on base 06d91822a0ff:

 ❯ |@t3tools/web (unit)| src/components/files/office/sheet-cells.test.ts (5 tests | 1 failed) 24ms
   ✓ coverMerges (3)
     ✓ expands a long merge chain (reversed: false) 17ms
     ✓ expands a long merge chain (reversed: true) 2ms
     ✓ revisits merges reached through expansion on every edge without including distant merges 0ms
   ❯ skipHidden (2)
     ✓ selects the first cell of a merged cell reached across a hidden column 0ms
     × stays on the visible cell when the merged cell's first cell is hidden 4ms

 FAIL  |@t3tools/web (unit)| src/components/files/office/sheet-cells.test.ts > skipHidden > stays on the visible cell when the merged cell's first cell is hidden
AssertionError: expected { anchor: { row: +0, col: 2 }, …(1) } to deeply equal { anchor: { row: +0, col: 1 }, …(1) }

- Expected
+ Received

  {
    "anchor": {
-     "col": 1,
+     "col": 2,
      "row": 0,
    },
    "focus": {
-     "col": 1,
+     "col": 2,
      "row": 0,
    },
  }

 ❯ src/components/files/office/sheet-cells.test.ts:69:82
     67|       selectionAt({ row: 0, col: 1 }),
     68|     );
     69|     expect(move({ row: 0, col: 2 }, { row: 0, col: 1 }, { columns: [sp…
       |                                                                                  ^
     70|       selectionAt({ row: 0, col: 1 }),
     71|     );

 Test Files  1 failed (1)
      Tests  1 failed | 4 passed (5)

Passing office suite on candidate 0b3d6ae8fbe3:

 ✓ |@t3tools/web (unit)| src/components/files/office/sheet-viewport.test.ts (11 tests) 4ms
 ✓ |@t3tools/web (unit)| src/components/files/office/sheet-cells.test.ts (5 tests) 25ms
 ✓ |@t3tools/web (browser) (chromium)| src/components/files/office/word-images.browser.test.ts (1 test) 10ms
 ✓ |@t3tools/web (browser) (chromium)| src/components/files/office/fonts.browser.test.ts (5 tests) 472ms
 ✓ |@t3tools/web (browser) (chromium)| src/components/files/office/slide-fonts.browser.test.ts (1 test) 592ms
 ✓ |@t3tools/web (browser) (chromium)| src/components/files/office/word-document.browser.test.ts (2 tests) 1092ms
 ✓ |@t3tools/web (browser) (chromium)| src/components/files/office/sheet-resize.browser.test.ts (11 tests) 3324ms

 Test Files  7 passed (7)
      Tests  36 passed (36)
   Duration  11.48s

vp run check:changed 06d91822a0fff42f886ac12eff19bea54c8bf499 on candidate 0b3d6ae8fbe3:

check:changed: 3 files since 06d91822a0ff (06d91822a0fff42f886ac12eff19bea54c8bf499)

check:changed summary
  pass  format  0.4s
  pass  lint  1.2s
  pass  knip  17.9s
  pass  typecheck (2 packages)  5.5s
  pass  test (1 files)  1.3s
  pass  react compiler (2 files)  1.2s
  CI also runs: full test suites, build
  unused patch check skipped: no dependency files changed

Generated with Gemini 4 Neon in T3 Code Nightly

…rst cell is hidden

Arrowing directly into a merged cell whose first row or column is hidden
moved focus to that hidden anchor cell in `settleMerges`, causing
`skipHidden` to skip past the merge or snap back to the starting cell.

Share a hidden-aware merge focus helper between `settleMerges` (both
direct-entry and adjacent-merge paths) and `skipHidden` so focus stays on
the visible cell when the merge's first cell is hidden.
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Dec 4, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 0b3d6ae

Macroscope's review found this PR approvable — This corrects keyboard navigation into merged cells whose first row or column is hidden, keeping selection on a visible cell. The change is limited to selection and viewport behavior, with no spreadsheet-data mutation.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Spreadsheet keyboard navigation now accounts for hidden rows and columns when it settles selections in merged cells. If a merge’s top-left cell is hidden, navigation keeps the landing cell. Tests cover hidden spans and merge ranges.

Changes: Spreadsheet navigation

Layer / File(s) Summary
Visibility-aware merge focus
apps/web/src/components/files/office/sheet-cells.ts, apps/web/src/components/files/office/Spreadsheet.tsx, apps/web/src/components/files/office/sheet-cells.test.ts
settleMerges and skipHidden use hidden spans when choosing a merge focus cell. Spreadsheet keyboard navigation passes layout.hidden to settleMerges. Tests cover hidden rows, columns, and merge ranges.

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

Change: Bug fix

Suggested reviewers: saphid

Merge Risk: Minimal · up to 04718

This fixes arrow-key navigation into merged spreadsheet cells when the merge's first row or column is hidden. The change is small and localized, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix and the affected behavior: arrowing into a merged cell whose hidden first row or column is involved, with focus going to the visible cell. The changeset adds a hidden-aware mer…
Description check Passed The description follows the template sections (Problem, Change, Scope, Verification). The Problem section states the bug and expected behavior. The Change section explains the helper extraction and th…
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 fix and the affected behavior: arrowing into a merged cell whose hidden first row or column is involved, with focus going to the visible cell. The changeset adds a hidden-aware mergeFocus helper, passes layout.hidden through Spreadsheet.tsx, and updates skipHidden and settleMerges with tests, so the title matches the main change. It is a conventional commit title in plain language, though it is long at 96 characters.

Full details: Description check

Explanation

The description follows the template sections (Problem, Change, Scope, Verification). The Problem section states the bug and expected behavior. The Change section explains the helper extraction and the Spreadsheet.tsx wiring. The Scope section explains why no issue is linked, as the template requires for small obvious fixes. The Verification section gives a repro, a fail-first test, the passing suite, and check output, plus screenshots of before and after. Minor gaps: the template's Problem section asks for reproduction environment, which is given, and the Verification section lists what was not checked, which is also given. The template's optional agent attribution line is present. The description is thorough and complete.

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 0b3d6ae and 0471888.

Files selected for processing: 1

  • apps/web/src/components/files/office/sheet-cells.test.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 4, 2026
juliusmarminge and others added 2 commits December 4, 2026 12:50
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Open merged.xlsx from Files and maximize the panel. On Cols (B1:C1 merged, B hidden), click A1, press ArrowRight twice to reach D1, then ArrowLeft. On Rows (A1:A2 merged, row 1 hidden), click A3 and press ArrowUp.

Environment for every capture: Chromium 156 on Linux, 1280×800, light theme, maximized spreadsheet panel, fresh synthetic data on each commit.

Proven: the scenario fails on base 18be745024 and passes on head 0471888f88.

Base 18be745024 Head 0471888f88
Result ❌ failed
ASSERTION_FAILED: expected {"columnSelection":"office-cell-0-0","rowSelection":"office-cell-2-0"} to equal {"columnSelection":"office-cell-0-2","rowSelection":"office-cell-1-0"}
✅ passed
columns before arrow left Base 18be745024: columns before arrow left Head 0471888f88: columns before arrow left
columns after arrow left Base 18be745024: columns after arrow left Head 0471888f88: columns after arrow left
rows before arrow up Base 18be745024: rows before arrow up Head 0471888f88: rows before arrow up
rows after arrow up Base 18be745024: rows after arrow up Head 0471888f88: rows after arrow up
failure Base 18be745024: failure

Before recording · After recording

Scenario and synthetic workbook generator

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 4, 2026
@juliusmarminge
juliusmarminge merged commit 34bd81f into pingdotgg:main Dec 4, 2026
56 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 4, 2026
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Dec 4, 2026
**v0.1.14-nightly.20261204.5719** · 96 changes from 16 contributors

- **Custom pull request formats.** Custom pull request instructions can now replace the default description format.
- **OpenCode reasoning default.** Return to the model’s default reasoning level after choosing another level.
- **Faster terminal closing.** Closing a terminal no longer waits for history writes from other busy terminals.
- **Terminal startup pastes.** Long commands pasted during shell startup are no longer truncated or left waiting after Enter.
- **Missing worktree recovery.** Recover a thread when its removed worktree cannot be recreated, instead of getting stuck on every message.

### Plus 87 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(client-runtime): match canonically equivalent machine names in composer mentions by @saphid in pingdotgg/t3code#48718
* fix(client-runtime): keep distinct PR label filters when repeated labels hit the cap by @saphid in pingdotgg/t3code#48713
* fix(client-runtime): find chat file links after a shell here-string by @saphid in pingdotgg/t3code#48725
* fix(server): link_pull_request no longer promises settle-on-merge when auto-settle is off by @juliusmarminge in pingdotgg/t3code#48739
* fix(web): scrolling a selected cell behind a frozen spreadsheet pane no longer leaves a green selection bar on the divider by @only21mil in pingdotgg/t3code#48724
* fix(web): terminal honors OS key remaps like Caps Lock as Escape by @haraldvinje in pingdotgg/t3code#48715
* fix(shared): match escaped whitespace in Markdown footnote back-links by @saphid in pingdotgg/t3code#48726
* perf(web): streaming, thread switches and typing re-render fewer components by @maria-rcks in pingdotgg/t3code#48244
* fix(web): Files breadcrumb keeps the filename visible as toolbar actions appear by @StiensWout in pingdotgg/t3code#48742
* fix(desktop): an older cache saved from a fallback shell no longer pins its PATH by @StiensWout in pingdotgg/t3code#48736
* fix(web): binary CSV previews show one Show source button that switches the view by @StiensWout in pingdotgg/t3code#48749
* fix(client-runtime): keep media URLs inside multiline PR code spans literal by @juliusmarminge in pingdotgg/t3code#48761
* fix(provider-core): custom PR instructions can replace the default body format by @juliusmarminge in pingdotgg/t3code#48762
* fix(web): give workflow questions distinct keyboard focus targets by @saphid in pingdotgg/t3code#48755
* fix(web): open HFS+ disk images with a bare DDM partition label by @saphid in pingdotgg/t3code#48729
* fix(server): installed voice models work while another model downloads by @Jozeph-Zemambo in pingdotgg/t3code#48728
* fix(client-runtime): failed cloud transcriptions offer Retry instead of Record again by @juliusmarminge in pingdotgg/t3code#48767
* fix(server): long pastes after answering a terminal startup prompt are no longer cut off by @StiensWout in pingdotgg/t3code#48752
* fix(server): a stalled terminal viewer no longer blocks query replies from another viewer by @StiensWout in pingdotgg/t3code#48748
* fix(web): follow EPUB links to chapters rendered through a fallback by @saphid in pingdotgg/t3code#48740
* fix(client-runtime): keep literal URLs inside PR pre blocks out of the media gallery by @saphid in pingdotgg/t3code#48766
* fix(server): a broken workspace file no longer hides imports from a valid one by @StiensWout in pingdotgg/t3code#48774
* fix(server): read delegated threads with unencoded ids by @zhangkom in pingdotgg/t3code#48768
* fix(source-control-core): a PR merged into a branch before that branch's PR was linked is not stacked on it by @YOG3SHWAR in pingdotgg/t3code#48758
* fix(server): Copy ignored files finds matches past a large ignored-file list by @StiensWout in pingdotgg/t3code#48776
* fix(cursor): narrowed usage retries send whole-millisecond dates by @juliusmarminge in pingdotgg/t3code#48788
* fix(server): stop re-casing Codex model display names by @t3dotgg in pingdotgg/t3code#48794
* fix(server): Files tree marks ignored files under bracketed folders by @StiensWout in pingdotgg/t3code#48781
* fix(client-runtime): stop loading earlier history at a lone human steer by @saphid in pingdotgg/t3code#48720
* fix(server): extract text from Mac Cyrillic RTF attachments by @Lucenx9 in pingdotgg/t3code#48783
* fix(web): snooze menu stays open on Woke rows that outgrow the sidebar by @mateozariquiey in pingdotgg/t3code#48716
* fix(server): explain redirected Git work trees by @zhangkom in pingdotgg/t3code#48784
* fix(shared): Windows PATH lookup finds mixed-case launchers like code.Cmd by @StiensWout in pingdotgg/t3code#48779
* fix(web): terminal shortcuts that need the drawer open no longer swallow keys in a panel terminal by @StiensWout in pingdotgg/t3code#48791
* fix(server): Enter after a paste during shell startup submits the pasted command by @StiensWout in pingdotgg/t3code#48799
* fix(web): preserve bold at the start of italic text in composer by @only21mil in pingdotgg/t3code#48805
* fix(shared): retain Markdown link definitions after list and HTML boundaries by @shivamhwp in pingdotgg/t3code#48795
* fix(shared): recognize pasted thread links after HTML attribute backticks by @shivamhwp in pingdotgg/t3code#48789
* fix(mobile): thread lists scroll clear of the machine load pill by @saphid in pingdotgg/t3code#48747
* fix(server): adding a Windows folder in another letter case finds its existing project by @StiensWout in pingdotgg/t3code#48780
* fix(server): cancelling worktree setup while its terminal starts closes the shell by @StiensWout in pingdotgg/t3code#48793
* fix(web): scrolled spreadsheet header dividers no longer bleed into the select-all corner by @only21mil in pingdotgg/t3code#48806
* fix(web): PR diff line links scroll to files further down a long diff by @only21mil in pingdotgg/t3code#48807
* fix(shared): preserve footnote references across Markdown chunk boundaries by @shivamhwp in pingdotgg/t3code#48790
* fix(server): a connection after editor discovery expires gets the refreshed editors by @StiensWout in pingdotgg/t3code#48804
* fix(web): keep file paths clickable after nested HTML anchors by @shivamhwp in pingdotgg/t3code#48796
* fix(server): a thread whose worktree can't be recreated offers the missing-workspace recovery by @juliusmarminge in pingdotgg/t3code#48810
* fix(web): terminals closed elsewhere leave the right panel even behind another tab by @StiensWout in pingdotgg/t3code#48802
* fix(web): sidebar footer buttons stay inside the sidebar at larger interface fonts by @mateozariquiey in pingdotgg/t3code#48808
* fix(server): a stray core.worktree is reported, not read as no repository by @juliusmarminge in pingdotgg/t3code#48809
* fix(web): close the PR base-branch update popover when scrolling swaps the header by @only21mil in pingdotgg/t3code#48815
* fix(web): a terminal closed while it loads no longer leaves a dead tab by @StiensWout in pingdotgg/t3code#48798
* fix(server): reject invalid script IDs when creating a project by @only21mil in pingdotgg/t3code#48816
* fix(web): arrowing into a merged cell with a hidden first row or column selects its visible cell by @only21mil in pingdotgg/t3code#48817
* fix(shared): sandbox:C:/ Windows links open as file links by @juliusmarminge in pingdotgg/t3code#48827
* test(server): wait for the delegated row to settle after Stop by @juliusmarminge in pingdotgg/t3code#48835
* fix(server): closing a terminal no longer waits behind other terminals' history writes by @AksharP5 in pingdotgg/t3code#48829
* fix(web): render ODT and ODP JPEGs with large metadata headers by @only21mil in pingdotgg/t3code#48832
* fix(web): pull requests host filter keeps other workspace hosts on reopen by @only21mil in pingdotgg/t3code#48833
* perf(server): a burst of agents reading thread history no longer stalls the server by @t3dotgg in pingdotgg/t3code#48831
* fix(server): Reveal opens replacement file managers registered under Folder or Drive by @StiensWout in pingdotgg/t3code#48801
* fix(pi): reject a positional prompt after --no-mcp by @Pruthvirajcodes in pingdotgg/t3code#48836
* fix(source-control): remove Copilot's noreply co-author trailer when merging by @Pruthvirajcodes in pingdotgg/t3code#48837
* fix(web): keep preview annotations of elements with very long selectors or names by @only21mil in pingdotgg/t3code#48838
* docs(skills): clarify when to use workflow hooks by @shivamhwp in pingdotgg/t3code#48777
* fix(forgejo): a repository with an external issue tracker no longer reports a missing repository by @juliusmarminge in pingdotgg/t3code#48871
* fix(client-runtime): show a repository's issue list error once across environments by @juliusmarminge in pingdotgg/t3code#48873
* fix(server): Codex launch arguments keep a trailing escaped space by @StiensWout in pingdotgg/t3code#48856
* fix(web): scrolling cancels a delayed Word contents link even after returning by @StiensWout in pingdotgg/t3code#48858
* fix(web): composer caret on a blank line or beside a chip stays visible on panel resize by @only21mil in pingdotgg/t3code#48869
* fix(server): Codex status updates after a CLI login creates its home by @StiensWout in pingdotgg/t3code#48867
* fix(web): file paths after nested HTML links no longer join the outer link by @StiensWout in pingdotgg/t3code#48861
* fix(shared): long Markdown previews link footnotes defined in numbered list items by @StiensWout in pingdotgg/t3code#48864
* fix(web): an empty RTF page-break group no longer starts a new page by @StiensWout in pingdotgg/t3code#48872
* fix(shared): long Markdown previews keep link definitions from quotes and lists by @StiensWout in pingdotgg/t3code#48876
* fix(client-runtime): video URLs in code spans after raw HTML stay in the code by @StiensWout in pingdotgg/t3code#48860
* fix(web): a finished pull request checkout no longer closes a newer checkout dialog by @StiensWout in pingdotgg/t3code#48875
* fix(web): disconnecting a server no longer pulls you out of a chat on another server by @StiensWout in pingdotgg/t3code#48879
* fix(web): scroll to end no longer jumps another conversation to its end by @StiensWout in pingdotgg/t3code#48877
* fix(opencode): Reasoning always offers a Default choice that sends no variant by @juliusmarminge in pingdotgg/t3code#48883
* test(desktop): keep the tunnel endpoint off the ::1 decoy's port by @juliusmarminge in pingdotgg/t3code#48888
* fix(shared): explicit Windows binary paths find mixed-case launchers by @StiensWout in pingdotgg/t3code#48870
* fix(web): spreadsheet edge jumps land on the nearest visible cell by @only21mil in pingdotgg/t3code#48884
* fix(web): disk image previews list files after an empty HFS+ volume by @StiensWout in pingdotgg/t3code#48890
* fix(scenarios): two-environment scenarios switch Settings > Environments to the list view by @juliusmarminge in pingdotgg/t3code#48891
* fix(web): a side chat question the server accepted opens after a reconnect by @StiensWout in pingdotgg/t3code#48880
* fix(web): overlapping folder additions open the latest folder by @StiensWout in pingdotgg/t3code#48893
* fix(web): a failed goal action no longer clears another chat's sending indicator by @StiensWout in pingdotgg/t3code#48878
* fix(web): clicking a merged cell that starts in a hidden column keeps arrow keys on visible cells by @StiensWout in pingdotgg/t3code#48896
* fix(web): Show HTML source opens the source of a page that is not UTF-8 by @StiensWout in pingdotgg/t3code#48902
* fix(web): a sidebar file drop cancelled at an unsaved-changes prompt stays cancelled by @StiensWout in pingdotgg/t3code#48898
* fix(web): truncated multi-file tool diffs no longer render as raw text by @only21mil in pingdotgg/t3code#48866
* fix(server): first message in an empty worktree thread waits for blocking setup by @StiensWout in pingdotgg/t3code#48906
* fix(web): drafts offer New worktree once a tracked folder becomes a Git repository by @StiensWout in pingdotgg/t3code#48899
* fix(server): retrying a Claude thread whose CLI exited before init starts a fresh session by @smirea in pingdotgg/t3code#48908
* fix(server): a queued follow-up starts after its turn's checkpoint save gives up by @StiensWout in pingdotgg/t3code#48912

## New Contributors
* @haraldvinje made their first contribution in pingdotgg/t3code#48715
* @Jozeph-Zemambo made their first contribution in pingdotgg/t3code#48728
* @zhangkom made their first contribution in pingdotgg/t3code#48768
* @mateozariquiey made their first contribution in pingdotgg/t3code#48716

**Full Changelog**: pingdotgg/t3code@v0.1.14-nightly.20261204.5706...v0.1.14-nightly.20261204.5719

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.14-nightly.20261204.5719
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). 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