diff --git a/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py b/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py index b50c75ce..a9cb4896 100644 --- a/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py +++ b/buzz/widgets/transcription_viewer/transcription_segments_editor_widget.py @@ -80,6 +80,7 @@ class TranscriptionSegmentsEditorWidget(QTableView): ): super().__init__(parent) + self._last_highlighted_row = -1 self.translator = translator self.translator.translation.connect(self.update_translation) @@ -186,6 +187,11 @@ class TranscriptionSegmentsEditorWidget(QTableView): def highlight_and_scroll_to_row(self, row_index: int): """Highlight a specific row and scroll it into view""" if 0 <= row_index < self.model().rowCount(): + # Only set focus if we're actually moving to a different row to avoid audio crackling + if self._last_highlighted_row != row_index: + self.setFocus() + self._last_highlighted_row = row_index + # Select the row self.selectRow(row_index) # Scroll to the row with better positioning