Skip to content

feat: add useTranscript hook with dedup and buffer#18

Merged
robinandeer merged 2 commits intomainfrom
04-13-feat-add-usetranscript-hook-with-dedup-and-buffer
Apr 16, 2026
Merged

feat: add useTranscript hook with dedup and buffer#18
robinandeer merged 2 commits intomainfrom
04-13-feat-add-usetranscript-hook-with-dedup-and-buffer

Conversation

@robinandeer
Copy link
Copy Markdown
Collaborator

@robinandeer robinandeer commented Apr 13, 2026

Goal

Add a stateful useTranscript hook that returns an accumulated, deduplicated transcript array — addressing feedback that the existing useTranscription callback hook is unreliable for rendering transcript UI.

The existing callback-only API forces every consumer to manually accumulate state and handle segment deduplication (LiveKit re-sends the same segment id as interim → final). This new hook does that internally, making transcript UI trivial to build.

What changed

  • useTranscript(options?) — new hook returning Array<TranscriptionEntry>, deduped by segment id with a configurable bufferSize (default 100)
  • Non-breakinguseTranscription is unchanged; useTranscript is additive
  • Updated exports, export test, and AGENTS.md

Usage

function TranscriptOverlay() {
  const transcript = useTranscript();
  return (
    <ul>
      {transcript.map((entry) => (
        <li key={entry.id}>{entry.participantIdentity}: {entry.text}</li>
      ))}
    </ul>
  );
}

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
avatars-playground Ready Ready Preview, Comment Apr 13, 2026 8:56pm

Request Review

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@robinandeer robinandeer marked this pull request as ready for review April 13, 2026 20:57
@robinandeer robinandeer merged commit e04527a into main Apr 16, 2026
6 checks passed
@robinandeer robinandeer deleted the 04-13-feat-add-usetranscript-hook-with-dedup-and-buffer branch April 16, 2026 01:33
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