Skip to content

feat(prompts): fold Tracked Prompts' usage with Show/Hide on the right, as the Content plan does - #1345

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/tracked-prompts-show-hide
Oct 22, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/tracked-prompts-show-hide

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

From the user: they liked the Content plan's "What AI cites in your topics" fold (#1330), with Show/Hide on the right, and asked for the same on Tracked Prompts, to the right of Plan & usage.

  • The whole bar opens and closes the usage cards, as the Content plan's does. The bar gets a hover tint.
  • A "Show ˅ / Hide ˄" button (aria-expanded, aria-controls) sits at the bar's right end, after Plan & usage. Its accessible name is "Tracked Prompts: Show" (a visually hidden prefix).
  • Plan & usage stops the click from reaching the bar, so it goes to its page without folding or unfolding. Without it (self-hosted, no plan page), Show takes the right end.
  • The arrow left of the title goes, and the title is plain text.
  • Unchanged from feat(prompts): fold the Tracked Prompts usage cards under their title #1130: it opens closed, and the prompt-locations pill shows while folded.
  • Copy: prompts.usage.show and hide.

Web only.

Related issue

None. Product feedback from the user.

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. On Ansvisor Cloud with a paid plan, open /dashboard/prompts/tracked. The Tracked Prompts bar shows "Plan & usage", then "Show ˅" at its right end.
  2. Click anywhere on the bar: the cards open and the button reads "Hide ˄". Click again: they close.
  3. Click Plan & usage: it opens the plan page, and the bar doesn't fold or unfold.
  4. Self-hosted: no Plan & usage, and Show sits at the right end.

Checked in light and dark, at 1280 px and at phone width. To see Plan & usage locally, I ran the preview with NEXT_PUBLIC_IS_CLOUD=true and the demo org on Growth, then put both back.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

yarn test: 283 files, 2,496 tests pass. yarn build passes with CI's placeholders.

🤖 Generated with Claude Code

…t, as the Content plan does

The usage header gets the Content plan's "What AI cites" fold: the whole bar
opens and closes it, and a "Show"/"Hide" button with a chevron sits at its
right end, after Plan & usage (which still goes to its page without
folding). The arrow left of the title goes. It still opens closed, with the
prompt-locations pill while folded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cihan-gyk

Copy link
Copy Markdown
Collaborator Author

@gkhngyk A small design PR: Tracked Prompts' usage header now folds like the Content plan's "What AI cites" bar (#1330): the whole bar toggles, with Show/Hide on the right after Plan & usage. #1130's behaviour (closed on open, the pill while folded) is unchanged. Web only.

@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. One optional follow-up:

  1. Hovering Plan & usage looks like it folds the cards. The bar's hover:bg-muted/50 and the button's group-hover:underline also fire while the pointer is on the link (web/src/app/[locale]/(dashboard)/dashboard/prompts/_usage-cards.tsx:276, :317), but the link only goes to its page. To fix it, add has-[a:hover]:bg-transparent to the bar and group-has-[a:hover]:no-underline to the Show button.

The rest checks out:

  • The bar toggles the cards. The button and the link both stop propagation, so a click on either never toggles twice or folds the cards by accident.
  • aria-expanded and aria-controls stay on the one real button.
  • show and hide are in en.json.
  • The tests cover a title click, a button click and a link click.

This merges cleanly on main and with #1333.

Tested on top of main together with #1323: web and server tests, tsc, lint and Prettier pass.

@gkhngyk
gkhngyk merged commit 87b109a into ansvisor:main Oct 22, 2026
6 checks passed
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.

2 participants