DAB: Implement audio link clips#930
Conversation
📝 WalkthroughWalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
3c16f86 to
54c3a27
Compare
There was a problem hiding this comment.
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.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.