Skip to content

WEBDEV-8963: Migrate audio-element into elements - #77

Open
jbuckner wants to merge 3 commits into
mainfrom
WEBDEV-8963-migrate-audio-element
Open

WEBDEV-8963: Migrate audio-element into elements#77
jbuckner wants to merge 3 commits into
mainfrom
WEBDEV-8963-migrate-audio-element

Conversation

@jbuckner

@jbuckner jbuckner commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

WEBDEV-8963. Bottom of the radio player stack (WEBDEV-8962), the other six components go on top of this one.

Two things that aren't just a file move:

  • vite.config.ts passes --autoplay-policy=no-user-gesture-required to Playwright. Karma set this itself and the Vitest provider doesn't, so without it every playback test fails.
  • The element re-dispatches a media error now. It never did, and since play() has to catch its own rejection for Vitest, there was otherwise no way to tell a dead source from silence. It only fires once the browser runs out of <source> candidates, so a failing source with a working fallback behind it stays quiet.

AudioSource is an interface instead of a class. It has no behaviour and the old tests already passed it as plain JSON.

jbuckner and others added 2 commits August 26, 2026 16:30
Move @internetarchive/audio-element out of the iaux monorepo as
ia-audio-element. First of seven, the rest of the radio player stacks on
top of this.

- AudioSource is an interface now instead of a class. It has no behaviour,
  and the old tests already passed it as plain JSON, so the class identity
  was never doing anything.
- Tests move from Karma to Vitest browser mode. Vitest needs the Playwright
  launch flag --autoplay-policy=no-user-gesture-required, which Karma set
  itself, or every playback test fails on the autoplay policy.
- play() catches its own rejection. Karma let the floating promise slide,
  Vitest fails the run on an unhandled rejection.
- The element now re-dispatches a media error. Nothing did before, and with
  the promise caught there was no way at all to tell a dead source from
  silence. It fires once the browser has exhausted its <source> candidates
  (networkState hits NETWORK_NO_SOURCE), so a failing source with a working
  fallback behind it stays quiet.
- duration passes NaN through the way HTMLMediaElement does, and says so.

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

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A failing browser-mode test drops a screenshot in .vitest-attachments/, and
unlike __screenshots__ it wasn't ignored, so one got committed by accident.

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-77/

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

@codecov-commenter

codecov-commenter commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.12903% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.48%. Comparing base (1c7cc46) to head (2150460).

Files with missing lines Patch % Lines
...lements/ia-audio-element/ia-audio-element-story.ts 43.33% 15 Missing and 2 partials ⚠️
src/elements/ia-audio-element/ia-audio-element.ts 87.50% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #77      +/-   ##
==========================================
- Coverage   81.44%   80.48%   -0.97%     
==========================================
  Files          27       29       +2     
  Lines         927      989      +62     
  Branches      227      236       +9     
==========================================
+ Hits          755      796      +41     
- Misses        110      126      +16     
- Partials       62       67       +5     

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

…udio-element

* origin/main:
  WEBDEV-8972: Run CI on every PR, not just ones based on main (#90)
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