feat(annotator): jump to a clip by number - #106
Merged
Conversation
Reviewing a flagged subset means arriving with a list of clip numbers in hand. The window could only step one clip at a time, so reaching clip 812 of 1160 meant holding an arrow key, and there was no way to confirm you had landed on the right one. Adds a go-to box to the nav row: type a number, press Enter, jump. Ctrl+G focuses it with the value selected, so a number can be replaced without clearing it first. Counting starts at 1, matching the sidebar's "clip N / M" rather than introducing a second convention. The box is also a position readout -- it follows prev/next, skip and labelling, not just typing in it -- and shows the clip total beside it, which the nav row never displayed. Out-of-range clamps instead of refusing: a number carried over from a stale queue should still land somewhere useful. Jumping persists the current trim first, the same guarantee prev/next give, so a jump cannot silently drop an adjustment to the clip being left. The index arithmetic is a module-level clamp_clip_index() rather than a method, so it is testable without a display -- the convention the rest of the annotator's logic already follows. Deliberately knows nothing about any particular review queue. It is plain navigation, so it stays useful for every labelling job rather than one.
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.
What
Reviewing a flagged subset means arriving with a list of clip numbers in hand.
The annotator could only step one clip at a time, so reaching clip 812 of 1160
meant holding an arrow key — and there was no way to confirm you had landed on
the right one.
Type a number, press Enter, jump. Ctrl+G focuses the box with the value
selected, so a number can be replaced without clearing it first.
Details
Counts from 1, matching the sidebar's existing
clip N / Mrather thanintroducing a second convention next to it.
It is a position readout too — the box follows prev/next, skip and
labelling, not only typing in it. The clip total sits beside it, which the nav
row never showed.
Out-of-range clamps rather than refusing. A number carried over from a
stale queue should still land somewhere useful instead of erroring.
Jumping persists the current trim first, the same guarantee prev/next
already give. Without it a jump would silently drop an adjustment to the clip
being left, which is the kind of loss you notice much later.
editingFinished, notvalueChanged— otherwise typing "47" would stopoff at clip 4 on the way.
Scope
It knows nothing about any particular review queue or CSV. This is plain
navigation, so it stays useful for every labelling job rather than one
workflow.
Tests
12 cases. The index arithmetic is a module-level
clamp_clip_index()ratherthan a method so it is testable without a display — the convention the rest of
the annotator's logic already follows. Covers 1-based↔0-based mapping, clamping
above and below range, the empty-clip-list case returning
None(distinct from"go to the first one"), and at the widget level: jumping, clamping, the box
tracking other nav controls, range matching the clip count, trim persisted
before the jump, an empty list not crashing, and the number agreeing with the
sidebar.
2814 passed, 1 skipped; ruff and black clean.