feat(qt): "Where you left off" reopens the exact page, its arguments and its tab
The startup pref only knew the last ROOT view: `last_view` lives in the ui_prefs.json the Slint build shares, whose vocabulary has no room for a detail, so a session closed on an album came back on Library > Releases. page_restore_qt keeps the page itself in a per-profile document (last_page_qt.json: root, view, args, state), written as the user moves. Openers that can rebuild their page record their arguments through the new nav_qt::record_with (album, artist, playlist, label and its releases, mixtape/collection detail, award and its albums, mix, artist releases, discover browse); the Settings section, the search query and tab and the purchased album are noted where they live; the mounted view's tab comes from QbzShell.reportNavState. At startup the shell mounts that page's view (no Home flash), the history is seeded with the page's root so Back leads there, and the session entry re-runs the opener — one-shot, behind the same gates as the local album restore (remember pref, crash chain, launcher link, kiosk), skipping catalog pages while offline and Purchases unless it is switched on. Pages only their opener could rebuild (scene, musician, disco builder, metadata editor) keep the previous restorable page on record; local albums stay with local_restore_qt. ContentRouter now reports the active tab of any view that has one and no richer state of its own (Discover, Library) and applies a Back/Forward destination's saved tab, so tabs survive both a restart and the history. cc
This commit is contained in:
1 parent
dae03e3834
commit
e278d931b7
13 files changed
+801
-35
No files matched your search
@@ -293,11 +293,13 @@ impl qbz_bridge::QbzBridge {
|
||||
crate::settings_string(key.to_string(), value.to_string());
|
||||
}
|
||||
|
||||
/// Purely bridge-local state — no crate handler, nothing to persist. The
|
||||
/// Slint global is not persisted either: Settings always opens on Audio,
|
||||
/// the section only has to survive a Loader unmount WITHIN a session.
|
||||
/// Bridge-local state with one reader outside: the section only has to
|
||||
/// survive a Loader unmount WITHIN a session (Settings opens on Audio),
|
||||
/// and it rides to page_restore_qt so "Where you left off" reopens
|
||||
/// Settings on the same section.
|
||||
pub fn settings_set_section(mut self: Pin<&mut Self>, index: i32) {
|
||||
if index == 11 && !crate::orbit_qt::enabled() { return; }
|
||||
crate::page_restore_qt::note_args("settings", serde_json::json!({ "section": index }));
|
||||
self.as_mut().set_settings_section(index);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user