Repository navigation
Show a sound's matched moment on the Sound picker's waveform - #32
Merged
Merged
Conversation
When a search hit matched a spoken line, or the hit is a GAM clip, the
picker's waveform now dims everything outside that stretch, tints the
stretch itself, and opens the player at its start. The readout line says
which stretch it is ("matched at 0:11–0:18", or "clip of 0:10–0:25" for a
clip). This is display only: a track is still used whole.
The seek waits for loadedmetadata, because a seek before the browser
knows the duration is silently ignored. The player is keyed on the
moment, so two hits on one file each reopen at their own moment, as the
video preview already does. The tint is needed in dark mode, where dimmed
gray bars and plain ones look almost the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1geD3VLg4aqTvHVuRLA53
davior
marked this pull request as ready for review
October 29, 2026 02:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A follow-up to #31. In the Sound picker, when a hit has a moment, the waveform preview now marks it.
Which hits have a moment:
start_time/end_time, sized by the existingmomentTrim);in_point/out_point, which line up with the waveform because a clip plays its parent's file.What changes for such a hit:
2:00 long · matched at 0:11–0:18, or… · clip of 0:10–0:25.This is display only: "Use this track" still uses the whole file.
How
WaveformPlayertakes an optionalmoment.z-10over wavesurfer's own layers, which stack at z-index 2 and 5. This is the same fix GAM's clip window needed.loadedmetadata, because a seek made before the browser knows the duration is silently ignored.trim.Testing
npm test: 204 passed. The new tests cover:lint, Prettier andbuildare clean.0:15 long · clip of 0:10–0:25;Generated by Claude Code