Skip to content

DAB: Implement audio link clips#930

Merged
chrisvire merged 4 commits intosillsdev:mainfrom
chrisvire:feature/dab-audio-link
Jan 26, 2026
Merged

DAB: Implement audio link clips#930
chrisvire merged 4 commits intosillsdev:mainfrom
chrisvire:feature/dab-audio-link

Conversation

@chrisvire
Copy link
Member

@chrisvire chrisvire commented Jan 25, 2026

Summary by CodeRabbit

Release Notes

  • New Features
    • Added interactive audio playback to lexicon entries—users can now click audio buttons to listen to pronunciation and audio examples associated with dictionary entries.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 25, 2026

📝 Walkthrough

Walkthrough

The EntryView component now supports audio-link XML tags. When encountered, these tags trigger the creation of clickable audio button elements, with their corresponding audio files dynamically imported and appended to the output for playback integration.

Changes

Cohort / File(s) Summary
Audio-link Support
src/lib/lexicon/components/EntryView.svelte
Adds dynamic clip asset importing via import.meta.glob, introduces audioElements collection, extends XML parser to handle audio-link tags with unique ID generation, creates inline clickable buttons, and attaches playback event listeners. Removes debug console log.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A lexicon now sings! With audio clips bound,
Each link becomes a button, playing precious sound.
Dynamic imports hop, IDs dance and gleam,
The entry view transforms into a listener's dream! 🎵

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'DAB: Implement audio link clips' directly and clearly describes the main change in the pull request: adding audio link clip functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@chrisvire chrisvire force-pushed the feature/dab-audio-link branch from 3c16f86 to 54c3a27 Compare January 25, 2026 03:31
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/lib/lexicon/components/EntryView.svelte`:
- Around line 101-111: The audio icon link lacks an accessible name and uses an
inline onclick; change the generated inline element in the EntryView rendering
(the code that builds output for node.tagName === 'audio-link') to emit a button
(or an anchor with role="button") with a data-audio-id attribute and an
appropriate aria-label instead of an onclick, keep collecting the hidden <audio>
into audioElements as you do now, and remove the inline handler; then add a
delegated click handler in attachEventListeners that listens for clicks on the
`.audio-link` elements (or the chosen selector), reads
event.currentTarget.dataset.audioId, finds the audio via
document.getElementById(id) and calls .play() (with optional null-check). Ensure
the generated element uses the same unique audioId string you already create.

@chrisvire chrisvire merged commit c92e416 into sillsdev:main Jan 26, 2026
4 checks passed
@chrisvire chrisvire deleted the feature/dab-audio-link branch January 26, 2026 18:08
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.

1 participant