Skip to content

WEBDEV-8964: Migrate waveform-progress into elements - #78

Open
jbuckner wants to merge 6 commits into
WEBDEV-8963-migrate-audio-elementfrom
WEBDEV-8964-migrate-waveform-progress
Open

WEBDEV-8964: Migrate waveform-progress into elements#78
jbuckner wants to merge 6 commits into
WEBDEV-8963-migrate-audio-elementfrom
WEBDEV-8964-migrate-waveform-progress

Conversation

@jbuckner

@jbuckner jbuckner commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

WEBDEV-8964. Stacked on #77, part of WEBDEV-8962.

Not just a file move. Five fixes came with it, none of which the old tests could catch:

  • Scrub position comes from getBoundingClientRect() instead of container.offsetLeft. offsetLeft is measured from the offsetParent and pageX from the document, so they only agreed when the element sat at the page origin with nothing positioned above it. The old test hardcoded the off-by-the-body-margin result as its expected value, so it passed because of the bug. New tests derive the expectation from the element's own measured rect.
  • Touch drags work now. The touch handlers were wired to a mouse-only handler reading e.pageX, which is undefined on a TouchEvent, so every touch drag computed NaN.
  • touchcancel ends a drag. Only touchend did, so a touch the system took over (incoming call, browser gesture) left the drag latched and the waveform stopped following playback permanently.
  • A non-primary mousedown is ignored. Right-clicking the waveform used to seek, and the context menu eats the mouseup, so it left the drag latched too.
  • The emitted percentage is clamped to 0-100.

ZoneOfSilence is an interface, same reasoning as AudioSource in #77. CSS custom properties renamed to --ia-theme-waveform-*.

Move @internetarchive/waveform-progress out of the iaux monorepo as
ia-waveform-progress. Second of seven.

Fixes that came with the move, all of them things the old tests couldn't
see:

- Scrub position is worked out from getBoundingClientRect() instead of
  container.offsetLeft. offsetLeft is measured from the offsetParent and
  pageX from the document, so the two only lined up when the element sat at
  the page origin with nothing positioned above it. The old test hardcoded
  the resulting off-by-the-body-margin number as its expected value, so it
  passed because of the bug. The new tests derive the expected percentage
  from the element's own measured rect.
- Touch drags work. The touch handlers were wired to a mouse-only handler
  reading e.pageX, which is undefined on a TouchEvent, so every touch drag
  computed NaN.
- touchcancel ends a drag. Only touchend did, so a touch the system took
  over left the drag latched on and the waveform stopped following playback
  for good.
- A non-primary mousedown is ignored. Right-clicking the waveform used to
  seek, and since the context menu eats the mouseup it left the drag
  latched too.
- The emitted percentage is clamped to 0-100.

ZoneOfSilence is an interface now, same reasoning as AudioSource. The CSS
custom properties are --ia-theme-waveform-* instead of camelCase.

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

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

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

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

Built to branch ghpages at 2026-09-03 00:02 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

…rate-waveform-progress

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

codecov-commenter commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.20690% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.91%. Comparing base (a48c30c) to head (694416a).

Files with missing lines Patch % Lines
...ia-waveform-progress/ia-waveform-progress-story.ts 75.00% 4 Missing and 2 partials ⚠️
...ments/ia-waveform-progress/ia-waveform-progress.ts 94.11% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                          Coverage Diff                          @@
##           WEBDEV-8963-migrate-audio-element      #78      +/-   ##
=====================================================================
+ Coverage                              80.60%   80.91%   +0.30%     
=====================================================================
  Files                                     29       31       +2     
  Lines                                    990     1048      +58     
  Branches                                 236      245       +9     
=====================================================================
+ Hits                                     798      848      +50     
- Misses                                   126      130       +4     
- Partials                                  66       70       +4     

☔ 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.

jbuckner and others added 4 commits September 2, 2026 16:20
…rate-waveform-progress

* WEBDEV-8963-migrate-audio-element:
  WEBDEV-8971: Run lint in CI and fix prettier on main (#79)
  WEBDEV-8973: Rebuild the demo scroll spy on reconnect (#89)
…rate-waveform-progress

* WEBDEV-8963-migrate-audio-element:
  WEBDEV-9009: Fix the demo scroll spy test on a taller demo page
…rate-waveform-progress

* WEBDEV-8963-migrate-audio-element:
  WEBDEV-8963: Match the audio element Settings default to the demo
The story hardcodes interactive on the element but declared the Settings
default as false, so the radio said scrubbing was off while dragging the
waveform plainly worked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RuJpnAKn9TtFvMxcEgwdm
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