Recover browse navigation when the focused object dies unseen

When a page removed the focused object before any navigation adopted it
(Steam's loading spinner after a popup closes), every browse key failed
with "Could not find current location" until focus moved natively. The
dead focus was never a saved place, so the existing anchor fallback did
not apply. Recapture through the most recent retained documents of the
same provider (at most two) and keep that document's reading place.

Document start and end now choose again once when their target died
before placement; they are idempotent, unlike relative moves.

Verified live in Steam Big Picture and ChatGPT.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Storm DragonandClaude Opus 5.5 committed 2026-12-01 02:52:44 -05:00
1 parent 87b6aa49da
commit 7b4fca03bf
5 files changed
+234 -12

No files matched your search

+12 -4
View File
@@ -99,7 +99,15 @@ items spoke in focus mode. Automated: `TestSteamOverlayFocusMatchesForegroundPro
`TestToastDocument`, and the native `TestNativeWebScriptNotificationCapture`.
The toast restriction has not yet been checked against a real toast.
Known remaining issue: when Steam replaces page content (for example the
RECOMMENDED tab), browse-mode navigation can fail with "Could not find
current location" because the remembered native focus no longer exists and
`DocumentCursor.syncFocus` does not fall back to the reading place.
Popup documents are announced by name ("Quick Access", "Main Menu") rather
than Steam's internal `QuickAccess_uid2`, and Quick Access tabs without an
aria-label (Friends) are named from their `quickaccess_tab_<n>` id.
When Steam replaces page content, the remembered native focus can die before
any navigation adopts it (its loading spinner after a popup closes). The review
worker then recaptures through the most recent retained document of the same
provider and keeps that document's reading place, instead of failing with
"Could not find current location". Document start and end choose again once
if their target died before placement. Verified live on 2026-12-01 in Steam
and ChatGPT; covered by `TestDeadFocusNeverSavedRecoversThroughRetainedDocument`
and `TestDocumentStartChoosesAgainWhenFirstObjectDies`.