Skip to content

WEBDEV-8969: Migrate radio-player into elements - #86

Open
jbuckner wants to merge 2 commits into
WEBDEV-8974-migrate-search-handlerfrom
WEBDEV-8969-migrate-radio-player
Open

WEBDEV-8969: Migrate radio-player into elements#86
jbuckner wants to merge 2 commits into
WEBDEV-8974-migrate-search-handlerfrom
WEBDEV-8969-migrate-radio-player

Conversation

@jbuckner

@jbuckner jbuckner commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

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 uses ia-status-indicator in place of ia-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.

  • The first transcript line couldn't be clicked — the one entry that starts at 0. Same guard also meant rewinding to 0:00 left the scrubber where it was, scrubbing to 0% did nothing, and muting was ignored.
  • Backspacing the search box empty left the old term in place, since an empty string is falsy too.
  • A duration of Infinity (a stream) or NaN (metadata not loaded) was accepted as truthy. Only finite durations are now, and the percentage guards a zero duration instead of producing NaN.
  • The section skip buttons took Math.min of an empty list at either end of a track. An audio element throws a TypeError on a non-finite position (verified in Chrome), which inside a listener surfaces as an uncaught window error, not a visible failure.
  • A failed search left the spinner up for the life of the page. 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, leaving older results on screen under the newer term. Reachable over the network with FullTextSearchBackend. 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, so the entries could be neither seen nor picked.
  • The switcher's arrows had no accessible name — that's the open bug WEBDEV-8926 — and the counter had nothing saying what it counted. Both fixed. The search outcome is announced through a live region that's always in the DOM, since a region inserted with its text already in place isn't announced.

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.

RadioPlayerConfig and MusicZone are interfaces. The controls' playback mode is a binding off isPlaying rather 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 SearchHandler over a LocalSearchBackend, so the whole thing is demoable with no network.

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

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>
@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-86/

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

…grate-radio-player

* WEBDEV-8974-migrate-search-handler:
  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 90.40000% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.87%. Comparing base (111fbd4) to head (4a97655).

Files with missing lines Patch % Lines
src/elements/ia-radio-player/ia-radio-player.ts 90.34% 4 Missing and 13 partials ⚠️
.../elements/ia-radio-player/ia-radio-player-story.ts 89.47% 5 Missing and 1 partial ⚠️
...ents/ia-radio-player/ia-search-results-switcher.ts 94.11% 0 Missing and 1 partial ⚠️
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.
📢 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