WEBDEV-8964: Migrate waveform-progress into elements - #78
Open
jbuckner wants to merge 6 commits into
Open
Conversation
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>
|
…rate-waveform-progress * WEBDEV-8963-migrate-audio-element: WEBDEV-8972: Run CI on every PR, not just ones based on main (#90)
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
getBoundingClientRect()instead ofcontainer.offsetLeft.offsetLeftis measured from the offsetParent andpageXfrom 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.e.pageX, which isundefinedon aTouchEvent, so every touch drag computedNaN.touchcancelends a drag. Onlytouchenddid, so a touch the system took over (incoming call, browser gesture) left the drag latched and the waveform stopped following playback permanently.mousedownis ignored. Right-clicking the waveform used to seek, and the context menu eats themouseup, so it left the drag latched too.ZoneOfSilenceis an interface, same reasoning asAudioSourcein #77. CSS custom properties renamed to--ia-theme-waveform-*.