Repository navigation
feat(viewer): tell the handler when its file is on screen - #156
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #156 +/- ##
==========================================
+ Coverage 92.64% 92.71% +0.07%
==========================================
Files 51 51
Lines 4229 4270 +41
Branches 943 951 +8
==========================================
+ Hits 3918 3959 +41
Misses 288 288
Partials 23 23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
skjnldsv
force-pushed
the
feat/focus-shown-file
branch
2 times, most recently
from
October 20, 2026 10:06
4e6053a to
c8f0377
Compare
skjnldsv
force-pushed
the
feat/focus-shown-file
branch
from
October 21, 2026 07:40
dff873e to
b71bfe1
Compare
A handler that wants its own content focused, an editor's text say, watches the new shown prop: true once the file has loaded and is on screen, where in onMounted its element is still hidden. When comparing, only the newer file's element gets it. The viewer gives the keyboard back to what opened it on close if nothing has it: a handler that focused before the modal's focus trap started left the trap nothing to give back. The before-download example now declares what it uses. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
v-show lifts its display: none at the end of the update, after the handler had already been told: a handler focusing its content then focused nothing. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
A video or a sound gives it to its skin, so Space, m, j, l and the volume keys reach the player while the arrows still step through the files. The skin rather than its container: the modal's focus trap takes back a focus in a shadow root found before it started. Image differences give it to the slider, which the arrows then move. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
skjnldsv
force-pushed
the
feat/focus-shown-file
branch
3 times, most recently
from
October 21, 2026 08:29
8c46bc6 to
6b5ade3
Compare
Whether a sound plays depends on a sound device: check the player was asked to play or pause it instead. Firefox without one, as in CI, plays nothing and its player takes no shortcut then, so the check is skipped there. Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
skjnldsv
force-pushed
the
feat/focus-shown-file
branch
from
October 21, 2026 08:29
6b5ade3 to
00e1211
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Handlers get a new
shownprop: true once their file has loaded and is on screen. A handler that wants its own content focused (an editor's text, say) can watch it, since inonMountedthe element is still hidden. When comparing, only the newer file gets it.On close, focus goes back to whatever opened the viewer, even if a handler took it before the modal's focus trap started.
The builtin handlers use it: videos and sounds give the keyboard to their player, image differences to their slider.
Fixes nextcloud/viewer#860
👾 This pull request was assisted by Claude Code, commits carry an
Assisted-bytrailer.