Repository navigation
Conversation
…e-controls Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LCjpD3ehigLiUGH1oVQQAW
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.
Timeline controls: zoom, keyboard and wheel navigation, dock button; caption actions follow keyboard focus
Closes #127, closes #128, closes #134.
Everything here is in the caption editor (subtitle mode), where the Timeline and the per-caption action tray live.
Since these are new features, should wait for a proper feature release.
What changes for the reader
Timeline
+and-, zoom in and out;0resets. Ctrl/Cmd with these keys is left to the browser's own zoom.aria-valuetextis what assistive technology gets.hover: none). The dock button does what the grip does, for whoever cannot drag.Caption actions
scribe-user-is-tabbingbody class) and the caret is in that caption, or one of its timestamps has focus. With a mouse nothing changes, so there is never a second tray on screen for the caption the caret is in.Visible changes (appearance)
[tabindex]).How it is built
seekTo()is the one place the playhead is moved from, for the keyboard and the wheel alike: the strip moves at once, the player is told once per frame, and it is clamped to the recording.follow()ignores the player while a move is waiting.role="slider", a name,aria-valuemin/max/nowandaria-valuetextin words ("0:12.3 of 5:00, in caption 14"). The value is not updated every frame: only on a move the reader made, when the recording stops or lands somewhere, and on focus, so a screen reader is not talked at while the recording plays.role="toolbar"with one tab stop and arrow keys between the buttons, like the caption actions. Icons only, so every button has anaria-label. The dock button has a fixed name andaria-pressed. A button at the end of its range isaria-disabled, notdisabled, so it keeps focus. Zoom and dock changes are told to a polite status region.body, and a moved node loses focus, sotoggleDock()puts focus back on the button afterwards.holdSwipe()/releaseSwipe()setoverscroll-behavior-x: noneon<html>and<body>while the pointer is over the strip (overscroll-behaviorhas no effect on the strip itself, which is not a scroll container).WCAG: 2.1.1 (the dock and the playhead were mouse only), 1.1.1 and 4.1.2 (the strip had no name, role or value), 2.5.7 (WCAG 2.2, a keyboard alternative to dragging the playhead), 2.4.7.
Tests
tests/test_speech_timeline.py,tests/test_caption_editor_styles.py). Two old tests that fixed the earlier design were rewritten: "the zoom is not a control" and the labelled button's style.createatplayhead, and docking with focus returned. That harness is not part of the repository.main(8b5d52c) already fails three tests intests/test_validation.py::TestAddingACaptionForSpeech('Transcript' object has no attribute 'editor', from the clamp in 2669077). They are not touched here; this branch adds no failures.Tried in a browser, and not
Tried by hand in Chrome against a dev server (sample subtitles, a 1920 px wide window): keys, zoom (Shift + Up/Down), sideways wheel in both directions, the tray and its reveal on hover, adding a caption where one already is, the ruler at several zooms, in dark mode and docked (contrast measured: about 9.4:1 light and 10:1 dark against the strip), dragging the grip in both directions, and (by Erik, on a trackpad) a backward swipe over the strip, which no longer goes back to the previous page. The placeholders measured 182 px along the foot against the docked strip's 183, and the strip's legend does not change height while the grip is held. The placeholder under the video uses the height the strip measured there, or 180 px (what it measures at the default text size) if the page opened docked.
Not tried: a screen reader (NVDA/VoiceOver on the slider and the tray); a tablet (a tap should leave
:hoverin place and show the tray); the legend at 701 px; narrow windows for the ruler and the placeholders; whether the step sizes feel right on long real recordings; and the keyboard-modality reveal of the tray together with hover. Tooltips on the tray buttons are hover-only, as on the caption actions; the names are inaria-label.