A link to only a view opens with the opening too, stopping at that view

The app writes its view into the address, so a reload or a bookmark is a
share link and opened without the opening. A start-up share whose camera
landed and that follows or selects nothing now plays it as well, ending
where the link points; the share restore says when the share is of a thing.

The flight turns to the target's heading and pitch over its last part, so a
view at an angle is reached without a jump. A camera held in a target's
frame plays no opening.
This commit is contained in:
German Khokhlov committed 2026-11-23 16:08:30 +04:00
1 parent 9088c01d1a
commit 31ce6cbf79
6 files changed
+120 -25

No files matched your search

+21 -5
View File
@@ -32,12 +32,14 @@ export function startApplicationChrome({
.catch(() => {
/* Restoration reports its own outcome through the controls. */
})
.then(() => {
.then(([restored] = []) => {
if (disposed || signal.aborted) return;
// A bare address opens with the opening; welcome waits for its end.
opening = styleManager.hasShareState
? null
: playOpening?.({ viewer: styleManager.viewer, loadingScreen });
// A bare address, or a share of only a view, opens with the opening
// (it ends where the camera stands); welcome waits for its end.
opening =
!styleManager.hasShareState || sharesOnlyAView(restored)
? playOpening?.({ viewer: styleManager.viewer, loadingScreen })
: null;
if (opening) {
void opening.done.then(revealFirstRun);
return;
@@ -66,3 +68,17 @@ export function startApplicationChrome({
(await keySetup.catch(() => null))?.destroy();
};
}
/**
* Whether a start-up share restore left only a view: the camera landed where
* the link points and nothing is followed or selected for it.
*/
function sharesOnlyAView(restored) {
return (
restored?.status === 'settled' &&
restored.share?.camera === 'applied' &&
restored.tracking?.status === 'skipped' &&
restored.tracking.reason === 'no-shared-target' &&
!restored.thing
);
}