mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 12:36:15 -08:00
fix(workspace): lead first-entry Back to the parent without the Navigation API
Review follow-ups (Greptile): - Without the Navigation API (older Safari and Firefox) back() always called Location.back(), so a page that opened the session still left the app. The service now tracks the router's in-app history depth there (trackRouterHistoryDepth): first navigation 0, push +1, replacement keeps it, a traversal restores the depth recorded for its entry. Depth 0 opens the parent; an unknown depth (an entry from before a reload) keeps Location.back(). - Stalker's Discover (movie/tv section), actor and search pages now have tests that they hand the service the parent under the portal :id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e7e61da5f3
commit
0a4f218f56
5 files changed
+320
-18
No files matched your search
@@ -171,8 +171,12 @@ were reached by navigation.
|
||||
Back is history Back calls `WorkspaceBackNavigationService.back(resolveParent)`
|
||||
instead of `Location.back()`. It runs `Location.back()` while the previous
|
||||
entry is an in-app one, by the same Navigation API test as the history
|
||||
fallback, and also when that is unknown because the API is missing: there a
|
||||
page reached in the app must not jump to its parent. Otherwise the page opened
|
||||
fallback. Without the API (older Safari and Firefox) the router's history
|
||||
depth decides (`trackRouterHistoryDepth`): the document's first navigation is
|
||||
depth 0, a push adds one, a replacement keeps it and a traversal restores the
|
||||
depth recorded for its entry. A traversal to an entry from before a reload
|
||||
leaves the depth unknown and keeps `Location.back()`, which then has a
|
||||
previous entry. Otherwise the page opened
|
||||
the session (a deep link, a reload or a restored view), where
|
||||
`Location.back()` does nothing in Electron and leaves the app in a browser.
|
||||
The service then navigates to the page's parent with `replaceUrl`, so history
|
||||
|
||||
Reference in new issue
Block a user