Skip to content

Mark annotated frames on the timeline - #28

Closed
emlcpfx wants to merge 1 commit into
D-Mad:mainfrom
emlcpfx:pr-timeline-markers
Closed

Mark annotated frames on the timeline#28
emlcpfx wants to merge 1 commit into
D-Mad:mainfrom
emlcpfx:pr-timeline-markers

Conversation

@emlcpfx

@emlcpfx emlcpfx commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Annotated frames now show as ticks on the timeline, so a reviewer scrubbing a shot can see where the notes are instead of hunting for them.

Ported from reviewapp's Timeline.set_markers, keeping its colours and shape:

  • blue (#4fc3f7) — the frame holds comments
  • purple (#ab47bc) — the frame holds only drawings

A frame with both reads as a comment: the words are the reviewable part, and the drawing marker mustn't hide them. (reviewapp arrives at the same result — its has_c and has_d branch returns the same blue as has_c.)

Markers are drawn under the playhead, so a note never hides the frame the reviewer is actually sitting on.

The bit that would have been wrong

Annotations are keyed by the player's LOCAL frame, but the timeline is a global range during playlist playback. Markers are mapped across with _timeline_frame_for_local, exactly as the [ / ] note navigation already does. Without it, the notes for one shot land on top of a different shot — and it would look plausible right up until someone tried to click one.

Keeping the markers honest

Comment add / delete / resolve and the sidecar load already funnel through single call sites, so the refresh hangs off those.

Strokes had no such hook: drawing changes what the timeline should show, and only the viewer knows it happened. So ViewerWidget gains an annotations_changed signal, emitted when a stroke is completed, undone, redone or cleared. Without it the markers would be right until you drew something, then quietly drift until the next source reload — the worst kind of wrong, because it looks fine.

Tests

10 new tests, 248 on the branch, compile clean.

The timeline is a plain QWidget (not the GL viewer), so the tests render it offscreen and probe the real pixels rather than trusting what the widget believes it stored:

  • the two marker colours land on the right frames
  • a both-kinds frame reads as a comment and isn't drawn twice
  • an unannotated frame stays clean
  • out-of-range markers (a stale frame from a longer clip) don't smear onto the track ends
  • the playhead wins the pixel it shares with a marker

Also driven end to end through a real MainWindow with a decoded clip: adding a comment adds its marker, completing a stroke adds its marker, undo takes it away again, and deleting the comment clears it.

Branches off current main.

Ported from reviewapp Timeline.set_markers. A reviewer scrubbing a shot can now
see where the notes are instead of hunting for them.

Colours and shape follow reviewapp: a 3px tick per annotated frame, blue for a
frame holding comments and purple for one holding only drawings. A frame with
both reads as a comment, because the words are the reviewable part and the
drawing marker must not hide them.

The markers are drawn under the playhead, so a note never hides the frame the
reviewer is actually sitting on.

Annotations are keyed by the player LOCAL frame while the timeline is a global
range during playlist playback, so every marker is mapped across with
_timeline_frame_for_local. Without that the notes for one shot land on another.

Drawing a stroke changes what the timeline should show and only the viewer knows
it happened, so ViewerWidget gains an annotations_changed signal, emitted when a
stroke is completed, undone, redone or cleared. Comment add/delete/resolve and
the sidecar load already funnel through single call sites, so the refresh hangs
off those.

10 tests. The timeline is a plain QWidget, so they render it offscreen and probe
the real pixels: the marker colours, a both-kinds frame reading as a comment, an
unannotated frame staying clean, out-of-range markers not smearing onto the
track ends, and the playhead winning the pixel it shares with a marker.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TexnzYbmCjjTDB8zzZuUPb
@D-Mad

D-Mad commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Superseded by #33. The replacement preserves the contributed timeline marker UI and adds playlist-wide aggregation, duplicate-shot mapping, stale-marker clearing, validated lightweight sidecar reads, and regression coverage. Thank you for the contribution.

@D-Mad D-Mad closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants