Repository navigation
Fix portable desktop QA: persist sort, loading state, tray, card names - #4
Merged
Merged
Conversation
Sort lived only in Tauri memory, so a restart always fell back to 最近入库. Save sort and layout into the existing %APPDATA%\GameLibrary\ui.json, and make the WPF writer merge instead of replacing that file. Cold start shows a loading state instead of an empty 0/0 library. Tray left-click restores the window, and game cards expose their titles to UI Automation. Co-authored-by: SlippyChimpMG <sumingwang@qq.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes the portable desktop findings from the v1.8.2 real-machine QA. Product version, packaging, and lockfiles are unchanged. Not merged.
GL-001 — fixed
Sort was only React state (
emptyFilters.sort = "accepted-desc"). Nothing wrote it, so after taskkill the toolbar always came back as 「最近入库」.It now uses the existing file
%APPDATA%\GameLibrary\ui.json(roaming AppData), the same document WPF already uses forleftWidth.load_ui_prefson startup, before the firstgames.list, so the list is not fetched with the default sort and then reordered.save_ui_prefson sort or layout change (not only on exit, so taskkill keeps it). The write merges into the current JSON.sort(accepted-desc/updated-desc/title-asc/title-desc) andlayout(grid/compact).leftWidthand any other existing fields are preserved.SaveUiPrefsused to replace the whole file with{ leftWidth }. It now merges.LoadUiPrefswas implemented but never called; the constructor calls it. WPF writessortonly if the key was already in the file or the user changed the selector, so closing the legacy window does not inventtitle-ascand override the Tauri default.Not persisted, on purpose: search, cover filter, tag, favorites, played, and custom view. Those change which games appear. Restoring them after restart looks like a missing library.
GL-002 — fixed
The dark rectangles in
43_after_relaunch.pngare the existing skeleton, but the toolbar still said0 / 0and the sidebar said 「没有正在使用的标签」 before the host answered.GL-003 — fixed, close-to-tray unchanged
Closing still hides the window and leaves Desktop/Host running when the setting is on (the default).
What was hard to find: Tauri's tray opens its menu on left click by default, which races the existing left-click handler that calls
show_main_window. Left click now restores the window. Right click still opens 「显示 GameLibrary」 / 「退出」. The tooltip is 「GameLibrary — 单击打开窗口」 (and the other three UI languages). The appearance setting explains left click, the right-click menu, and that starting the app again opens the running window.No balloon. Tauri 2.11's tray API has tooltip and menu, not a balloon, and a notification plugin would change
Cargo.lock.GL-004 — fixed
Grid cards are
listitem/articlenamed with the game title. The detail button keeps 「{标题},查看详情」 and now also has that string as text, because an empty button sometimes dropsaria-labelin WebView2. Compact rows are named with the title as well. Checkbox and launch labels were already title-based.GL-005 — not a bug in our strings
The attached
tree_06_sort_open.mdstores MenuBar / MenuItem as UTF-8系统(E7 B3 BB E7 BB 9F), notϵͳ. Later in the same run, settings labels also read 「系统」. The window is borderless (decorations: false); that system menu is provided by Windows / WebView2. Our Win32 calls use the*WAPIs, and the visible title is ASCIIGameLibrary. There is no code path that encodes 「系统」 through the ANSI code page. The occasional UIA misread is documented next to window setup. Window creation was left alone.Files
src/GameLibrary.Tauri/src/lib/uiPrefs.ts— parse and load/save the view prefssrc/GameLibrary.Tauri/src/lib/uiPrefs.test.ts— hydrate, and a late read must not erase a newer choicesrc/GameLibrary.Tauri/src/App.tsx— apply prefs before the first games query; pass loading into the toolbar and sidebarsrc/GameLibrary.Tauri/src-tauri/src/lib.rs—load_ui_prefs/save_ui_prefs, tray left-click and tooltip, GL-005 notesrc/GameLibrary.Tauri/src/components/LibraryToolbar.tsx— loading countsrc/GameLibrary.Tauri/src/components/SkeletonGrid.tsx— visible loading statussrc/GameLibrary.Tauri/src/components/Sidebar.tsx— do not call an in-flight tag list emptysrc/GameLibrary.Tauri/src/components/SettingsDialog.tsx— tray hintsrc/GameLibrary.Tauri/src/components/GameCard.tsx,GameGrid.tsx— accessible namessrc/GameLibrary.Contracts/Localization/ui.json— new loading string and the longer tray hint (zh-CN / zh-TW / en / ja)src/GameLibrary.Desktop/MainWindow.Lifetime.cs,MainWindow.xaml.cs,MainWindow.Library.cs— mergeui.json, actually load it, persist WPF sortChecks
npx vitest runinsrc/GameLibrary.Tauri: 28 files, 168 tests, passednpx tsc --noEmit: passedcargo test --libfor the Tauri crate (Rust 1.99, stub Linux sidecars used only to satisfyexternalBin, not committed): 9 tests passed, including theui.jsonmerge casesGameLibrary.Desktoptargetsnet10.0-windowsHuman QA
ui.jsonshould containsortplus the previousleftWidth.0 / 0and 「没有正在使用的标签」.ϵͳ, that matches the UIA note above. The visible UI should stay 「系统」.ui.jsonwith onlyleftWidthon exit.Note
Low Risk
Changes are mostly UI state, tray behavior, and merge logic for a local prefs file; no auth, host protocol, or data-loss paths beyond prefs merge edge cases with older WPF builds.
Reviewed by Cursor Bugbot for commit 50e3b5e. Bugbot is set up for automated code reviews on this repo. Configure here.