Skip to content

Add VideoEventTimeline component#1672

Merged
LeonardoRosaa merged 49 commits into
mainfrom
horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline
Jul 21, 2026
Merged

Add VideoEventTimeline component#1672
LeonardoRosaa merged 49 commits into
mainfrom
horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline

Conversation

@horatiualmasan

@horatiualmasan horatiualmasan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What has changed and why?

Adds a presentation-only VideoEventTimeline component that renders VideoEvents as clickable bars positioned by start/end time, stacked into lanes, with an optional playhead and header. Clicking a bar calls onSeek; very short events keep a minimum clickable width. It takes already-derived events (from PR #1671), holds no playback state, and is exported for reuse. Includes Storybook stories.

How has it been tested?

Component tests in VideoEventTimeline.test.ts plus Storybook stories for the empty, single-lane, and overlapping-events cases.

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Summary by CodeRabbit

  • New Features
    • Added a VideoEventTimeline component to display time-based events as clickable, lane-stacked bars on a timeline.
    • Includes optional header/title + event count, an empty-state message, and a playhead indicator when duration is available.
    • Clicking an event seeks to its start time.
    • Re-exported the component for use via the shared component exports.
  • Tests
    • Added Vitest coverage for rendering, bar positioning, click-to-seek behavior, empty state, and header visibility.
  • Documentation
    • Expanded Storybook stories, including an interactive playground, single-event views, and custom titles.

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>
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>
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>
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>
Interactive Playground plus paused / near-end states, on a dark backdrop
matching how the bar overlays a video.
horatiualmasan and others added 3 commits July 16, 2026 23:35
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@horatiualmasan
horatiualmasan requested a review from a team as a code owner July 16, 2026 21:03
@coderabbitai

coderabbitai Bot commented Jul 16, 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: 344c85b4-0c65-433d-a688-550aadaf2d2b

📥 Commits

Reviewing files that changed from the base of the PR and between 1d685ce and 8a8f869.

📒 Files selected for processing (1)
  • lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
  • lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte

📝 Walkthrough

Walkthrough

The pull request adds a reusable VideoEventTimeline Svelte component with time-positioned event bars, lane stacking, playhead and seek interaction, empty/header states, public export, tests, and expanded Storybook scenarios.

Changes

Video event timeline

Layer / File(s) Summary
Timeline rendering and interaction
lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte
Adds time-positioned event bars, non-overlapping lanes, optional header and playhead, empty state, accessibility labels, and seek callbacks.
Public export and behavioral validation
lightly_studio_view/src/lib/components/index.ts, lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.test.ts
Re-exports the component and tests rendering, positioning, seeking, empty state, and header visibility.
Storybook scenarios
lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.stories.svelte
Adds synthetic event datasets, an interactive playground, and default, empty, overlapping-lane, single-event, no-header, and custom-title stories.

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 summarizes the main change: adding the VideoEventTimeline component.
Description check ✅ Passed The description covers the change, motivation, testing, and changelog status, with only minor template details missing.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline

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.

horatiualmasan and others added 2 commits July 17, 2026 10:11
…ts-model' into horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline
@horatiualmasan

Copy link
Copy Markdown
Contributor Author

/review

horatiualmasan and others added 7 commits July 17, 2026 14:11
…o horatiu-lig-9807-show-event-bars-on-the-timeline.b
…o horatiu-lig-9807-show-event-bars-on-the-timeline.c
…o horatiu-lig-9807-show-event-bars-on-the-timeline.d
…o horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-model
…ts-model' into horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline
Base automatically changed from horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-model to main July 20, 2026 17:59

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.svelte`:
- Line 111: Update the event button styling in VideoEventTimeline to explicitly
set its text color to event.contrastColor alongside the existing background and
border colors, ensuring labels remain readable regardless of event.color or
inherited theme styles.
- Around line 96-100: Update the event-bar calculations in the timeline markup
around leftPercent and widthPercent so the computed bar width cannot extend past
100%; clamp leftPercent against the available track space after applying
MIN_BAR_WIDTH_PERCENT, while preserving the existing minimum-width behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ad3acef1-31d9-4909-a4f4-2fed8f46ab7e

📥 Commits

Reviewing files that changed from the base of the PR and between e3d13e7 and bf3e35a.

📒 Files selected for processing (4)
  • lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.stories.svelte
  • 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/index.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.stories.svelte (1)

53-53: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove extraneous asChild prop.

The <Story> component from @storybook/addon-svelte-csf does not use an asChild prop and simply renders its default slot. Including it might cause an unexpected prop warning or TypeScript error.

♻️ Proposed fix
- <Story name="Playground" asChild>
+ <Story name="Playground">
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.stories.svelte`
at line 53, Remove the extraneous asChild prop from the Playground Story
declaration in VideoEventTimeline.stories.svelte, leaving the Story component to
render its default slot without additional props.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.stories.svelte`:
- Line 53: Remove the extraneous asChild prop from the Playground Story
declaration in VideoEventTimeline.stories.svelte, leaving the Story component to
render its default slot without additional props.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 179aea7a-15ae-4281-a858-310e0b3fdf0a

📥 Commits

Reviewing files that changed from the base of the PR and between bf3e35a and 1d685ce.

📒 Files selected for processing (1)
  • lightly_studio_view/src/lib/components/VideoEventTimeline/VideoEventTimeline.stories.svelte

@LeonardoRosaa
LeonardoRosaa enabled auto-merge July 21, 2026 15:02
@LeonardoRosaa
LeonardoRosaa added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 3856273 Jul 21, 2026
22 checks passed
@LeonardoRosaa
LeonardoRosaa deleted the horatiu-lig-9807-show-event-bars-on-the-timeline-3-events-timeline branch July 21, 2026 15:35
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