You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Renaming a topic zeroes its prompt count on the Manage Topics page #594
Renaming a topic on the Manage Topics page makes its prompt count drop to 0. updateTopic renames only the topics row, but getPromptCountByTopic counts prompts by the legacy prompts.categorystring — which still holds the old name after a rename. The Topics leaderboard, which counts by topic_id, keeps showing the correct number, so the two surfaces disagree.
Reproduction
Create a topic with prompts assigned to it — Manage Topics shows the correct count.
Rename the topic.
The count next to it drops to 0; the Topics leaderboard still shows the real count.
The correct counting path for contrast, keyed on topic_id: topic.ts#L288
category and topic_id are written together on prompt save/update: prompt.ts#L279, #L326
Suggested fix
Either count by topic_id in getPromptCountByTopic (preferred — change the parameter to the topic id and the filter to .eq('topic_id', topicId)), or have updateTopic also sync prompts.category for rows pointing at the renamed topic. The first is a smaller, safer change.
Acceptance criteria
After renaming a topic, its prompt count on Manage Topics is unchanged.
Manage Topics and the Topics leaderboard report the same count for the same topic.
Activity