Skip to content

DH-1981 Spreadsheet navigation options, BeginEditAsync, CommitEdit/NavigateFromCurrentCell - #5

Merged
SolidRockProgrammer merged 4 commits into
datgel/v1.5.0-patchedfrom
feat/grid-keyboard-gint-parity
Oct 1, 2026
Merged

SolidRockProgrammer merged 4 commits into
datgel/v1.5.0-patchedfrom
feat/grid-keyboard-gint-parity

Conversation

@SolidRockProgrammer

Copy link
Copy Markdown

Datgel fork patch for Datgel Hub DH-1981 (drive the grid like gINT and Excel), on the line Hub ships (datgel/v1.5.0-patched).

What it adds (all opt-in; the stock behaviour is unchanged when the new properties are left at their defaults):

  • TableView.BeginEditAsync(TableViewCellSlot) - the reworked Add public TableView.BeginEditAsync(slot) to start an edit like F2 (#430) w-ahmad/WinUI.TableView#431 (DH-1831): commits another cell's edit, makes the cell current and selected, then begins the edit as F2 does. Synchronous for a realized current cell.
  • EnterKeyNavigation (Down default | Right, wrapping to the first cell of the next row; Shift+Enter goes left).
  • ContinueEditingOnNavigation (true default). false: Tab/Enter while editing commits and only selects the next cell.
  • CommitEdit() and NavigateFromCurrentCell(key) - public, so a host can save-and-move from inside an editor (spreadsheet entry mode).
  • The Tab/Enter branch of HandleNavigations is factored into internal HandleTabOrEnter (no behaviour change) so the editing path is testable; a doc comment that had lost its method is fixed.

Tests (run on hosted Windows through the .build.appxrecipe with vstest.console.exe, on a ci/** branch whose workflow prefixes it, because this repo's ci-build.yml runs no tests):

  • 9 BeginEditAsync tests, 14 keyboard-navigation tests (4 of them new in this round for Tab/Enter while editing).
  • Negative control: branch ci/nc-grid-keyboard ignores EnterKeyNavigation and ContinueEditingOnNavigation.

Results are in the comments below.

SolidRockProgrammer and others added 4 commits October 1, 2026 15:40
Makes a cell current and selected through MakeSelection and begins editing it as F2 does, committing any edit in progress on another cell first; a realized current cell is edited synchronously. Brought onto the 1.5.0 line Hub ships so it can be tested in Hub before w-ahmad#431 goes further upstream. TableViewCell.BeginEdit() is kept so current callers still compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnterKeyNavigation (Down by default, Right moves to the next cell and wraps, as gINT does); ContinueEditingOnNavigation (true by default; false makes Tab/Enter commit and only select the next cell, as Excel does); CommitEdit() and NavigateFromCurrentCell(key) so a host can implement entry mode (an arrow key that commits and moves). The arrow-slot computation is extracted so the key handler and the public method share it. Defaults keep the stock behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AutoGenerateColumns defaults true, so the test grid carried three
generated columns beside the three declared ones and the wrap test's
last column was not the last (CI run 36832285874).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The commit-and-move path ran only from OnKeyDown, which needs a
KeyRoutedEventArgs no test can construct, so ContinueEditingOnNavigation
and EnterKeyNavigation=Right while editing had no test at all.

- Factor the Tab/Enter branch into internal HandleTabOrEnter (same
  behaviour; a cancelled commit still leaves the key unhandled).
- Four tests: default continues editing; Right + not continuing commits
  and only selects; Tab wraps and only selects; a cancelled commit
  moves nothing.
- GetArrowSlot had been inserted under GetNextSlot's summary, giving
  it two summaries and GetNextSlot none.

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

Copy link
Copy Markdown
Author

Measured on hosted Windows via the .build.appxrecipe (vstest.console.exe, /InIsolation): run 36895118635 on ci/grid-keyboard-gint-parity-2 (this head + the CI-only workflow commit) 414/414 passed. Negative control run 36895181671 on ci/nc-grid-keyboard (EnterKeyNavigation and ContinueEditingOnNavigation ignored): 409 passed / 5 failed, exactly Enter_moves_right_when_EnterKeyNavigation_is_Right, Enter_moving_right_wraps_from_the_last_column_to_the_first_cell_of_the_next_row, Shift_Enter_moving_right_goes_left, Enter_while_editing_commits_and_only_selects_the_cell_to_the_right_when_not_continuing, Tab_while_editing_only_selects_the_next_cell_when_not_continuing.

@SolidRockProgrammer
SolidRockProgrammer merged commit 0dd74ce into datgel/v1.5.0-patched Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants