Skip to content

Add silent-gap removal during playback#275

Merged
maboa merged 4 commits into
mainfrom
272-gap-removal
May 22, 2026
Merged

Add silent-gap removal during playback#275
maboa merged 4 commits into
mainfrom
272-gap-removal

Conversation

@maboa
Copy link
Copy Markdown
Member

@maboa maboa commented May 22, 2026

Summary

  • Adds a "Remove Silent Gaps" feature: during playback, automatically skip silences between words that exceed a threshold, preserving a small buffer on each side
    so word edges aren't clipped.
  • New toolbar button (Lucide rabbit icon) opens a modal with a single on/off toggle. Threshold (ms) and buffer (ms) are tucked behind an "Advanced settings"
    disclosure so the default UI stays simple.
  • Settings apply immediately on change — no Apply/Cancel needed.
  • When enabled, the modal shows "Playback shortened by X.Y seconds" computed from the current transcript and settings, updating live as you tweak them.
  • A small primary-colored dot in the corner of the toolbar button indicates when gap removal is active.
  • Plays well with existing strikethrough/redaction logic — gap skipping is layered on top of the same playable-section computation.

Test plan

  • Load a transcript with audio that contains noticeable silences between words.
  • Open the rabbit modal, enable "Skip gaps during playback", and confirm playback skips long gaps.
  • Tweak threshold and buffer in Advanced settings and verify the "Playback shortened by X.Y seconds" figure updates live.
  • Verify the purple dot on the toolbar button shows when enabled and hides when disabled.
  • Toggle some words to struck-through (redacted) and confirm both struck spans and silent gaps are skipped.
  • Reload a transcript while the toggle is on and verify gap skipping still works on the freshly loaded content.
  • Close and reopen the modal; verify the toggle state, advanced inputs, and savings message reflect current settings.

Addresses #272

maboa added 4 commits May 18, 2026 11:17
New toolbar button (fast-forward icon) opens a modal with an enable
toggle, a gap-threshold field (default 500ms), and a buffer field
(default 100ms either side). When enabled, computePlayableSections
breaks playable ranges on gaps between two unstruck words that exceed
the threshold, keeping the buffer on each side so word edges aren't
clipped. Skip ranges share the same audioDataArray as redaction so a
single listener loop handles both.

Also normalise toolbar button spacing to margin-right:4px to match the
right-side buttons, and pin the navbar min-height so it doesn't depend
on button margins (the global "button { margin-bottom: 8px }" rule was
the only thing keeping the navbar tall enough to cover the gap above
the transcript-holder).
Swap the fast-forward icon for a Lucide rabbit on the silent-gap
removal button and add a primary-colored dot in the corner that
appears when gap removal is enabled.
Remove the Apply/Cancel buttons from the silent-gaps modal; the
toggle, threshold, and buffer inputs now apply changes on the fly.
Tuck threshold and buffer behind an "Advanced settings" disclosure
so only the on/off toggle is exposed by default. When gap removal
is enabled, display "Playback shortened by X.Y seconds" computed
from the current transcript and settings.
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