Skip to content

Prompts: CSV export writes an always-empty topic_id column #590

Closed

Description

@gkhngyk

Problem

The Prompts CSV export writes a topic_id column that is always empty. Prompt.topicId is declared in the type and read by the export, but mapPromptRow never populates it from the topic_id DB column — so p.topicId is undefined for every row and the export falls back to ''.

The column is written on save/update/add, so the data exists in the database; it just never makes it into the mapped object.

Evidence

Suggested fix

Add topicId: (row.topic_id as string | null) ?? undefined to mapPromptRow. The getPromptSets query already selects prompts(*) (prompt.ts#L130), which includes topic_id, so no query change is needed.

Acceptance criteria

  • Exporting prompts that have a topic produces non-empty topic_id cells.
  • Prompts without a topic still export an empty cell.

Activity

  1. added
    bug
    good first issue
    on Aug 3, 2026
  2. BharadwajKanneveti commented on Aug 3, 2026

    @BharadwajKanneveti
    Contributor

    Hi @gkhngyk Can I work on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions