Skip to content

Fix the viewer model items from the review - #889

Merged
SimonCropp merged 1 commit into
mainfrom
fix-viewer-model
Sep 23, 2026
Merged

SimonCropp merged 1 commit into
mainfrom
fix-viewer-model

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

The "Viewer model" group from todo.md. Every item had a failing repro on c37bf9e. Those repros are now tests in the class for their topic.

Item Fix Tests
Removing the entry being read can select one inside a folded group Remove and Sync move to the nearest visible entry, using the search Toggle already had (NearestVisible, Reopen) CollapseTests.Accepting_the_entry_being_read…, …A_listing_without_the_entry_being_read…
A selection survives its entry's text being replaced TextSelection.Text holds the entry's built view, and Describes compares it by reference. A with keeps the view and a rebuild replaces it SelectionTests.A_rerun_that_replaces_the_text…, A_status_change_keeps_the_selection
The selection moves under an open entry menu Select closes the menu when the entry changes EntryMenuTests (wire focus; a focus riding the owner's listing)
"Accept all in " holds its deletes over another solution's old failure Counted from the group's own accepts (notWritten + failed). The queue-wide InlineRefused scan is gone, and its reasoning moved to SweepTracked's refused HeldDeleteTests.An_earlier_failure…, A_failure_in_this_solution_holds_its_deletes
The chosen variant is kept by index Kept by the frameworks it holds (SameVariant), falling back to the index only when none match ReEnqueueTests.A_settle_of_an_earlier_variant…, A_rerun_that_merges…
A BMP height of int.MinValue throws Read as unknown height ImageHeaderTests, FileSideTests
ReadChanges replaces an unreadable file's entry every pump Keeps the held entry when a re-read finds nothing new. Both passes retry an unreadable file every 2 s (ReadRetry) rather than five times a second AttachedViewerTests.AnUnreadableTrackedFileLeavesTheMenuOpen, TrackedWatchTests.AnUnreadableFileIsNotReReadEveryPass
TrackedWatch drops a pair re-staged mid-pass Refresh takes the entries the pass saw and matches them by reference, not by key TrackedWatchTests.APassDoesNotDropAPairReStagedAfterItsStat, ARefreshLeavesAnEntryThatArrivedAfterThePass
Selection columns are UTF-16 but heads report cells Columns count code points, one to a cell as every head draws them (SelectionText.Cells) SelectionTests.A_drag_across_one_non_bmp_character…, …after_a_non_bmp_character…, Select_all_ends_on_the_last_cell

The UTF-16 item stays in todo.md, narrowed: wide CJK characters and combining marks still don't take exactly one cell. Fixing that needs each head to report string positions from its own layout.

Refresh's signature changed, so four TrackedFileTests were updated to pass the entries a pass saw.

The full solution passes locally in Release: 2,065 passed, 24 skipped.

- Removing the entry being read, locally or from the owner's listing, no longer
  leaves the selection on an entry inside a folded group: it moves to the
  nearest visible one, with the search Toggle already had.
- A text selection is tied to the text it was dragged across, the entry's built
  view, so a re-run under the same key ends it rather than highlighting and
  copying rows the reader never selected. A status change keeps it.
- Moving the selection closes an open entry menu, whose items act on whatever
  is selected when clicked. A focus from the tray or an IDE, or one riding a
  re-sent snapshot's listing, retargeted Discard onto another entry.
- "Accept all in <solution>" holds its deletes on its own members' accepts,
  failed ones included, not on statuses other accepts left in the queue.
- The variant a reader cycled to is kept by the frameworks it holds, not by its
  index, across a settle or a re-run that drops or merges variants before it.
- A BMP height of int.MinValue reads as unknown rather than throwing in
  Math.Abs, which made the side unreadable.
- A tracked file that stats but cannot be read is retried every two seconds
  rather than re-read and re-diffed five times a second, and an unchanged
  re-read keeps the entry held, so an attached viewer's menu stays open.
- A watch pass applies what it found only to the entries it looked at, so a
  pair re-staged under the same key since its stat is not dropped.
- Selection columns count code points, one to a cell as every head draws them,
  so a character outside the basic plane no longer shifts the copy or splits.
@SimonCropp SimonCropp added this to the 20.5.0 milestone Sep 23, 2026
@SimonCropp
SimonCropp merged commit 5a9c35b into main Sep 23, 2026
10 checks passed
@SimonCropp
SimonCropp deleted the fix-viewer-model branch September 23, 2026 05:00
This was referenced Sep 23, 2026
This was referenced Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant