Repository navigation
feat(prompts): show a tracked Improve action under the Work chip - #2471
Merged
gkhngyk merged 1 commit intoNov 17, 2026
Merged
Conversation
On Tracked Prompts, a row whose prompt has an Improve action still being tracked (PROMPT-008) now shows a small "AC-12 · Improving" link under its Work chip. It opens the same positions panel the row menu opens, on its Improve tab. Rows without one look as before; the chip is unchanged. - lib/improving-actions.ts: readImprovingActions, the one read both the panel's "Improving" chip and the table use. One actions query for up to a page of prompt ids, scoped to the brand (and the caller's organisation through RLS), by pickImprovingAction's rule; the query leaves out statuses and final reads that rule never picks, as the server sweep does. - getPromptPositions reads its chip through it; getImprovingPrompts (a read-only server action next to it) gives a page of rows in one call. - The Work cell reads it once per page, again when the panel closes. - Help: one line in the Tracked Prompts article. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
cihan-gyk
pushed a commit
to cihan-gyk/ansvisor
that referenced
this pull request
Nov 17, 2026
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
This was referenced Nov 17, 2026
gkhngyk
approved these changes
Nov 17, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good. Minor: the Work-cell link refreshes only when the positions panel closes, so an Improve action made in the Action Center shows after the next page change.
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Prompts › Tracked Prompts, a row whose prompt has an Improve action that is still being tracked now shows a small link under its Work chip, for example "AC-12 · Improving". Clicking it opens the same right-side positions panel the row menu's Improve position… opens, on its Improve tab. Rows without such an action look exactly as before, and the Work chip ("Done" / "Set status ⌄") is unchanged. There is no new column.
"Still being tracked" is the rule the panel's "Improving" chip already uses (PROMPT-008,
pickImprovingAction). Both the panel and the table now read it through one shared helper.Changes
web/src/lib/improving-actions.ts(new, plain module):readImprovingActions(supabase, brandId, promptIds). It reads the actions table once for up to 100 prompt ids (one table page) and gives each prompt its newest Improve action that is still tracked, usingpickImprovingAction. The query skips rows that rule never picks: statuses outside new / in progress / on hold / completed, and completed actions whose final read is recorded. The server's daily sweep filters the same way, so old final reads can't fill the row limit.web/src/lib/improve-outcome.ts: exports the tracked statuses (IMPROVE_TRACKED_STATUSES) so the query andpickImprovingActionshare one list.web/src/lib/actions/prompt-positions.ts:getPromptPositions(the panel) reads its chip through the shared helper. As before, a failed read shows no chip and does not fail the panel.getImprovingPrompts(brandId, promptIds): one call for a page of rows. It validates the ids (UUIDs, at most 100). It only exports async functions.web/src/app/[locale]/(dashboard)/dashboard/prompts/_improving-link.tsx(new):useImprovingPrompts: one read for the rows on screen. It reads again when the positions panel closes, so an Improve sent from the panel shows up on its row. It shows nothing until the read returns or if it fails.ImprovingLink: a real<button>with an accessible name and a tooltip ("Open the Improve tab · AC-12 is still being tracked"). It is capped atmax-w-24and wraps under the chip, so it does not widen the column.page.tsx: the Work cell adds the link under the existing chip and cited-URL count, and calls the existingopenPositionsPanel(p.id, 'improve'). Nothing else in the table changes.web/messages/en.json:prompts.columns.improving.{label,title,aria}.help/prompts/tracked-prompts.md("Open a prompt or act on it"), regeneratedapproved-articles.json.Safety
dbClient). The actions query filters onbrand_id. The actions and brands RLS policies only allow brands in the caller's organisation and brand access.getImprovingPromptsalso reads the brand row through RLS and returns nothing if the brand isn't visible. The helper ignores any returned row whosebrand_idor prompt id wasn't asked for, so another brand's action can never show.actionsquery per table page (up to 100 ids in oneinfilter, the same sizeprompt-positionsalready uses per request), plus one single-rowbrandsread in parallel. It is never one query per row. It doesn't touchprompt_results. The filterbrand_id = … and status in (…)uses the existingactions_brand_status_idx. There is no migration, new index or RPC.use-server-exportspasses.How to test
Checks
npx tsc --noEmit -p .inweb/: clean.prompt-improve*,improve-outcome, newimproving-actionsandactions/prompt-positionstests,src/lib/help,src/i18n,use-server-exports,subscription-guardandsubscription-guard-coverage,embed-hints,actions/read-only: 38 files, 409 tests passed.approved-articles.jsonare left as the generator writes them; Prettier would reflow the article's front matter.Generated by Claude Code