Skip to content

WEBDEV-8966: Migrate scrubber-bar into elements - #82

Open
jbuckner wants to merge 3 commits into
WEBDEV-8965-migrate-playback-controlsfrom
WEBDEV-8966-migrate-scrubber-bar
Open

WEBDEV-8966: Migrate scrubber-bar into elements#82
jbuckner wants to merge 3 commits into
WEBDEV-8965-migrate-playback-controlsfrom
WEBDEV-8966-migrate-scrubber-bar

Conversation

@jbuckner

@jbuckner jbuckner commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

WEBDEV-8966. Stacked on #80, part of WEBDEV-8962.

Brings scrubber-bar over as ia-scrubber-bar, and its child as ia-section-marker.

Bugs fixed on the way through:

  • Section markers are sorted numerically, on a copy. .sort() was called bare, which orders lexicographically, so [9, 20, 100] picked the wrong markers either side of the playhead. It also sorted in place, reordering the consumer's own array.
  • Keyboard scrubbing counts as interacting. Arrowing along the bar set the value but left the interacting flag false, so the next playback tick snapped the thumb back. Blur releases a latched interaction, and Tab deliberately doesn't count, since its keyup lands wherever focus went.
  • touchcancel ends an interaction, same as on the waveform.
  • percentage returns 0 rather than NaN when max === min.
  • The fill, markers and thumb follow the themed track height. They were pinned to numbers that only suit the default 10px track, so theming the height left the fill and thumb floating off it.
  • The slider has an accessible name.

Also: updateWebkitSliderStyle() is gone. It built a <style> block as a string and wrote it in via innerHTML on every value change, but the element it styled is an ordinary div, not a track pseudo-element, so a custom property does the same job. Marker modes are computed in render() and passed as property bindings rather than assigned by querySelector.

One thing deliberately not fixed: the marker arrows keep their unconditional visibility: hidden. The mode-* rules only animate opacity, which can't reveal a hidden element, so those arrows have never been visible in production. Making UI nobody has seen suddenly appear didn't feel like a migration's call — happy to do it as a follow-up.

CI shows only deploy-preview here because the PR isn't based on main (WEBDEV-8972). Verified locally: build, full suite 277 passing, eslint and prettier clean.

Move @internetarchive/scrubber-bar out of the iaux monorepo as
ia-scrubber-bar, with its child as ia-section-marker. Fourth of seven.

- Section markers sorted numerically on a copy. The old code called .sort()
  bare, which orders lexicographically, so a set like [9, 20, 100] picked
  the wrong markers either side of the playhead. It also sorted in place,
  reordering the array the consumer passed in.
- The slider has an accessible name, and scrubbing it from the keyboard now
  counts as interacting. Arrowing along the bar used to set the value while
  leaving the "user is interacting" flag false, so the next playback tick
  snapped the thumb straight back. Blur releases a latched interaction, and
  Tab is deliberately not treated as scrubbing, since its keyup lands
  wherever focus went.
- touchcancel ends an interaction, same as on the waveform.
- percentage returns 0 instead of NaN when max equals min.
- The played fill, the markers and the thumb all follow the themed track
  height now. They were pinned to the numbers that suit the default 10px
  track, so theming the height left the fill and thumb floating off it.

The style injection is gone. updateWebkitSliderStyle() built a <style>
block as a string and wrote it in through innerHTML on every value change,
but the thing it styled is an ordinary div rather than a track
pseudo-element, so a custom property does the same job.

Marker modes are computed in render() and passed as property bindings
instead of being assigned by querySelector, which is what made them
straightforward to test.

The marker arrows keep their unconditional visibility: hidden. Upstream
only ever animated opacity in the mode rules, which can't reveal a hidden
element, so those arrows have never been visible. Making UI nobody has seen
suddenly appear isn't this migration's call. Left with a comment.

Claude-Session: https://claude.ai/code/session_01U6iNyGicKJywdrWJMTyFin

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-82/

Built to branch ghpages at 2026-08-27 20:28 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Three comments explained the code by contrast with what it replaced, which
a reader looking at the file without the diff has no context for. Say what
the code does now instead.

Claude-Session: https://claude.ai/code/session_01U6iNyGicKJywdrWJMTyFin

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-migrate-scrubber-bar

* WEBDEV-8965-migrate-playback-controls:
  WEBDEV-8972: Run CI on every PR, not just ones based on main (#90)
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.79487% with 22 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (WEBDEV-8965-migrate-playback-controls@55d2409). Learn more about missing BASE report.

Files with missing lines Patch % Lines
.../elements/ia-scrubber-bar/ia-scrubber-bar-story.ts 32.25% 21 Missing ⚠️
src/elements/ia-scrubber-bar/ia-scrubber-bar.ts 97.61% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                           Coverage Diff                            @@
##             WEBDEV-8965-migrate-playback-controls      #82   +/-   ##
========================================================================
  Coverage                                         ?   80.17%           
========================================================================
  Files                                            ?       38           
  Lines                                            ?     1170           
  Branches                                         ?      267           
========================================================================
  Hits                                             ?      938           
  Misses                                           ?      159           
  Partials                                         ?       73           

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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