0.9.18: fast History, one search matcher, after-play and Free up space polish, and cleanup #233

Merged
ethan-hann merged 44 commits from integration-0918 into main 2026-10-27 12:41:27 -05:00
Owner

History draws only the entries in view (#217, D64.4): a game with 3000 snapshots opens in under 0.2 s headless instead of about 9 s, Tab reaches every card, focus returns to the same snapshot after a search, refresh or resize, and cards name their group and place for screen readers. Template search uses the list searches' matching with its own ranking (#218, D53.3, D53.6, D64.1). The after-play dialog has one footer button and default names use the catalog language's date ("Session - Jul 8, 2026"); Settings' Free up space is named for what it does and says how many Recently removed snapshots it will delete (#159, D44.4). A task stopped so another could go first reads "Stopped" everywhere, every folder open reports a failure on Linux, the keyboard profile menu opens at the row, and the size choice stays in view (#224, #229, D13.17).

Cleanup: LaunchPreview carries its folders as a list (#208); the shell disposes its screens (#220); the VM gate and VM packaging share one VM-wide lock, prune their caches and label narrowed runs from the gate's own verdict (#225 items 1-4, D60.5; item 5, measuring Defender, stays open); the two VM scripts' quoting is fixed.

Each change was implemented test-first and reviewed; review findings and a gap analysis were fixed on this branch. Follow-ups filed: #228 #230 #231.

Local gates on 0d8d6bfc: Windows gate passed (18598 tests, 0 failed, 73 listed skips); Linux gate on the VM passed (18582 tests, 0 failed); two earlier VM runs each hit a different flaky test, filed as #231 and #232 (both pass 4 of 4 alone).

Closes #159 #208 #217 #218 #220 #224 #229

History draws only the entries in view (#217, D64.4): a game with 3000 snapshots opens in under 0.2 s headless instead of about 9 s, Tab reaches every card, focus returns to the same snapshot after a search, refresh or resize, and cards name their group and place for screen readers. Template search uses the list searches' matching with its own ranking (#218, D53.3, D53.6, D64.1). The after-play dialog has one footer button and default names use the catalog language's date ("Session - Jul 8, 2026"); Settings' Free up space is named for what it does and says how many Recently removed snapshots it will delete (#159, D44.4). A task stopped so another could go first reads "Stopped" everywhere, every folder open reports a failure on Linux, the keyboard profile menu opens at the row, and the size choice stays in view (#224, #229, D13.17). Cleanup: LaunchPreview carries its folders as a list (#208); the shell disposes its screens (#220); the VM gate and VM packaging share one VM-wide lock, prune their caches and label narrowed runs from the gate's own verdict (#225 items 1-4, D60.5; item 5, measuring Defender, stays open); the two VM scripts' quoting is fixed. Each change was implemented test-first and reviewed; review findings and a gap analysis were fixed on this branch. Follow-ups filed: #228 #230 #231. Local gates on 0d8d6bfc: Windows gate passed (18598 tests, 0 failed, 73 listed skips); Linux gate on the VM passed (18582 tests, 0 failed); two earlier VM runs each hit a different flaky test, filed as #231 and #232 (both pass 4 of 4 alone). Closes #159 #208 #217 #218 #220 #224 #229
The template picker and the editor's Name field now match typed words with SearchQuery/SearchTarget, the same engine as the games list: every word contained anywhere, ignoring case, accents and punctuation, plus a name's initials. TemplateSearch keeps only the ordering (name start, then first-word start, then list order); the ranking now lives on SearchQuery.Rank over the name key. The separate SearchKey/WordsOf engine is gone, so one query finds the same games in both places.

Observed reds before the change (assertion failures):
- TemplatePickerViewModelTests.A_typed_word_is_found_anywhere_in_the_name_like_in_the_games_search: expected ["Half-Life 2"], actual [].
- Accents_make_no_difference_in_the_picker("pokemon"): empty list for "Pokémon Legends: Arceus".
- A_typed_accent_finds_a_name_without_it: expected ["Pokemon Legends: Arceus"], actual [].
- The_initials_of_a_name_count_in_the_picker: "skyrim se" found nothing.
- Initials_alone_find_the_name_they_spell: "sv" found nothing.
- A_search_that_matches_only_through_initials_ranks_after_names_that_start_with_it: only "Sv Racing" listed.
- The_games_search_and_the_picker_find_the_same_games_for_the_same_text: expected Skyrim SE, actual [].
- GameEditorTemplateTests.The_name_field_finds_a_game_by_initials_like_the_games_search_does("skyrim se") and An_accent_typed_in_the_name_field_finds_a_game_without_it: empty match list.

Mutation check: ordering by rank descending fails the ranking tests, including Matches_keep_the_given_order_among_equally_good_fits, which passed on its first run.

Changed expectations: a word found in the middle of a name now matches ("alflife" finds Half-Life 2), and the match-count announcement test types "alpha one" because "o" is now found inside "Alpha Two".
LaunchPreview held the install, saves and mods folders as named slots
(Install, External, Mods), so every new folder kind added a slot and a
role switch in the launch dialog, banner, flow and fakes. The preview now
carries Folders, one FolderLaunchState per folder in switch order, with
Folder(role) to look one up and Install as the always-present game folder.
The dialog, banner and flow iterate the list; the App-side
LaunchPreviewFolders helper is gone. Tests and fakes edit one folder through
a small WithFolder/WithoutFolder test extension.

Pure restructuring, no behavior change. No new red: the existing launch
preview, dialog, banner, flow, contract and render tests are the net and
pass unchanged in what they assert.
ShellViewModel.Dispose let go of its own search and pane but not of the
screens it held, so the Games, History and Activity screens' search and
typing-pause timers and the History read in flight kept running until the
process ended. The shell now disposes each screen it built that is
disposable.

Observed reds, before the change:
- ShellDisposalTests.Disposing_the_shell_disposes_every_screen_it_built_that_holds_something_to_let_go_of:
  Assert.Equal() Failure, Expected: 1, Actual: 0 (DisposedCount of the Games and History screens)
- ShellDisposalTests.A_games_search_that_was_still_waiting_to_announce_says_nothing_once_the_shell_is_gone:
  Expected: "", Actual: "1 of 3 profiles"
- ShellDisposalTests.The_history_screens_pending_search_timers_are_stopped_when_the_shell_is_disposed:
  Assert.True() Failure on the timer count after the shell was disposed
ShellDisposalTests.A_screen_without_anything_to_let_go_of_is_left_alone_when_the_shell_is_disposed
passed on its first run (it guards the cast); a mutation to a hard
(IDisposable) cast made it fail with InvalidCastException, then was restored.
The History lists built and laid out a control for every snapshot. The timeline, the Saves column, the card view and a long Recently removed list now use a virtualizing panel, so a game with thousands of snapshots costs about as much as a screenful.

- Cards: one scrolling list of group headings and rows of cards (CardEntries). The view sets CardColumns from its width (210 px per card, one to three), replacing AdaptiveUniformGrid, which is removed.
- Column headings stay put above their scrolling lists.
- Recently removed: up to 30 rows are drawn in full, so the section is as tall as its rows wherever the screen is scrolled; a longer list scrolls inside 340 px and draws only the rows in view.
- OrderedVirtualizingStackPanel keeps the drawn entries in list order (the stock panel lists them in build order, reversed after a jump to the end), so Tab, Shift+Tab and screen readers meet them in sequence.
- VirtualizedTabNavigation builds the next entry before Tab moves into it, so every card can be reached by keyboard.
- VirtualizedFocusRestore puts keyboard focus back on the same snapshot's button after a search, a refresh or a change of width.
- Entries carry PositionInSet and SizeOfSet, since a screen reader can no longer count the drawn siblings.

Observed reds, before the change (3000 snapshots, 400 removed, 1040x660 headless):
- Thousands_of_snapshots_open_in_the_cards_view_within_the_budget: "Opening History with the cards took 9091 ms; the budget is 1500 ms."
- Thousands_of_snapshots_open_in_the_list_view_within_the_budget: "Switching to the list took 9605 ms; the budget is 1500 ms."
- Narrowing_a_search_to_one_card_and_clearing_it_stay_within_the_budget: "Narrowing the search took 4297 ms; the budget is 1500 ms."
- Only_the_cards_near_the_screen_are_built: Assert.InRange (1 - 100), Actual 3008.
- Only_the_rows_near_the_screen_are_built_in_both_columns: Actual 4008.
- Only_the_removed_rows_near_the_screen_are_built: Actual 400.
After the change: cards 171 ms, list 12 ms, narrowing 8 ms, clearing 55 ms, opening Recently removed 4 ms.

Reds found while building it:
- A_card_with_focus_keeps_..._while_a_search_narrows: focus was null once the card sat in a new row.
- A_card_far_down_keeps_keyboard_focus_through_a_refresh: same.
- Tab_from_the_last_card_leaves_the_cards_instead_of_circling_back_into_them and The_cards_that_are_built_stay_in_the_order_of_the_list_after_jumping_to_the_end: with the stock panel, children came out 5,4,3 after a jump and Tab circled inside the list (TabOrderTests.History_cards_go_row_by_row: "Tab never came back round").
- A_short_list_is_drawn_in_full_so_the_screen_is_as_long_wherever_it_is_scrolled: Expected 794, Actual 887 with every removed list virtualized.

Tests that counted drawn cards now count the cards in view or use a tall window; ReflowTests finds the card rows' grids; ListSemanticsTests expects one list for all cards. Mutation checks done for the tests that passed first time (Tab, focus, positions, columns, row reuse).
Pure removal: SkipList no longer follows include lines and the rewrite no longer carries them. The tilde marker stays (windows.txt and linux-ci.txt use it). SkipCheckTests: 20 green before, 18 green after (the three include tests went, one list-from-disk test was added).
Routine compacting that another task preempts ends as a cancelled job with the preempted error, and Activity, the toast and the OS notification read it as 'Canceled' though the player canceled nothing. They now say it was stopped so the other task could go first.

Observed red: JobRowViewModelTests.Routine_packing_that_a_launch_stopped_is_called_stopped_not_canceled, Expected 'Stopped compacting snapshot files for Skyrim Speci...' Actual 'Canceled compacting snapshot files for Skyrim Spec...'. The toast and notification tests passed first time, so each was mutation-checked: the check made them fail with Actual 'Canceled compacting ...'.
The gate and the package build now both take ~/.savepoint-vm/heavy.lock besides their own folder lock, so they never run together on the 4-core VM; the second is refused at once with exit 75 and the holder named. Each run ends by removing SDKs and runtimes an install left behind (newest per major.minor stays) and NuGet packages with no file read or written in 30 days, plus stale download-cache entries. The driver labels a pass NARROWED only when gate.sh's log says so, so a report option alone is no longer called narrowed.
The footer's Not now button repeated the Not now card. The card stays (it explains what happens, can be the
preselected choice and is reached with the arrow keys); the footer keeps its one main button, and Escape still
leaves the saves alone. Default names of snapshots and profiles used a US numeric date ("Session - 7-8-26").
They now use the catalog language's date pattern with the year ("Session - Jul 8, 2026"), and a date separator
or other character a name could not carry on some system becomes a hyphen.

Observed reds:
- LaunchViewTests.The_post_play_dialog_offers_Not_now_once_while_another_choice_is_selected:
  Assert.Single() Failure: The collection contained 2 items (card title and footer button).
- UiFormatterTests.Default_names_never_hold_a_character_a_name_could_not_carry (fr, dd/MM/yyyy):
  Expected "08-07-2026", Actual "7-8-26"; Default_names_show_the_year_even_for_the_current_year:
  Expected "Jul 8, 2026", Actual "7-8-26".
- Choosing_the_Not_now_card_and_pressing_the_main_button passed first run (behavior kept); mutation check:
  with the Skip branch of SaveAsync emptied the test failed, then restored.
The folder open only knew whether the opener started. On Linux the open now watches xdg-open for up to three seconds, off the UI thread, and a non-zero exit reaches the existing open-folder failure toast. A program still running at the end of the watch is left alone, since it may be the file manager.

Observed reds: FileManagerTests.Linux_reports_an_opener_that_fails_right_after_it_starts (Assert.False, Expected False, Actual True); SystemProcessRunnerTests.A_watched_start_is_false_when_the_program_exits_with_an_error_at_once (Expected False, Actual True); GamesScreenOpenFolderTests.A_file_manager_that_starts_and_then_fails_is_reported (Assert.Single: the collection was empty).
The error card's drive shortening, the saves-folder shortcuts, the Steam start note and the library picker's GOG note compared UiFormatter.Os to 'windows' or 'linux'. UiFormatter now exposes OsKind (the text name stays only as the value messages select on) and those spots use it. No behavior change; the existing tests of the four spots stay green.

Observed red for the new accessor: UiFormatterTests.Code_tells_the_operating_system_apart_by_kind_not_by_the_catalogs_text, Expected Windows, Actual Linux.
The row's menu uses a pointer placement, so the Menu key and Shift+F10 opened it wherever the mouse last rested. A keyboard request has no pointer position, so the menu now opens below the focused row; a mouse open still shows at the pointer.

Observed red: GamesScreenViewTests.A_menu_opened_from_the_keyboard_sits_at_the_row_not_at_the_mouse_pointer (both keys), Assert.InRange Range (258 - 1017) Actual: 5. The right-click-after-keyboard test passed first time; the reset it guards turned out to be unneeded (a mouse open shows at the pointer whatever the placement says), which a mutation confirmed.
The Settings button was called "Run now" and showed nothing about what it does. It is now "Free up space",
and a line under the description says how many recently removed snapshots it would delete for good (or that
there are none). The count comes from the existing Free up space preview and is read when Settings opens and
after a run ends; when it cannot be read the line goes away and the button still works. The confirm dialog
that asks before deleting is unchanged. Core has no cheap estimate of the bytes that would come back, so the
line gives the snapshot count only.

Observed reds:
- StorageSectionFreeUpTests.The_row_says_before_anything_runs_how_many_recently_removed_snapshots_...:
  Expected "Free up space would delete 3 recently removed snap..." Actual "" (same for the singular, the
  none line and the re-read after a run).
- SettingsScreenViewTests.The_buttons_carry_their_labels: Assert.Contains() Failure: Item not found
  (button still read "Run now").
- A_count_that_cannot_be_read_... passed first run; mutation check: the failure branch returning "x"
  made it fail, then restored.
A larger size shrinks the page's viewport but keeps its scroll offset, so the choice the player just used could end up below the fold. Settings now brings the choice back into view after the layout of the new size, when it was on screen before; a size change made elsewhere does not move the page.

Observed red: MainWindowSmallScreenTests.Choosing_a_larger_size_keeps_the_size_choice_in_view(200), 'the size choice scrolled out of view: offset 0, 0, viewport 636, 450'. The 125 case passes both ways because its page still fits.
A player's own Free up space (one game or all games) that a launch preempts ended Cancelled with error.compaction.preempted and read Canceled. JobErrors.WasStoppedForAnotherTask now covers Compact as well as PackStorage, and the Activity title, shell toast and system notification pick new compactStopped / compactAllStopped keys.

Observed reds (assertion failures): JobRowViewModelTests.Free_up_space_for_one_game_that_a_launch_stopped_is_called_stopped_not_canceled expected 'Stopped freeing up space for Skyrim Special Edition so another task ...' actual 'Canceled freeing up space for Skyrim Special Editi...'; the all-games row, JobStatusViewModelTests toasts ('Canceled freeing up space for Satisfactory.', 'Canceled freeing up space.') and NotificationTextTests bodies failed the same way.
ListSync compared with ReferenceEquals, so the equal records that the card list rebuilds each pass were "moved" onto their own index. ObservableCollection raises a Move even at the same index, and the virtualizing panel treats it as remove plus insert, recycling every drawn row. It now compares with EqualityComparer<T>.Default, so an entry already in place is not touched.

The card list is one list to a screen reader: cards are numbered through both groups instead of restarting in each, each card's accessible name leads with its group ("Earlier: <name>, ..."), and the group headings carry heading level 2.

Recently removed capped its list at 340 px whatever its length; the cap now applies only to the long list that draws just the rows in view, so a list of 5 to 30 rows takes the room it needs.

The focus restore now also puts focus back on the snapshot's own control when focus survived the change inside the list but on another snapshot's control.

Observed reds before the fix:
- ListSyncTests.New_entries_equal_to_the_ones_shown_change_nothing: collection not empty, three Move events at indexes 0, 1, 2.
- ListSyncTests.Equal_entries_that_stay_are_not_moved_while_the_ones_around_them_come_and_go: DoesNotContain failed, Move events for a, c and d.
- HistoryVirtualizationTests.A_search_keeps_the_controls_drawn_for_the_lines_it_leaves_as_they_were: Assert.Same failed for "heading:Last 7 days" and "row:bulk-3".
- HistoryCardRowsTests.The_cards_are_numbered_through_the_whole_list_not_within_each_group: positions [..., 3, 4, 1, 2, 3, ...].
- HistoryCardRowsTests.A_search_numbers_the_cards_it_leaves_through_the_whole_list_again: [1, 2, 1, 2] instead of [1, 2, 3, 4].
- HistoryCardRowsTests.Each_card_names_its_group_ahead_of_itself_for_assistive_technology: name began "Before the final boss, ..." not "<group>: <name>".
- HistoryVirtualizationTests.Each_card_tells_assistive_technology_its_place_in_the_whole_list_and_the_group_it_is_in: position 2338 instead of 2509.
- HistoryVirtualizationTests.The_group_headings_are_headings_to_assistive_technology: heading level not 2.
- HistoryRecentlyRemovedViewTests.A_list_of_a_dozen_rows_is_drawn_in_full_with_no_scroll_bar_of_its_own: "the list is cut to 340 px of its 1236".
- HistoryVirtualizationTests.Focus_that_ends_up_on_another_snapshots_control_goes_back_to_the_snapshot_it_was_on: focused command was the other card's.

Passed on first run, checked by mutation: ListSyncTests.Entries_in_a_new_order_are_moved_into_it_and_stay_the_objects_that_were_shown (Move replaced by Insert: order came out [c, a, b, c]); HistoryRecentlyRemovedViewTests.Tab_into_the_rows_of_a_long_list_scrolls_the_screen_so_the_focused_row_shows (page scroll disabled: failed); A_long_list_scrolls_inside_its_section pins the long case the new style keeps.
The About section (log folder, license, notices), the startup card and the crash window used the synchronous Reveal, so an opener that starts and then fails (xdg-open with no handler on Linux) went unreported. Their commands are now async [RelayCommand]s over IFileRevealer.RevealAsync; the failure shows as a toast in Settings and as inline text on the startup card and crash window. The crash window also treats a throwing or faulting opener as a failed open. IFileRevealer.Reveal is removed since nothing uses it.

Observed reds (assertion failures): AboutLogFolderTests.A_file_manager_that_starts_and_then_fails_is_reported_in_words and SettingsScreenViewModelTests notices/license variants: Assert.Single() Failure: The collection was empty; StartupLogFolderTests.A_file_manager_that_starts_and_then_fails_is_reported_under_the_card: Assert.True() Failure (HasLogFolderError); CrashWindowTests.The_log_folder_button_opens_the_folder_and_says_so_when_it_cannot and A_file_manager_that_faults_is_reported_and_does_not_crash_the_window: Assert.True() Failure (failure text not visible), after the delegate type was changed to Task<bool> with a stub that ignored the result.
An apostrophe in a single-quoted string ended it early, so gate-linux.ps1 and package-linux.ps1 failed to parse. Observed: the VM gate stopped with 'Missing closing } in statement block' at gate-linux.ps1:142.
The footer under a game's storage figures read 'Canceled.' for a Free up space run that a launch stopped, while Activity, the toast and the notification already said it stopped so another task could go first. The footer also follows runs started from Settings. It now uses a new catalog key for a run recognized by JobErrors.WasStoppedForAnotherTask, and keeps 'Canceled.' for a real cancel.

Observed red: FreeUpSpaceViewModelTests.A_run_that_a_launch_stopped_says_it_stopped_so_another_task_could_go_first failed with Assert.Equal() Failure, Expected: 'Stopped so another task could go first.' Actual: 'Canceled.'
The guard test A_run_the_player_canceled_still_says_canceled_even_with_an_error_attached passed on its first run; with the condition mutated to 'job.Error is not null' it failed (Expected 'Canceled.', Actual 'Stopped so another task could go first.'), then the code was restored.
Merge issue-229-footer-stopped into integration-0918
Some checks failed
Docs / site (pull_request) Successful in 1m25s
Gate / linux (pull_request) Successful in 19m27s
Gate / windows (pull_request) Failing after 40m35s
0d8d6bfcf6
Release the settings hold on a condition, not a timer, in the read-back test
All checks were successful
Docs / site (pull_request) Successful in 1m26s
Gate / linux (pull_request) Successful in 19m38s
Gate / windows (pull_request) Successful in 42m20s
Docs / site (push) Successful in 1m21s
Release / linux (push) Successful in 2m13s
Release / windows (push) Successful in 2m54s
Release / checksums (push) Successful in 35s
90ee667a7e
A_settings_write_that_landed_but_cannot_be_read_back_leaves_the_storage_in_the_new_default
freed the held settings file after a fixed 1600 ms. The write's own read-back
retries for about 1.3 s, and the startup check's re-read starts only after that
gives up. On a slow runner the timer ran out during the write's retries, so its
read-back succeeded, the re-read path never ran, and the log had no "the
settings name" line.

Observed red (hold shortened to 1000 ms to stand in for a slow runner): the same
assertion as on CI, Assert.Contains() Failure: Filter not matched in collection,
at the "the settings name" line.

The hold is now freed when the log shows the write gave up ("the settings could
not be changed to"), so the re-read is always the first read to find the file
free. A 30 s deadline frees it if that line never comes.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ethan-hann/SavePoint!233
No description provided.