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
Topics: add an "Add topic" action to the main Topics page #462
The main Topics page (/dashboard/topics) is read-only: KPI cards and the Topic leaderboard, with no way to add a topic. Creation lives only in Brands → [brand] → Topics (web/src/app/[locale]/(dashboard)/dashboard/brands/[id]/topics/page.tsx) — buried in brand management, same gap #460 covers for prompts: you should be able to add where you see the list.
Use the existing singular createTopic(brandId, name) action (web/src/lib/actions/topic.ts). Do not use the plural createTopics — it deletes all of the brand's topics before inserting (an onboarding-only resubmit behavior) and would wipe existing topics.
The add dialog on the brands/[id]/topics page is the styling/validation reference — share rather than fork if practical (trim, non-empty, duplicate-name check against existing topics).
After adding: close the dialog, refresh the leaderboard; the new topic appears with zero metrics until prompts are assigned — a short toast pointing at that ("assign prompts to this topic to start tracking it") avoids confusion.
The leaderboard's empty state should get the same button.
Role gate: hide or disable for members without write access (canManage from useUserRole).
Acceptance criteria
Add topic button visible in the page header (and empty state) for admin/manager; works for the active brand.
Duplicate names are rejected with a clear message; whitespace-only input can't be submitted.
The new topic shows up in the leaderboard immediately after adding.
Members without write access don't see (or can't use) the button.
Existing topics are never touched by the add flow.
Getting started
See CONTRIBUTING.md for setup. From web/, yarn lint, yarn typecheck and yarn format:check must pass. Comment here to claim the issue before opening a PR.
Activity
BharadwajKanneveti commentedon Jul 18, 2026
Hi @gkhngyk can I work on this issue?
gkhngyk commentedon Jul 22, 2026
Hi @BharadwajKanneveti, I've assigned you. Thank you!
BharadwajKanneveti commentedon Jul 22, 2026
Sure @gkhngyk I will raise the PR for this