WEBDEV-8969: Migrate radio-player into elements - #86
Open
jbuckner wants to merge 2 commits into
Open
Conversation
Move @internetarchive/radio-player out of the iaux monorepo as ia-radio-player, with its switcher as ia-search-results-switcher. Last of the eight. It uses the migrated ia-* components, and ia-status-indicator in place of ia-activity-indicator, which isn't coming over. Bugs fixed on the way through. Most of them are the same mistake: a falsy guard on a number where zero is a real value. - Rewinding to the very start left the scrubber where it was, scrubbing to 0% did nothing, muting was ignored, and the first transcript line, the one entry that starts at 0, couldn't be clicked at all. - Backspacing the search box empty left the old term in place, since an empty string is falsy too. - A duration of Infinity from a stream, or NaN from metadata that hadn't loaded, were both accepted as truthy. Only finite durations are now, and the percentage guards against a duration of zero rather than producing NaN. - The section skip buttons took Math.min of an empty list at the end of a track, and an audio element throws a TypeError on a non-finite position, which inside a listener surfaces as an uncaught error. - A failed search left the spinner up for the life of the page, since nothing put it back. It's in a finally now, with a searchFailed event so a consumer can say something. - Overlapping searches could resolve out of order and leave the older results on screen under the newer term. Each run is numbered and only the newest reports back. - The quick searches were plumbed through but dead: the disclosure that opens the list was never enabled, and nothing listened for a selection. - The search switcher's arrows had no accessible name, which is WEBDEV-8926, and the counter had nothing saying what it counted. Both fixed, and the search outcome is announced through a live region that is always present, since a region inserted with its text already in it is not announced. Around 60 lines of -ms-grid CSS went with it. It only ever served IE11, which can't run this package's ES2021 output. RadioPlayerConfig and MusicZone are interfaces. The playback mode is a binding off isPlaying rather than being assigned into the shadow DOM. Claude-Session: https://claude.ai/code/session_01U6iNyGicKJywdrWJMTyFin Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
…grate-radio-player * WEBDEV-8974-migrate-search-handler: 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-8974-migrate-search-handler #86 +/- ##
======================================================================
+ Coverage 82.76% 83.87% +1.11%
======================================================================
Files 53 56 +3
Lines 1555 1805 +250
Branches 336 381 +45
======================================================================
+ Hits 1287 1514 +227
- Misses 173 182 +9
- Partials 95 109 +14 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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-8969. Stacked on #85. Last of the eight in WEBDEV-8962.
The player itself, plus
ia-search-results-switcher. Wires up the seven components below it, and usesia-status-indicatorin place ofia-activity-indicator, which isn't migrating.Most of the bugs here are one mistake repeated: a falsy guard on a number where zero is a real value.
Infinity(a stream) orNaN(metadata not loaded) was accepted as truthy. Only finite durations are now, and the percentage guards a zero duration instead of producingNaN.Math.minof an empty list at either end of a track. An audio element throws aTypeErroron a non-finite position (verified in Chrome), which inside a listener surfaces as an uncaught window error, not a visible failure.finallynow, with asearchFailedevent so a consumer can say something.FullTextSearchBackend. Each run is numbered and only the newest reports back.Every one of those has a test that fails when the fix is reverted.
Also dropped ~60 lines of
-ms-grid-*CSS. It only ever served IE11, which can't run this package's ES2021 output.RadioPlayerConfigandMusicZoneare interfaces. The controls' playback mode is a binding offisPlayingrather than being assigned into the shadow DOM.The story generates its own audio (a quiet WAV tone that steps down in pitch), waveform and logo, and wires up a real
SearchHandlerover aLocalSearchBackend, so the whole thing is demoable with no network.CI shows only
deploy-previewhere because the PR isn't based onmain(WEBDEV-8972). Verified locally: build, full suite 437 passing, eslint and prettier clean, ghpages demo builds.