Skip to content

feat: YouTube-style chapters on the progress bar - #959

Open
Ortes wants to merge 4 commits into
fluttercommunity:masterfrom
Ortes:feat/progress-bar-chapters-upstream
Open

feat: YouTube-style chapters on the progress bar#959
Ortes wants to merge 4 commits into
fluttercommunity:masterfrom
Ortes:feat/progress-bar-chapters-upstream

Conversation

@Ortes

@Ortes Ortes commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Adds an optional chapters list to ChewieController (ChewieChapter { title, start }). When provided, the progress bar is drawn split into chapter segments with a small 2px gap at each chapter boundary — the YouTube-style chaptered timeline — and hovering or scrubbing the bar shows a floating pill with the pointed chapter's title next to the timecode.

All three control skins (Material, MaterialDesktop, Cupertino) get the segmented rendering, since they all funnel into the shared VideoProgressBar/_ProgressBarPainter.

Behaviour

  • chapters defaults to an empty list: the painter and widget tree are exactly as before, so existing apps are unaffected.
  • Background, buffered, and played bars are all segmented consistently; boundaries outside (0, duration) are ignored defensively.
  • The title pill is driven by hover events (desktop) and by an in-progress drag, so plain touch playback is unchanged.
  • Purely additive; no breaking API changes.

Notes

The hover pill here shares its look with the hover-time indicator proposed in #956 — if both land, they compose naturally (title + timecode in one label). The click cursor on the bar is handled separately in #950.

Ortes added 2 commits August 6, 2026 09:45
- ChewieChapter model ({title, start}) exposed on ChewieController.chapters
- Progress bar (background/buffered/played) is drawn split at chapter
  boundaries with a 2px gap, YouTube-style
- Hovering (desktop) or scrubbing the bar shows the pointed chapter title
  and time in a label above the bar
- Empty chapters list keeps the previous rendering unchanged
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.75000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 53.36%. Comparing base (69a8fc7) to head (6ad6909).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
lib/src/progress_bar.dart 98.63% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #959      +/-   ##
==========================================
+ Coverage   43.82%   53.36%   +9.54%     
==========================================
  Files          21       22       +1     
  Lines        1602     1666      +64     
==========================================
+ Hits          702      889     +187     
+ Misses        900      777     -123     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Ortes
Ortes marked this pull request as draft August 6, 2026 13:17
@Ortes
Ortes marked this pull request as ready for review August 6, 2026 13:18
@Ortes
Ortes force-pushed the feat/progress-bar-chapters-upstream branch from 3f99788 to 6ad6909 Compare August 6, 2026 13:33
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.

1 participant