Skip to content

feat: Add unlisted transcript review page for participants#29

Open
ufkhan97 wants to merge 1 commit intomasterfrom
feat/unlisted-transcript-review-page
Open

feat: Add unlisted transcript review page for participants#29
ufkhan97 wants to merge 1 commit intomasterfrom
feat/unlisted-transcript-review-page

Conversation

@ufkhan97
Copy link
Collaborator

@ufkhan97 ufkhan97 commented Dec 19, 2025

Summary

Adds the ability for session hosts to share a secure, unauthenticated link with participants so they can view their own session transcript without creating an account.

Can extend into auto-emailing all participants a link to read their transcript. Depends on how Harmonica sends emails.

How it works from this PR:

  1. Host opens a participant's conversation modal
  2. Clicks the new Share button (next to close button)
  3. Link is copied to clipboard
  4. Host pastes link in email/message to participant
  5. Participant opens link → sees only their own transcript

Changes

  • Migration: 032_add_transcript_share_tokens.ts - new table for share tokens
  • Schema: Added TranscriptShareTokensTable type
  • Server Action: share-transcript.ts - generates tokens, sends emails
  • Page: /transcript/[token] - public transcript view
  • UI: Share button in ParticipantSessionRow modal header

Before Merging

⚠️ Migration blocked by pre-existing issue

Run this SQL directly in the database:

  CREATE TABLE transcript_share_tokens (                                                                                                                                   
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),                                                                                                                         
    token VARCHAR(21) NOT NULL UNIQUE,                                                                                                                                     
    user_session_id UUID NOT NULL REFERENCES user_sessions(id) ON DELETE CASCADE                                                                                           
  );                                                                                                                                                                       
                                                                                                                                                                           
  CREATE INDEX idx_transcript_share_tokens_token ON transcript_share_tokens(token);     

Testing

After migration is applied:

  1. Go to a session with participants
  2. Click on a participant row to open conversation modal
  3. Click the Share icon (next to X)
  4. Open link in incognito window
  5. Verify: shows only that participant's messages, no login required

Adds the ability for session hosts to share a secure, unauthenticated link
with participants so they can view their own session transcript.

## What's included:
- New `transcript_share_tokens` table (migration 032)
- Server action to generate share tokens using NanoID
- Public transcript page at `/transcript/[token]?access=public`
- Share button in participant conversation modal
- Email template for sending transcript links (optional)

## Privacy:
- Each token is scoped to a single participant's `user_session_id`
- Participants can only see their own messages, not other participants'
- Links don't expire (valid until session/participant is deleted)
- Page has noindex/nofollow meta tags

## Before merging:
⚠️ Migration needs to be run manually. The automated migration is blocked by a
pre-existing issue (missing migration `002_06122024_add_questions_to_prod`).

Run this SQL directly in the database:
```sql
CREATE TABLE transcript_share_tokens (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  token VARCHAR(21) NOT NULL UNIQUE,
  user_session_id UUID NOT NULL REFERENCES user_sessions(id) ON DELETE CASCADE
);

CREATE INDEX idx_transcript_share_tokens_token ON transcript_share_tokens(token);
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 19, 2025

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

Project Deployment Review Updated (UTC)
harmonica-web-app Ready Ready Preview, Comment Dec 19, 2025 1:52am
harmonica-web-app-dev Ready Ready Preview, Comment Dec 19, 2025 1:52am

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