Skip to content

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

Open
jbuckner wants to merge 8 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 8 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-09-03 03:37 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

codecov-commenter commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.87452% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.99%. Comparing base (62175e7) to head (6d07f74).

Files with missing lines Patch % Lines
src/elements/ia-radio-player/ia-radio-player.ts 90.60% 4 Missing and 13 partials ⚠️
.../elements/ia-radio-player/ia-radio-player-story.ts 90.76% 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.83%   83.99%   +1.15%     
======================================================================
  Files                                      53       56       +3     
  Lines                                    1561     1824     +263     
  Branches                                  338      384      +46     
======================================================================
+ Hits                                     1293     1532     +239     
- Misses                                    173      182       +9     
- Partials                                   95      110      +15     

☔ 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 6 commits September 2, 2026 16:21
…grate-radio-player

* WEBDEV-8974-migrate-search-handler:
  WEBDEV-8965: Fix black playback control icons
  WEBDEV-8971: Run lint in CI and fix prettier on main (#79)
  WEBDEV-8973: Rebuild the demo scroll spy on reconnect (#89)
…grate-radio-player

* WEBDEV-8974-migrate-search-handler:
  WEBDEV-9009: Fix the demo scroll spy test on a taller demo page
…grate-radio-player

* WEBDEV-8974-migrate-search-handler:
  WEBDEV-8966: Match the scrubber Settings default to the demo
  WEBDEV-8964: Match the waveform Settings default to the demo
  WEBDEV-8963: Match the audio element Settings default to the demo
…grate-radio-player

* WEBDEV-8974-migrate-search-handler:
  WEBDEV-8968: Make the transcript context zones visible
  WEBDEV-8967: Only emit enterKeyPressed for an Enter the input saw
Backspacing the box empty hid the results counter, which is guarded on an
empty term, but left searchResultsTranscript set. The transcript kept its
outlines with no counter and no way to step between the matches. Emptying it
now drops the results, abandons anything in flight and resets the position.

Also swaps the demo track's continuous sine for plucked notes on a pentatonic
scale, decaying between strikes. The pitch still walks down as the track runs,
so it still tells you where you are, but a minute of it is no longer a drone.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RuJpnAKn9TtFvMxcEgwdm
…grate-radio-player

* WEBDEV-8974-migrate-search-handler:
  WEBDEV-8966: Size the section markers to the track
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