Skip to content

feat(brands): the brand's Prompts tab opens the Prompts page - #2474

Merged
gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:feat/brand-prompts-tab-to-prompts
Nov 17, 2026
Merged

gkhngyk merged 4 commits into
ansvisor:mainfrom
cihan-gyk:feat/brand-prompts-tab-to-prompts

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Stacked on #2473 (→ #2472). Until they land, this diff also shows their commits.

Summary

The Prompts tab in a brand's settings area (beside Topics and Settings) still opened the brand's old Manage prompts page. It was the last link to that page. It now picks that brand and opens Tracked Prompts on the Prompts page, the same way the brand card's prompts row does since #2473.

The old page stays (it is deleted later). Nothing in the app links to /dashboard/brands/[id]/prompts any more.

Changes

  • New web/src/lib/brand-prompts-link.ts, shared by the tab and the brand card: Tracked Prompts' address, plus picking the brand as the link opens. The brand card used to do this inline.
  • Brand layout's Prompts tab (brands/[id]/layout.tsx) picks brand [id] and opens /dashboard/prompts/tracked. It keeps its label and position. A small ↗ arrow shows that it leaves the brand settings area, with an "Opens the Prompts page" description (aria-describedby, and a tooltip). Topics and Settings don't change.
  • Active tab: a tab is marked only when the address is that tab's page (or a page under it). The Prompts tab is marked only when someone lands on the old page directly.
  • Brand card: uses the shared helper. A middle click on its rows now picks the brand too.
  • Opening in a new tab: a Ctrl/Cmd/Shift click picks the brand before the new tab opens. The new tab reads the picked brand that the browser keeps, so it opens on that brand's Tracked Prompts. A middle click does the same (it fires auxclick, not click). The right-click menu's "Open in new tab" doesn't pick the brand: that tab opens Tracked Prompts for whichever brand was already picked.
  • en.json: brands.opensPromptsPage.
  • Help: no article describes this tab or the old page, so Help is unchanged.

How to test

  1. Open a brand's settings (Brands → a brand → Settings). The tabs read Topics, Prompts ↗, Settings. Settings is marked.
  2. Hover Prompts to see "Opens the Prompts page". Click it, or Tab to it and press Enter: Tracked Prompts opens with that brand picked in the brand switcher.
  3. From another brand's settings, Ctrl/Cmd-click or middle-click Prompts: a new tab opens Tracked Prompts for that brand.
  4. Go to /dashboard/brands/<id>/prompts directly: the old page still loads, and its Prompts tab is marked.

Checks

  • npx tsc --noEmit -p .: clean.
  • Vitest: brand layout and all brands/[id] tests (old prompts page included), brand card, brand-prompts-link, the prompts folder, src/lib/help, src/i18n, use-server-exports, brand-path, prompts-routes, mobile nav, brand switcher: 36 files, 402 tests, all pass.
  • New tests: the tab picks the brand and links to Tracked Prompts; none of the layout's rendered links point at the old route (on the settings, topics and old prompts pages); the hint is there; a middle click picks the brand and a right click doesn't; which tab is marked on each page; the helper's unit tests; the brand card's middle click.
  • ESLint and Prettier: clean on the changed files.
  • git merge-tree with feat/prompts-work-improving-link (feat(prompts): show a tracked Improve action under the Work chip #2471): no conflicts.
  • No migration, no server action, no dependency or lockfile change.

Generated by Claude Code

The owner's simpler header for Prompts › Tracked Prompts:

- Title only: the subtitle sentence is gone; the AI meter and Ask Chat
  stay at the right.
- Beside the tabs: Add prompt and a "…" (More actions) menu with Export
  CSV, Manage prompts, Plan & usage and Show usage. Query Fan-out and
  Insights keep Manage prompts in "…"; Topics keeps its own buttons.
- Tracked | Suggestions is one compact switch (links with
  aria-current, same routes and in-place move as the old sub-tabs),
  Tracked with its count, and the date range at the right of the same
  row without its label.
- The Tracked Prompts card is gone. Its Show opened the usage cards;
  "…" › Show usage opens them now, with Hide to fold them, and says
  when the prompt locations are nearly or fully used.
- Location moves into the table's filter row, with no label.
- The not-analyzed banner is one quiet line under the filter row:
  "● 1 prompt not analyzed yet · Analyze", which runs the same volume
  analysis.

Help: tracked-prompts, prompt-suggestions, add-prompts and
prompt-insights updated; approved articles regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
The folded usage cards used to say "46 / 50 prompt locations" in amber
or red in the Tracked Prompts bar; with the bar gone that warning was
only inside the "…" menu. The table's status line now also says
"● 46 / 50 prompt locations used · Plan & usage" when the plan's prompt
locations are nearly (amber) or fully (red) used, beside the
not-analyzed line, wrapping when both show. Plan & usage goes where the
menu's does. The menu keeps its copy.

Help: tracked-prompts says where the warning shows. Its last "Export
CSV downloads the list" line is back as it was (the new section says
where Export CSV is), which keeps it clear of ansvisor#2471's paragraph next to
it. Approved articles regenerated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
Bring the last features of the brand's Manage prompts page into the
Prompts page, and take the Manage prompts links away:

- Prompt Suggestions: By topic picks some of the brand's topics and the
  brand page's generation call writes 5 prompts for each. They are listed
  at the top of the suggestions, grouped by topic, ticked and editable,
  with Add selected (saved under their topic, with the plan's engines and
  the brand's location, as Add prompt's list saves them), Regenerate and
  Dismiss. Admins and managers; the plan guard as before.
- Every suggestion's text can be edited before it is added (pencil, Enter
  keeps it, Esc drops it); + and Add All save the edited text.
  acceptSuggestion and trackSuggestions take the edited text.
- Tracked Prompts: Track now, in the status line and the bulk bar, for
  the active prompts with no answers yet, read and started with the
  brand page's own API calls; the run is saved as the brand's tracking
  job and the line links to Visibility. No navigation away.
- Manage prompts leaves the "..." menu (which now shows on the Prompts
  tab only) and the empty state; a member's empty state says whom to ask.
- The brand card's prompts row opens Tracked Prompts for that brand; the
  mobile menu's second Prompts link goes, the menu's own Prompts item
  opening the page.
- Help: Add prompts, Prompt Suggestions and Tracked Prompts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
The Prompts tab in a brand's settings area opened the brand's old
Manage prompts page, the last link to it. It now picks that brand and
opens Tracked Prompts, as the brand card's prompts row does.

- lib/brand-prompts-link.ts holds what both use: Tracked Prompts' address
  and the pick as the link opens. A click picks the brand (a Ctrl/Cmd
  click too: the new tab reads the pick the browser keeps), and so does a
  middle click, which fires auxclick, not click.
- The tab keeps its label and place, with a small arrow and an "Opens the
  Prompts page" description, as Topics and Settings stay in the area.
- The tab is marked only on the old page's own address, for someone who
  lands there. The old page stays until it is deleted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
gkhngyk
gkhngyk previously approved these changes Nov 17, 2026

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good: the tab sets the brand and opens Tracked Prompts, no redirect loop, old route still renders.

@cihan-gyk
cihan-gyk dismissed gkhngyk’s stale review November 17, 2026 18:05

The merge-base changed after approval.

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@gkhngyk
gkhngyk merged commit 138b944 into ansvisor:main Nov 17, 2026
13 checks passed
gkhngyk pushed a commit that referenced this pull request Nov 18, 2026
The "Add at least 3 topics" and "Add 3 prompts per topic" steps open the
Prompts page (Topics, Prompt Suggestions), whose address names no brand.
They now pick the card's brand as they open, as #2474's links to the
Prompts page do: on a click (a Ctrl/Cmd click too, so a new tab reads the
pick this browser keeps) and on a middle click. Steps on other pages are
unchanged.

- lib/getting-started/steps.ts takes the two steps' addresses from
  lib/prompts-routes.ts (sectionFor), so they follow the Prompts page's
  routes. The addresses are the same as before.
- How a step is marked done is unchanged: topics and prompts are counted
  from the brand's data (getting_started_facts), wherever they were added,
  and no page visit counts. Tests say so.
- No set-up step, Help article, onboarding landing or in-repo email opened
  the brand's old Manage prompts page; nothing else changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
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.

3 participants