Skip to content

Grid input: select on press, fill-handle double-click to adjacent data, whole-column and row references in formulas - #927

Open
echelon wants to merge 1 commit into
mainfrom
claude/grid-ui-input
Open

echelon wants to merge 1 commit into
mainfrom
claude/grid-ui-input

Conversation

@echelon

@echelon echelon commented Oct 13, 2026

Copy link
Copy Markdown
Member

Requested by Brandon

Before: a cell was selected only when the mouse button came back up, and a press that moved a little inside the cell could select nothing (#900). Double-clicking the fill handle used the left column only and missed data on the right or reached diagonally (#877). Clicking a heading while typing a formula inserted B:B but couldn't be dragged to B:D, whole-column and whole-row references (A:A, 2:2) were neither coloured nor outlined (#873, #875), and F4 mangled them into $A$:$A$.

After: the press selects at once and a drag extends from it, as in Excel. Shift and Ctrl act on the press, while checkboxes and links act on the click. Double-clicking the fill handle fills to the bottom of the data region around the source and stops above a filled cell, matching 13 layouts observed in Excel for Windows. Headings point B:B, B:D or 3:3 into a formula, and those references get their own colour, an outline on the grid, and F4 toggling $B:$D ⇄ B:D (#872, #873, #875).

How: grid::interact now acts on primary_pressed, with a press_consumed flag so the press's drag start or click doesn't act again. Targets that are buttons or may turn into another drag (the outline band, the selection border, a selected column heading, objects, Page Layout headers and footers) defer to the drag start or the click. New edit.autoFillToData command (selection::fill_down_extent, built on current_region_of) visits only stored cells, so tall sheets stay fast. Drag::PointLines handles heading drags in point mode, replacing point_header from #691. formula_refs recognises whole-line references, and the F4 logic moved to cycle_ref.

Tests: ui-egui/tests/press_select.rs (11 UI tests through real egui input, 4 of which fail on the old code), Excel-observed fill cases in engine/src/tests.rs, and unit tests for reference spans and F4. fill_handle_double_click.rs from #507 still passes and now counts the new command. Fuzzer wired. Workspace tests, wasm and fmt pass. Clippy on Rust 1.95 flags pre-existing lints in xlsx/src/xls/mod.rs, xlsx/src/tests/passthrough_tests.rs and grid.rs:2592 (none touched here); with those allowed, the changed crates are clean.

Closes #900, closes #877, closes #872, closes #873, closes #875.

🤖 Generated with Claude Code

…erences (#900, #877, #872, #873, #875)

- A press selects its cell when the button goes down and a drag extends from it; Shift/Ctrl act
  on the press; checkboxes and links act on the click; the selection border, a selected column
  header, objects and Page Layout headers/footers wait for the drag or click (#900).
- Double-clicking the fill handle fills down to the bottom of the data region around the source,
  stopping above the first filled cell under it: new `edit.autoFillToData`, tested against 13
  cases observed in Excel (#877). The old double-click handler was never reached.
- While typing a formula, column and row headings point `B:B`, `B:D`, `3:3` into it (#872);
  whole-column and whole-row references are coloured and outlined (#873, #875); F4 toggles them
  `$B:$D` / `B:D` as Excel does.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

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

None yet

Projects

None yet

1 participant