UI: session save/resume controls + resync status (#8) #12

Merged
pbwraith merged 2 commits from issue-8 into main 2026-08-26 09:14:19 +02:00

2 Commits

Author SHA1 Message Date
Claude
98d9c6f0d0 Fix review findings: expose netplay callbacks on AppWindow, use rfd::AsyncFileDialog, set is_host on lobby update
Some checks failed
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 8s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 4s
Rust-lint / lint-linux (pull_request) Failing after 18s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled
Finding 1: the Rust side calls on_netplay_resume_session,
on_netplay_save_session and set_netplay_is_host on AppWindow, but the
callbacks/property were only declared on the NetplayCreate/NetplayWait
sub-components. appwindow.slint now declares callback
netplay_resume_session(string), callback netplay_save_session and the
in-out property netplay_is_host <=> NetplayWaitData.is_host, and
forwards them at the NetplayCreate/NetplayWait instantiation sites,
matching the existing netplay callback pattern.

Finding 2: rfd::AsyncFilePicker does not exist in rfd 0.17; the crate
exports AsyncFileDialog (already used by this repo in src/ui/gui.rs).
Switch the resume file picker to rfd::AsyncFileDialog and use
FileHandle::path() for the display path.

Finding 3: set is_host from the ResponseSession lobby update instead of
at wait-window open, comparing the local player name against players[0]
(the session creator, always registered first). Re-evaluates on every
lobby update.
2026-08-25 22:19:56 -05:00
Claude
8e2c29039c UI: session save/resume controls + resync status (#8)
Add UI controls for the netplay session save/resume and resync
indicator features:

- netplay_create.slint: Add 'Resume Session...' button with file picker
  callback for .netplay-state files
- netplay_wait.slint: Add 'Save Session' button (host only, gated by
  is_host property), add resyncing indicator badge
- netplay_page.slint: Add resyncing property to NetplayData global
- src/ui/netplay.rs: Wire on_netplay_resume_session callback (opens
  file picker, placeholder for #3 flow), on_netplay_save_session
  callback (placeholder for #3 flow), set is_host on wait window setup

The save/resume callbacks show placeholder messages until #3 is
implemented. The resync indicator shows during ResyncState != Idle.

Closes #8
2026-08-25 22:19:56 -05:00