Skip to content

Add new video events#1678

Merged
LeonardoRosaa merged 42 commits into
mainfrom
horatiu-lig-10189-edit-events-2
Jul 21, 2026
Merged

Add new video events#1678
LeonardoRosaa merged 42 commits into
mainfrom
horatiu-lig-10189-edit-events-2

Conversation

@horatiualmasan

@horatiualmasan horatiualmasan commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What has changed and why?

Add new video event

How has it been tested?

New test and manual test:

new_event.mp4

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Summary by CodeRabbit

  • New Features

    • Added support for creating video classification events directly from the video timeline.
    • Users can select or create a label and define a time range for new events.
    • Added an “Add event” control in editable video timelines, including automatic duration and boundary handling.
    • Video annotations now support optional start and end times.
  • Tests

    • Added coverage for event creation, timeline controls, time boundaries, and temporal annotation data.

horatiualmasan and others added 30 commits July 7, 2026 17:54
…ions' into horatiu-lig-9805-import-activitynet-style-event-annotations-3
Previously, filtering and counting video annotations only considered
annotations attached to a video's frames. Videos can also carry
annotations directly (e.g. ActivityNet-style event/classification labels
on the whole video). This makes both the video filter and the annotation
counter consider these direct video annotations in addition to frame
annotations.
…ions-3' into horatiu-lig-9806-filter-videos-by-event-metadata
Mirrors a <video> element's playback state into reactive fields and
exposes intent callbacks (seek, play/pause, mute, fullscreen) for a
custom control bar. Listening via native events keeps it composable
with handlers on the element. Covered by a harness-driven unit test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Compose useVideoPlayback + VideoControls, forcing native <video controls>
off so the full-width scrubber can host aligned timeline overlays. Adds a
startTimeS prop (null waits for a deep-link timestamp) and a region ref
for fullscreen. Updates tests and stories accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hand the deep-linked frame's timestamp to VideoPlayer via startTimeS
instead of seeking after load, and remount on frame-number change with
a composite #key. Align the annotation overlay to the <video> box and
fix min-h-0 layout so the player fills its card. Adds a VideoDetails
test covering the frame-load branch and deep-link handoff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Full-width scrubber + transport buttons that own no playback state and
call back on user intent. Includes helpers (formatTime, clampPercent,
timeFromClientX) and unit tests. Exported from the components barrel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Interactive Playground plus paused / near-end states, on a dark backdrop
matching how the bar overlays a video.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Mirrors a <video> element's playback state into reactive fields and
exposes intent callbacks (seek, play/pause, mute, fullscreen) for a
custom control bar. Listening via native events keeps it composable
with handlers on the element. Covered by a harness-driven unit test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Compose useVideoPlayback + VideoControls, forcing native <video controls>
off so the full-width scrubber can host aligned timeline overlays. Adds a
startTimeS prop (null waits for a deep-link timestamp) and a region ref
for fullscreen. Updates tests and stories accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Hand the deep-linked frame's timestamp to VideoPlayer via startTimeS
instead of seeking after load, and remount on frame-number change with
a composite #key. Align the annotation overlay to the <video> box and
fix min-h-0 layout so the player fills its card. Adds a VideoDetails
test covering the frame-load branch and deep-link handoff.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…github.com:lightly-ai/lightly-studio into horatiu-lig-9807-show-event-bars-on-the-timeline.d
horatiualmasan and others added 11 commits July 16, 2026 23:49
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ts-model' into horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline
…ts-timeline' into horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-wiring
…ts-wiring' of github.com:lightly-ai/lightly-studio into horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-wiring
@horatiualmasan
horatiualmasan requested a review from a team as a code owner July 17, 2026 14:04
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bea98ec1-168f-4340-ad6e-63aa5bbe9145

📥 Commits

Reviewing files that changed from the base of the PR and between 4f9be71 and 18b3dd6.

📒 Files selected for processing (10)
  • lightly_studio/src/lightly_studio/api/routes/api/annotations/create_annotation.py
  • lightly_studio/src/lightly_studio/services/annotations_service/create_annotation.py
  • lightly_studio/tests/services/annotations_service/test_create_annotation.py
  • lightly_studio_view/src/lib/components/VideoControls/VideoControls.stories.svelte
  • lightly_studio_view/src/lib/components/VideoDetails/VideoDetails.svelte
  • lightly_studio_view/src/lib/components/VideoDetails/VideoDetails.test.ts
  • lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte
  • lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.test.ts
  • lightly_studio_view/src/lib/components/VideoPlayer/VideoPlayer.svelte
  • lightly_studio_view/src/lib/components/VideoPlayer/VideoPlayer.test.ts
💤 Files with no reviewable changes (1)
  • lightly_studio_view/src/lib/components/VideoControls/VideoControls.stories.svelte

📝 Walkthrough

Walkthrough

The change adds optional temporal span fields to annotation creation and enables editable video timelines to create classification events through label selection, annotation creation, refresh handling, and validation tests.

Changes

Temporal event creation

Layer / File(s) Summary
Annotation temporal contract
lightly_studio/src/lightly_studio/api/routes/api/annotations/create_annotation.py, lightly_studio/src/lightly_studio/services/annotations_service/create_annotation.py, lightly_studio/tests/services/annotations_service/test_create_annotation.py
Annotation inputs accept optional start/end times, and classification annotation creation is tested with persisted temporal span details.
Timeline event entry
lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte, lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.test.ts, lightly_studio_view/src/lib/components/VideoPlayer/VideoPlayer.svelte, lightly_studio_view/src/lib/components/VideoPlayer/VideoPlayer.test.ts, lightly_studio_view/src/lib/components/VideoControls/VideoControls.stories.svelte
Editable timelines expose an add-event button, clamp a default one-second span to the video duration, and pass event callbacks through VideoPlayer.
Video details annotation flow
lightly_studio_view/src/lib/components/VideoDetails/VideoDetails.svelte, lightly_studio_view/src/lib/components/VideoDetails/VideoDetails.test.ts
VideoDetails selects or creates labels, creates bounded classification annotations, refreshes video data, displays result toasts, and mocks annotation hooks in tests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: leonardorosaa

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: adding new video events.
Description check ✅ Passed The description follows the template and includes change summary, testing, and changelog status, though the rationale is brief.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch horatiu-lig-10189-edit-events-2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Base automatically changed from horatiu-lig-10189-edit-events to main July 21, 2026 18:19
@lightly-fast-track-bot

Copy link
Copy Markdown

❌ Fast Track: checks did not pass

Failed guardrails: frontend/complexity (Guardrail threw: Cannot find module 'eslint'
Require stack:

  • /home/runner/work/lightly-studio/lightly-studio/lightly_studio_view/package.json), backend/complexity (Guardrail threw: spawn uv ENOENT), backend/coverage (Guardrail threw: spawn uv ENOENT), frontend/coverage ( [FAIL] lightly_studio_view/src/lib/components/VideoDetails/VideoDetails.svelte: coverage data not found
    [FAIL] lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte: coverage data not found
    [FAIL] lightly_studio_view/src/lib/components/VideoPlayer/VideoPlayer.svelte: coverage data not found)
Guardrail Result Message
dummy Always passes.
frontend/complexity Guardrail threw: Cannot find module 'eslint' Require stack: - /home/runner/work/lightly-studio/lightly-studio/lightly_studio_view/package.json
backend/complexity Guardrail threw: spawn uv ENOENT
backend/coverage Guardrail threw: spawn uv ENOENT
diff-size PR adds 199 line(s) (limit: 215).
frontend/coverage [FAIL] lightly_studio_view/src/lib/components/VideoDetails/VideoDetails.svelte: coverage data not found [FAIL] lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte: coverage data not found [FAIL] lightly_studio_view/src/lib/components/VideoPlayer/VideoPlayer.svelte: coverage data not found

Reflects 18b3dd6.

@LeonardoRosaa
LeonardoRosaa added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 75bcf91 Jul 21, 2026
24 checks passed
@LeonardoRosaa
LeonardoRosaa deleted the horatiu-lig-10189-edit-events-2 branch July 21, 2026 20:36
@coderabbitai coderabbitai Bot mentioned this pull request Jul 22, 2026
2 tasks
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