Skip to content

feat: add votes CSV download and date-prefix option to download modal#36

Merged
patcon merged 3 commits intomainfrom
feat/35-download-votes-csv
Mar 6, 2026
Merged

feat: add votes CSV download and date-prefix option to download modal#36
patcon merged 3 commits intomainfrom
feat/35-download-votes-csv

Conversation

@patcon
Copy link
Copy Markdown
Owner

@patcon patcon commented Mar 6, 2026

Summary

  • Adds a Download Votes CSV button to the existing download modal alongside the participants CSV button
  • Adds a Switch toggle to prefix filenames with today's date (YYYY-MM-DD-)
  • Uses conversation_id from the h5ad file as a filename prefix when available (e.g. my-convo-vote-matrix.csv)
  • Reads uns['conversation_id'] from h5ad files and threads it through to the download modal

Vote matrix format

participant_id,stmt_1,stmt_2,...
p001,1,-1,
p002,,1,-1

Rows = participants, columns = statement IDs, values = 1/-1/0 or empty (no vote).

Test plan

  • Load an .h5ad file in Perspective Explorer
  • Open the download modal — verify both buttons appear
  • Download vote-matrix.csv and verify row/column structure and vote values
  • Verify participants.csv still works
  • Toggle the date-prefix switch and confirm filenames change
  • npm run build passes with no TypeScript errors

Closes #35

🤖 Generated with Claude Code (~350 words of LLM output from ~600 words of human prompt)

patcon and others added 3 commits March 5, 2026 21:47
- Add `conversationId` field to H5adData (read from uns['conversation_id'])
- Add getAllVotes() to duckdb.ts for querying the full vote table
- Rename DownloadObsCsvDialog → DownloadDialog with second "Download Votes CSV" button
- Add Switch toggle to prefix filenames with today's date (YYYY-MM-DD-)
- Use conversationId as filename prefix when available
- Wire conversationId through showcase-lander → convo-explorer App

Closes #35

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move action buttons into dialog body and leave only Cancel in footer,
so buttons don't overflow the modal on smaller widths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Swap AlertDialogAction for Button so clicks don't auto-close the dialog,
allowing both CSVs to be downloaded in one session.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@patcon patcon merged commit 947556d into main Mar 6, 2026
2 of 3 checks passed
@patcon patcon deleted the feat/35-download-votes-csv branch March 6, 2026 03:37
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.

feat: add votes.csv download button to download modal

1 participant