User/rashmithakur/rowselection on cellediting poc#7
User/rashmithakur/rowselection on cellediting poc#7rashmi-thakurr wants to merge 10 commits intoPOCForTableViewGapsfrom
Conversation
|
can youu check these? 🔴 Critical Issues
_editingHighlightRow in TableView.cs holds a direct reference to a TableViewRow container. In a virtualized list, containers are recycled when rows scroll out of view. When a container is recycled for a // EnsureAlternateColors guard — will silently skip if _isEditing is stale Result: A recycled container's alternating row color is never updated, causing visual corruption. The highlight state needs to be reset in the row's PrepareContainerForItemOverride/OnApplyTemplate cycle, 🟠 Significant Issues
-newSlot = GetNextSlot(newSlot, shiftKey, e.Key is VirtualKey.Enter); Passing true for the Enter-like flag when SelectionUnit is Row means all navigation keys (Tab, Arrow) always advance by row instead of by cell. If the intent is only to change Tab/Enter behavior, this is
Both handlers are now async void. The !TableView.IsEditing guard is checked synchronously, but BeginCellEditing yields the UI thread during the await. On a double-tap, the event sequence is: Tap1 → Tap2 →
if (ContainerFromIndex(newSlot.Row) is TableViewRow newRow) If the target row is not currently in the viewport, ContainerFromIndex returns null. The old row's highlight is cleared, but the new row gets no highlight and _editingHighlightRow remains null. There's no
SetIsEditing applies the editing highlight only when SelectionUnit is TableViewSelectionUnit.Row, but OnTapped in the original code handled both Row and CellOrRow. If CellOrRow is a valid unit, the 🟡 Minor Issues
On Windows, the highlight sets RowPresenter.Background = _itemPresenter?.PointerOverBackground. If _itemPresenter is null, the background gets set to null — this may be a visible flicker or incorrect
TableViewRow already has a field _isEditing = false. TableView.cs also tracks editing via its own IsEditing property. The naming is not wrong, but a more specific name like _hasEditingHighlight would make
SetIsEditing_TogglesInRowMode doesn't add any rows/data to the TableView, so ContainerFromIndex will always return null in the highlight path — the highlight code path is never actually exercised. The test ApplyEditingHighlight_Toggles verifies "should not crash" but doesn't assert any visual state. Given the highlight logic is the core of this PR, tests for at least the _isEditing flag state and
The branch (user/rashmithakur/rowselection-on-cellediting-poc) and title both say POC. Before this is merged even into POCForTableViewGaps, the code should be cleaned up: remove POC-specific comments, |
…n-on-cellediting-poc
This reverts commit 5dc6c0c.
Scenarios Validated
Single tap unselected cell - Selects the cell/row, no editing
Single tap already selected cell - Selected cell enters edit mode
Double tap unselected cell - Cell enters edit mode directly
Double tap read only cell/ Single tap read only cell - cell/row is selected but cell doesn't enters edit mode
Rapid triple tap - Cell enters edit mode once on double-tap. No duplicate editing, no flicker, no crash. Third tap interacts with the edit control (TextBox) normally.
Enter edit mode --> double tap any editable cell - Row is highlighted
Escape --> while editing, press escape - cell exits editing mode but row and cell is selected and highlighted
Enter --> Double tap to edit, type something and then press enter content inside the cell changes and cell/row - selection moves to the cell below in the next row and that cells enters edit mode
Click outside table --> double tap to edit cell and then click on empty space outside the table - cell exits edit mode but row/cell remains selected and highlighted.
Tab while editing - editing and highlight moves to the cell below in the next row
shift+tab while editing - editing and highlight moves to the cell above in the previous row
arrow keys while editing - arrow keys don't work; because the arrow keys are captured by the edit control textbox for cursor movement within the text
Tab past the last row --> what happens at the boundary? - editing and highlight moves to the cell in the next column in the first row
Edit a row, scroll it off-screen, scroll back - Cell still in edit mode and row is still highlighted
Tab to a row that's off-screen - Table auto scroll to show the new cell/row and they are selected and highlighted
Rapidly scroll while editing - No random rows getting highlighted. No visual glitches. Only the editing row is highlighted
Start editing and then filter the column - cell exits editing mode, highlighting is removed, filtered table comes up
Start editing, then sort by clicking a header - cell exits editing mode, highlighting is removed and sorting happens
Filter rows - such that edited row disappears - seems to be working fine
Remove filter to bring row back- seems to be working as expected
Multi select mode (ctrl + click) - Editing highlight and multi-row selection coexist cleanly — editing highlights only the active row without interfering with other selected rows, and all visual states clear properly on escape, filter, or
sort.