Skip to content

Fix portable desktop QA: persist sort, loading state, tray, card names - #4

Merged
sumingwang233 merged 1 commit into
mainfrom
cursor/fix-desktop-qa-findings-b1dd
Nov 5, 2026
Merged

sumingwang233 merged 1 commit into
mainfrom
cursor/fix-desktop-qa-findings-b1dd

Conversation

@sumingwang233

@sumingwang233 sumingwang233 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

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 for leftWidth.

  • Load: Tauri command load_ui_prefs on startup, before the first games.list, so the list is not fetched with the default sort and then reordered.
  • Save: save_ui_prefs on sort or layout change (not only on exit, so taskkill keeps it). The write merges into the current JSON.
  • Allowed keys from Tauri: sort (accepted-desc / updated-desc / title-asc / title-desc) and layout (grid / compact).
  • leftWidth and any other existing fields are preserved.
  • WPF SaveUiPrefs used to replace the whole file with { leftWidth }. It now merges. LoadUiPrefs was implemented but never called; the constructor calls it. WPF writes sort only if the key was already in the file or the user changed the selector, so closing the legacy window does not invent title-asc and 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.png are the existing skeleton, but the toolbar still said 0 / 0 and the sidebar said 「没有正在使用的标签」 before the host answered.

  • Skeleton announces 「正在加载游戏库…」.
  • The count shows 「正在加载…」 until the first page returns.
  • The tag list shows 「正在加载…」 while metadata is in flight, and only then 「没有正在使用的标签」 if the library really has none.
  • The games query waits until view prefs have loaded, so the first paint is not a finished empty library.

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 / article named with the game title. The detail button keeps 「{标题},查看详情」 and now also has that string as text, because an empty button sometimes drops aria-label in 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.md stores 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 *W APIs, and the visible title is ASCII GameLibrary. 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 prefs
  • src/GameLibrary.Tauri/src/lib/uiPrefs.test.ts — hydrate, and a late read must not erase a newer choice
  • src/GameLibrary.Tauri/src/App.tsx — apply prefs before the first games query; pass loading into the toolbar and sidebar
  • src/GameLibrary.Tauri/src-tauri/src/lib.rs — load_ui_prefs / save_ui_prefs, tray left-click and tooltip, GL-005 note
  • src/GameLibrary.Tauri/src/components/LibraryToolbar.tsx — loading count
  • src/GameLibrary.Tauri/src/components/SkeletonGrid.tsx — visible loading status
  • src/GameLibrary.Tauri/src/components/Sidebar.tsx — do not call an in-flight tag list empty
  • src/GameLibrary.Tauri/src/components/SettingsDialog.tsx — tray hint
  • src/GameLibrary.Tauri/src/components/GameCard.tsx, GameGrid.tsx — accessible names
  • src/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 — merge ui.json, actually load it, persist WPF sort
  • Tests next to the components above

Checks

  • npx vitest run in src/GameLibrary.Tauri: 28 files, 168 tests, passed
  • npx tsc --noEmit: passed
  • cargo test --lib for the Tauri crate (Rust 1.99, stub Linux sidecars used only to satisfy externalBin, not committed): 9 tests passed, including the ui.json merge cases
  • WPF / solution build: not run. This environment has no .NET SDK, and GameLibrary.Desktop targets net10.0-windows

Human QA

  • Set 排序方式 to 「名称 A→Z」, taskkill Desktop / Host / TauriBridge, relaunch, wait for 「全部游戏 506」. The sort should still be 「名称 A→Z」, and ui.json should contain sort plus the previous leftWidth.
  • Switch to compact layout, restart, confirm it sticks. Confirm search and 封面筛选 do not.
  • Cold start should show 「正在加载游戏库…」 / 「正在加载…」, not a settled 0 / 0 and 「没有正在使用的标签」.
  • Close the window: left-click the tray icon restores it; right-click still has 显示 and 退出; starting the app again still focuses the running window.
  • A card should be findable in UIA by the game title.
  • If the system menu still occasionally reads as ϵͳ, that matches the UIA note above. The visible UI should stay 「系统」.
  • An old installed WPF build that has not picked up this change can still overwrite ui.json with only leftWidth on exit.
Open in Web Open in Cursor 

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.

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>
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
gamelibrary-website Ready Ready Preview Nov 5, 2026 12:36am UTC

@sumingwang233
sumingwang233 merged commit fe5a2ba into main Nov 5, 2026
9 checks passed

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Cursor Bugbot completed successfully and reported no findings that need human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants