feat(frontend): focus the returned file when leaving the viewer
Closing the viewer (or returning via a deep-link ?anchor=) already scrolled the grid back to the file you were on, but the keyboard roving-focus stayed unset, so the next arrow press jumped to the top. Both return paths now place the focus on that file and show the ring, so arrow navigation resumes exactly where you left off. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -353,6 +353,9 @@
|
||||
const anchor = page.url.searchParams.get('anchor');
|
||||
if (anchor) {
|
||||
scrollToFile(anchor);
|
||||
// Pre-focus the anchor file so keyboard navigation resumes from it.
|
||||
focusedId = anchor;
|
||||
kbActive = true;
|
||||
consumeAnchor();
|
||||
return;
|
||||
}
|
||||
@@ -709,6 +712,10 @@
|
||||
const target = lastOverlayId;
|
||||
lastOverlayId = null;
|
||||
scrollToFile(target);
|
||||
// Land the keyboard roving-focus on the file we came back from, so arrow
|
||||
// navigation continues from there (and the ring marks where you were).
|
||||
focusedId = target;
|
||||
kbActive = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user