TranscriptPanel

Panel that renders the active transcript as speaker blocks, paragraphs, and clickable word-level segments. Handles segment selection, hover, inline text editing, CSV loading, and CSV export.

Constructor

new TranscriptPanel(workspace, callbacks)

Parameters:
NameTypeDescription
workspaceobjectthe Workspace controller instance
callbacksobjectcallback functions for transcript interactions
Properties
NameTypeDescription
onSegmentHoverfunctioncalled with segment index when a segment is hovered
onSegmentSelectfunctioncalled with segment index when a segment is selected
onSegmentZoomfunctioncalled with segment index when a segment is double-clicked
onSearchChangedfunctioncalled with a Set of matching segment indices (or null to clear)
onParagraphHoverfunctioncalled with paragraph index when a paragraph handle is hovered
onParagraphZoomfunctioncalled with paragraph index when a paragraph handle is double-clicked

Classes

TranscriptPanel

Methods

clearSearch()

Clears the search bar, removes all highlights, and notifies the workspace.

clearTranscriptPanel()

Clears the transcript body and resets the save button and empty state.

loadFromProject(project)

Loads transcript data from the given project and renders it. Also begins polling for audio readiness to enable the Transcribe button.
Parameters:
NameTypeDescription
projectProjectthe project to load transcript data from

makeSegmentEditable(segIdx)

Turns a transcript segment span into a contentEditable field. Commits the edit on Enter or blur; cancels (restores original text) on Escape. The span text is normalised (trailing space stripped) while editing, then restored with a trailing space on commit. Keyboard events are stopped from propagating so playback shortcuts don't fire.
Parameters:
NameTypeDescription
segIdxnumberindex into loadedSegments

openAddLinkDialog(segIdx)

Opens the hyperlink dialog for the current native text selection if one exists, otherwise adds a link covering the entire segment text.
Parameters:
NameTypeDescription
segIdxnumberindex of the segment that was right-clicked

populateSpeakerFilter()

Populates the speaker filter dropdown from the active project's speakers. Preserves the current selection when possible.

renderTranscript()

Fully re-renders the transcript from the active transcript's speaker blocks.

(async) retranscribeSegments(segIndices)

Retranscribes the given segment indices one at a time, showing progress in the transcription status bar. Preserves the user's edited text while updating word timestamps. Pushes one undo/redo entry per segment.
Parameters:
NameTypeDescription
segIndicesArray.<number>indices into the active project's transcript segments

setActiveSegment(segmentIdx)

Marks the segment at segmentIdx as active (scrolls it into view) and removes the active class from the previous one. Called as the playhead moves through audio.
Parameters:
NameTypeDescription
segmentIdxnumbersegment index, or -1 to clear

setActiveWord(time)

Highlights the word span (if any) that contains the given playback time within the currently active segment. Clears any previously highlighted word.
Parameters:
NameTypeDescription
timenumbercurrent playback time in seconds

setHoveredSegment(segmentIdx)

Applies the hover CSS class to the segment at segmentIdx and removes it from the previous one.
Parameters:
NameTypeDescription
segmentIdxnumbersegment index, or -1 to clear

setSelectedSegment(segmentIdx)

Applies the selected CSS class to segmentIdx and removes it from the previous selection.
Parameters:
NameTypeDescription
segmentIdxnumbersegment index, or -1 to clear

startPollingAudioReady()

Public entry point called once the waveform has fully loaded for a server project.