0.9.7: say when a game was never seen, rank the start-file list, Linux apps menu entry, test cleanup #99

Merged
ethan-hann merged 20 commits from integration-099 into main 2026-10-24 21:52:54 -05:00
Owner
  • When the program name never shows up (#62): a session now records how it ended. A link start (or a started program that quit within the relaunch window) whose program name never appeared shows "SavePoint didn't see the game running" with no play time; a started program that ran but whose name never matched keeps its real play time and gets a softer hint; an unreadable process list blames nothing. The dialog offers Open Edit game (the new changes stay as they are), and with the after-play dialog off a toast says it once. The wording uses the editor's own term, the game's program name.
  • Start-file list ranking (#58): the editor's program list uses the same ranking as the process-name suggestion, asks again when the game's name changes, and never replaces the player's own choice.
  • Linux apps menu entry (#83): Settings offers Add / Update / Remove for a desktop entry and icons in the user's own data folder, only when SavePoint runs from an AppImage (APPIMAGE plus APPDIR); never touches an entry it did not write; TryExec hides the entry when the AppImage is gone.
  • Test cleanup (#24, #36): the main window and toast host are disposable, so finished journeys stop posting to later tests; test names no longer say mockup.
  • Flaky test: a FakeGame test read a save before the game closed it, which failed once on the slower Windows CI VM.
  • Version 0.9.7. The tag will be the first run of the release workflow.

Each feature branch had an Opus review; the findings are fixed here. Docs (D13, D26, D48.7, architecture, user guide, Linux test checklist) updated.

Closes #62
Closes #58
Closes #83
Closes #24
Closes #36

- **When the program name never shows up (#62):** a session now records how it ended. A link start (or a started program that quit within the relaunch window) whose program name never appeared shows "SavePoint didn't see the game running" with no play time; a started program that ran but whose name never matched keeps its real play time and gets a softer hint; an unreadable process list blames nothing. The dialog offers Open Edit game (the new changes stay as they are), and with the after-play dialog off a toast says it once. The wording uses the editor's own term, the game's program name. - **Start-file list ranking (#58):** the editor's program list uses the same ranking as the process-name suggestion, asks again when the game's name changes, and never replaces the player's own choice. - **Linux apps menu entry (#83):** Settings offers Add / Update / Remove for a desktop entry and icons in the user's own data folder, only when SavePoint runs from an AppImage (APPIMAGE plus APPDIR); never touches an entry it did not write; TryExec hides the entry when the AppImage is gone. - **Test cleanup (#24, #36):** the main window and toast host are disposable, so finished journeys stop posting to later tests; test names no longer say mockup. - **Flaky test:** a FakeGame test read a save before the game closed it, which failed once on the slower Windows CI VM. - **Version 0.9.7.** The tag will be the first run of the release workflow. Each feature branch had an Opus review; the findings are fixed here. Docs (D13, D26, D48.7, architecture, user guide, Linux test checklist) updated. Closes #62 Closes #58 Closes #83 Closes #24 Closes #36
A link start whose process name never matches ends after the grace, and nothing said why. SessionState.Exited now carries the SessionEndKind the watcher settled on, so the app can tell a wrong name from a game that ran.

Observed red: LaunchSessionEndKindTests.A_process_name_that_never_appears_is_recorded_on_the_exit failed with Expected: NamedProcessNeverAppeared, Actual: ChildExited (property added, not yet filled in).
The ran-normally test passed on its first run; hardcoding NamedProcessNeverAppeared in the orchestrator made it fail (Expected: ChildExited, Actual: NamedProcessNeverAppeared), then restored.
When a link start's process name never matches, the dialog said the player played for the length of the wait. It now titles the session as not seen running, shows no play time, explains that the process name is probably wrong, and offers a button that opens Edit game. The button answers the dialog with Not now, so the saves stay as new changes.

Observed reds: PostPlayDialogViewModelTests.A_session_whose_program_was_never_seen_does_not_claim_any_play_time_and_points_at_the_process_name failed with Expected: SavePoint didn't see the game running, Actual: You played for 2 hours 14 minutes; Opening_Edit_game_from_the_hint_leaves_the_saves_alone_and_asks_for_the_editor failed with Expected: 1, Actual: 0.
First-run passes mutation-checked: forcing the hint on made A_session_that_ran_shows_its_length_and_no_process_name_hint fail; passing no editor action from the flow made LaunchFlowSessionTests.The_hint_after_a_program_that_was_never_seen_opens_Edit_game_and_keeps_the_saves_for_later fail. Both restored.
ProcessNameSuggester.Rank returns all programs best first, sharing the scoring the suggestion uses; programs the suggester would never offer follow in depth then size order instead of being dropped.

Observed reds (Rank returning the input order): The_ranking_puts_the_game_first_and_a_large_launcher_behind_the_real_candidates failed with Expected Game.exe, Actual Launcher.exe; The_game_name_ranks_the_matching_program_first_when_the_folder_name_does_not failed with Expected Skyline.exe, Actual Zeta.exe; A_folder_where_nothing_scores_well_still_lists_every_program_in_depth_then_size_order failed with Expected Setup.exe, Actual a\b\c\Deep.exe; The_ranking_and_the_suggestion_agree_on_the_game failed with Expected Game.exe, Actual Launcher.exe.
A plain AppImage that nothing has integrated shows a generic gear in the
GNOME dash because no desktop entry exists. Settings now has an "Apps
menu" section, shown only on Linux when APPIMAGE names the running file.

AppsMenuEntry writes $XDG_DATA_HOME/applications/savepoint.desktop
(Exec pointing at the AppImage, StartupWMClass=SavePointApp,
Categories=Utility;, X-SavePoint-Managed=true) and the 256 and 512 px
icons under icons/hicolor/<size>/apps. It never overwrites or removes a
desktop entry or icon that lacks the marker, undoes a failed add, treats
an entry for a moved AppImage as out of date (Update action), and runs
update-desktop-database and gtk-update-icon-cache on the user's own
folders only, ignoring a missing tool or a failure. The 512 px icon is
now bundled as an Avalonia resource so it can be installed.

Observed reds before the code existed (stubs returned wrong answers):
- AppsMenuEntryTests.Adding_writes_a_desktop_entry_with_exactly_these_fields:
  Assert.Equal() Failure, Expected: Done, Actual: Failed
- AppsMenuEntryTests.An_entry_someone_else_wrote_is_never_overwritten_or_removed:
  Expected: Foreign, Actual: NotAdded
- AppsMenuEntryTests.The_caches_are_refreshed_...: Expected: 4, Actual: 0
- AppsMenuEntryTests.The_data_folder_is_XDG_DATA_HOME_...: Expected the
  path, Actual: ""
- AppsMenuSectionTests.Before_anything_is_added_...: StatusText Expected
  "SavePoint isn't in your apps menu yet.", Actual: ""
- AppsMenuSectionTests.A_folder_that_cannot_be_written_...: Expected the
  failure text, Actual: null
- AppsMenuSectionTests view tests: No StackPanel named AppsMenuSection
  (a missing-control error, not an assertion)
Mutation checks on the tests that passed first time: a failed add
returning Done fails 2 tests, GetState creating a folder fails 1,
skipping the rollback fails A_write_that_fails_part_way_undoes_a_new_entry,
IsAvailable always true fails 2.
The start-file suggestions were ordered by folder depth and size, so a larger launcher or a crash reporter could come first. ExecutableScanner now orders its list with ProcessNameSuggester.Rank, and the list call takes the game's name as a ranking hint. Launchers and tools still follow the game, so a player who needs one can pick it. A program the player already chose is left alone.

Observed red: ExecutableScannerTests.The_games_own_program_comes_before_a_larger_launcher_and_a_crash_reporter_in_the_same_folder failed with Expected: Skyline.exe, Actual: Launcher.exe (first run with the old ordering).
Two older scanner tests asserted the old depth then size order or a fixed mixed-kind order; they now compare to the shared ranking and ignore order across kinds.
First-run passes mutation-checked: asking with an empty game name failed The_program_list_is_asked_for_with_the_games_name_so_the_service_can_rank_by_it; filling ExePath from the first result on a rescan failed A_program_the_player_already_chose_stays_when_the_suggestions_are_refreshed. Both restored.
The destructive section stays last before About, so a click aimed at the apps menu buttons never lands next to it. Moved only; no behavior changed, checked on the Linux VM (add, out-of-date, update, remove) and by the settings view tests.
- Trust APPIMAGE only when APPDIR is set and this process runs from
  under it, so a variable inherited from another AppImage's terminal or
  an extracted copy never points the entry at the wrong program.
- The entry's Comment comes from the catalog (settings.appsMenu.entryComment).
- Run gtk-update-icon-cache only when the user's icon-theme.cache
  already exists; otherwise touch the hicolor folder. The cache file is
  never created.
- An icon size the app does not carry fails the add instead of leaving
  an entry that never reads as current.
- Icons left behind without an entry count as not added: an add
  overwrites them and a remove cleans them. The foreign-entry text no
  longer shows the technical name, and the failure text no longer says
  "home folder".
- Temporary files get a random name, are created with CreateNew, and are
  deleted when a write fails.
- The entry is read only when it is a regular file of at most 64 KB; a
  folder or reparse point there is treated as someone else's.
- Add TryExec so desktops hide the entry when the AppImage is gone; it
  is part of the up-to-date check.
- Write the icons first and the entry last, so a failed update keeps
  the entry that was working.

Observed reds (assertion failures):
- Adding_writes_a_desktop_entry_with_exactly_these_fields: index 5
  expected TryExec=..., actual Icon=savepoint
- The_variable_is_trusted_only_when_this_process_runs_from_the_mounted_AppImage_folder:
  Assert.Null, actual AppsMenuEntry
- An_icon_size_the_app_does_not_carry_fails_the_add_...: Expected Failed,
  Actual Done
- Without_a_cache_file_none_is_created_...: gtk-update-icon-cache ran
- An_entry_file_over_64_KB_...: Expected Foreign, Actual OutOfDate
- A_folder_where_the_entry_belongs_...: Expected Foreign, Actual NotAdded
- Icons_left_behind_without_an_entry_...: Expected NotAdded, Actual Foreign
- Removing_cleans_icons_left_behind_...: Expected Done, Actual Foreign
- A_write_that_fails_part_way_..._no_temporary_files: temp file left
- A_failed_update_keeps_the_entry_that_was_working: Exec had changed
- The_comment_is_the_text_the_caller_gives: Comment not found
- An_entry_without_the_try_exec_line_is_out_of_date: Expected OutOfDate,
  Actual Added

Mutation checks on tests that passed first time: remove failure
reported as Done, remove skipped for out-of-date, bundled icon path
broken, control-character guard removed, backtick and backslash escapes
removed, VM comment hardcoded. Each failed the matching test; all
restored.
The session end now has two more kinds. NamedProcessNeverMatched: the program SavePoint started ran past the relaunch window and its name never showed up within the grace; the run is the play time and the end is the program's exit. ProcessListUnreadable: the list could not be read at any look during the grace. An unreadable list after a long run ends as the program's exit, with no hint. A program that exits within the relaunch window and never matches is still not seen.

The after-play dialog uses the editor's words (the game's program name), keeps the play time for a name that never matched with a softer hint, and for an unreadable list says SavePoint could not check which programs were running and offers no editor button. The slow-launcher hedge mentions two minutes. With the dialog turned off, an info toast says once that the game was not seen or its name never matched.

The editor asks again when the game's name changes (on leaving the name field), because the service ranks by file sizes the editor does not hold. ExecutableScanner.ListAsync takes the game name before the cancellation token.

Observed reds: GameSessionWatcherTests.The_grace_is_counted_from_the_stubs_exit_and_not_while_the_program_is_alive expected NamedProcessNeverMatched, actual NamedProcessNeverAppeared; A_list_that_stays_unreadable_for_the_whole_grace_settles_as_unreadable expected ProcessListUnreadable, actual NamedProcessNeverAppeared; A_list_that_could_not_be_read_for_the_grace_after_a_long_run_ends_at_the_programs_exit... expected ChildExited, actual NamedProcessNeverAppeared. PostPlayDialogViewModelTests: unreadable title expected the couldn't-tell title, actual You played for 2 hours 14 minutes; never-matched hint expected text, actual empty; the not-seen hint expected the new wording. LaunchFlowSessionTests toast theory (both kinds) found no toast. GameEditorLaunchTests.Renaming_the_game_ranks_the_programs_again... expected 2 asks, actual 1.
First-run passes mutation-checked, each failing then restored: late handover after a long run, quick exit stays never-appeared, readable look during the grace (watcher: window check dropped, readable made non-sticky, immediate settle added); no toast for a normal exit and the toast fix (condition forced); the folder-read failure keeping the end kind (catch path forced to ChildExited); the game name deciding the order in GamesApi (name dropped) and ExecutableScanner (name dropped); the scanner ordering test (old depth order) and the stay-put test (ExePath filled from the first result).
A toast host kept its countdown timers running after the app or a test was
done with it, so a late timer posted a dismissal to the UI thread inside a
later test. ToastHostViewModel and MainWindowViewModel now implement
IDisposable. The host stops and drops its timers, ignores a dismissal that
was already queued, and arms nothing afterwards. The window view model
unsubscribes from the startup, dialog and shell events, builds no shell
after disposal, and disposes the shell and the toasts it owns. The app
disposes it on exit; the test rigs and journeys dispose it too.

Observed reds (assertion failures, with a no-op Dispose in place):
- A_disposed_host_posts_nothing_when_a_timer_runs_out: Expected 0, Actual 1
- A_toast_shown_after_disposal_starts_no_timer: Expected 0, Actual 1
- Releasing_a_pause_after_disposal_starts_no_timer: Expected 0, Actual 1
- A_dismissal_posted_before_disposal_does_nothing_when_it_runs_late:
  Assert.Single() Failure: The collection was empty
- Disposing_the_window_stops_the_toast_timers: Assert.Single() Failure:
  The collection was empty
- A_disposed_window_builds_no_shell_when_the_checks_pass_late:
  Assert.Empty() Failure: Collection was not empty
The two "disposing twice is harmless" tests passed on the stub and guard a
contract no throw-free implementation can break.
The test fakes and several tests still named the first design drawings:
MockupScenario, ScenarioBuilder.Mockup(), FakeBackend.Mockup(),
HistoryRig.MockupZone, MockupTableTests, _mockupGold, about ten test
method names, and the screen numbers (2a, 3b and so on) that started the
render file names. They now say SampleScenario, Sample(), SampleZone,
ReadmeTableTests, _referenceGold, and describe the behavior; render files
are named after the screen. No production code used any of these names and
no behavior changes, so there is no new red. Render output is not checked
in. The numbered journey renders (1a to 7b) are step numbers and stay.
The test waited for the file to exist and then read it, but the fake
game may still have it open for writing. On the slower Windows CI VM
the read failed with 'The process cannot access the file ... being
used by another process' (run 49, save-0002.sav). The game prints
'saved <name>' after closing the file, so the test waits for that.
Version 0.9.7
Some checks failed
Gate / linux (pull_request) Successful in 12m10s
Gate / windows (pull_request) Successful in 25m16s
Release / linux (push) Failing after 46s
Gate / linux (push) Successful in 12m30s
Gate / windows (push) Successful in 25m54s
Release / windows (push) Failing after 30s
Release / checksums (push) Has been skipped
e7e2752fe8
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!99
No description provided.