Repository navigation
feat(prompts): say when a new prompt's first results come in the Table view, as the Locations view does - #1717
Conversation
…columns, and share them with the brand (PROMPT-015, part 1) PROMPT-015a. A Columns panel beside the table's search: - show or hide every column but Prompt, and reorder them by dragging or with the arrows; - saved per person and brand (00363 prompt_table_views, RLS); - an admin or manager can share their columns with everyone on the brand, who see them until they change their own; - Reset goes back to the brand's view, or the default. Nobody who never opens Columns sees a change: the default is today's columns in today's order. The table builds its header and cells by column id, unchanged inside. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Locations view (PROMPT-015, part 2) PROMPT-015b. A Table | Locations switch above Tracked Prompts: - Locations shows each prompt in each location the brand tracks, side by side: Visibility, Position, Mentions or Citations; an average row; a Gap column (best minus worst location); and three cards: the weakest and strongest location and the prompt that differs most between them. - Cells use Brand Visibility's Topics vs competitors shades (HEAT_SHADES, moved beside heatShade). A cell opens the prompt's Positions panel on that location; a location the prompt isn't tracked in offers + Track (its Edit dialog for now). - The Columns panel can add "<metric> · <location>" columns to the table. - getPromptLocationMatrix reads each location with the table's own reads (visibility summaries, position sums), side by side, so a location's numbers equal the table filtered to it. No migration. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… brand (PROMPT-015, part 1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…PT-015, part 2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aving, with more countries (PROMPT-015, part 3) PROMPT-015c. Track in more locations, from the Locations view's + Add location or a cell's + Track: - pick countries or US states (LocationPicker), and the prompts to ask there: the one clicked, the selected, a topic, or all shown; - Plan usage shows used → after of the plan's prompt locations before anything is saved, with the same arithmetic the save enforces (planBulkLocationChange, bulkUpdatePromptLocations); - past the limit the dialog says what the choice needs and what is left, with the plan's way out (Starter: upgrade or a custom plan; Growth: a custom plan; Enterprise: raise the limit), and Save stays off. Prompts can be tracked in about 50 countries (TRACKING_COUNTRIES), not 18; a brand's own region keeps the shorter list that volumes and audits read. PromptLimitActions moves to its own file (a page can't export it). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n answer from one (PROMPT-015, part 4)
PROMPT-015d. A city is the location code `<country>~<CITY>` (`TR~ISTANBUL`),
51 major cities in both lists (server/src/lib/cities.js,
web/src/config/cities.ts; same ids):
- Google AI Overview and AI Mode ask from the city: the provider gets the
city's Google canonical name as `location` beside the country.
- The API models (OpenAI, Claude) get `user_location` with the city and its
region.
- ChatGPT, Perplexity, Copilot, Gemini and Grok can't target a city through
the provider, so locationsForScraper skips city codes for them: no second
country-wide run, no double cost. A prompt tracked only in cities runs
nothing on them.
- A city counts one location on the plan, like a country (decision 6), on
every plan.
Web: the location picker lists cities ("City · Turkey") with a note on which
engines ask there; the Locations view marks a city column "AI Mode · AIO ·
APIs"; Track in more locations turns a city off, and says why, when none of
the chosen prompts runs one of those engines.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ROMPT-015, part 4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…OMPT-015, part 2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ound of reads (PROMPT-015, part 2) The user's bar: data within 1–2 s of a choice. Measured locally (dev, hosted dev DB) the matrix read took 1.4–1.8 s. - getPromptLocationMatrix starts every read at once: the plan's engines no longer wait in front of the locations' reads. - A matrix read stays a minute in the browser (loadLocationMatrix), so going Table ↔ Locations, or back to a location column, reads nothing again; switching the metric was already in the browser. - The Locations button reads ahead on hover or focus, so the view opens on data already there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d-locations # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
…from, read daily from the provider (PROMPT-015, part 5) PROMPT-015e. The tracking provider supports a different set of countries per engine, and asking an engine in a country it doesn't support fails; its GET /v1/countries?model= is the only source of truth (its docs publish no list). So: - The daily run reads every engine's list before tracking (refreshCloroCountries) into cloro_countries (00364). A list that can't be read keeps the last one; an empty or malformed answer never empties it. No provider key (self-hosted, local): nothing read, nothing restricted. - The tracking run skips an engine in a country it doesn't support (supportedLocations), and logs how many pairs it skipped: no failed task, no spent credit. - The location picker offers the countries the engines answer from, named by the runtime's own region names, with "not on <engine>" where one doesn't; cities only where Google's engines answer. Before the first read it keeps its own list. Any country code is now valid on save. Real lists need the provider key: gkhngyk was asked on ansvisor#1625 to paste them, to check the first read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the plan's locations are used up (PROMPT-015, part 6) A location just added to a prompt showed a bare dash until the next daily run. Its cells now say when its answers come or why they won't: - "Within 24h": tracked there, asked by the next daily run; - "Paused": the prompt is paused; - "No engine here": none of the prompt's engines answers from that country (or city), from the engines' country lists (00364). A custom range that ended before today keeps the plain dash. Once the plan's prompt locations are used up, + Track reads "Limit reached" and still opens the dialog with the plan's way out. The dialog's toast says the first results come within 24 hours. useTrackingCountries moves into its own module so the matrix can share it with the location picker. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…their own view with the brand (PROMPT-015, part 1) Someone looking at the brand's shared view without one of their own changed it with every click: a member got "Only admins and managers can share" errors, and a manager hiding one column changed it for everyone. Changes now update the brand's view only after an admin or manager shared their own, which sharing now also saves as theirs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…able (PROMPT-015, part 1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ations-view # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/prompts/_columns-panel.test.tsx # web/src/app/[locale]/(dashboard)/dashboard/prompts/_columns-panel.tsx
… and each location once a minute (PROMPT-015, part 2) Up to twelve locations ran two heavy aggregates each, all at once, on every open, every read-ahead on hover and every new location column. The server now runs at most three of them at a time, the page sends one read at a time, read-ahead included, and each location's figures are kept for a minute on their own, so a new location column reads only its location. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed, resumed, deleted or edited (PROMPT-015, part 2) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d-locations # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
…o longer shown, not to every prompt (PROMPT-015, part 3) Track in more locations opened from a Locations view cell fell back to every prompt shown when the cell's prompt had left the rows. It now targets none, says to choose the prompts, and keeps the save button off until a scope is picked. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…y-tracking # Conflicts: # web/messages/en.json # web/src/app/[locale]/(dashboard)/dashboard/prompts/_add-locations-dialog.tsx
…ntry-wide under its name (PROMPT-015, part 4) An unknown city code read as its country: Google's engines ran without a location and the API models without a city, and both answers were saved with the city's code. The worker now skips such a code for every engine and logs it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…o, and ask Google from its cities as Turkiye (PROMPT-015, part 4) The location lists, labels and docs say Türkiye. The picker finds it, and its cities, typed as Turkey or Turkiye. The cities' Google location names spell the country Turkiye, from one constant, to be confirmed with a real request. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…iye name (PROMPT-015, part 4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e same on the web and the API (PROMPT-015, part 4) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ro-countries # Conflicts: # server/src/workers/tracking-worker.js # supabase/schema.sql # web/src/components/dashboard/location-picker.tsx # web/src/lib/region.test.ts
…try lists (PROMPT-015, part 5) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e view, as the Locations view does
A prompt with no answers in the range showed a dash in every figure
column until its first run. Its row now says it once, in the first
answer column shown (Visibility, Mentions, Citations, Positions, Runs or
Last run, in the person's column order):
- "Within 24h": the next daily run asks it;
- "Paused": the prompt is paused, only when the Status column is hidden,
since Status already says so.
The reason shows in a tooltip on hover and keyboard focus, and reaches
screen readers as the label's description, as in the Locations view
(LocationPending, now usable without a location). With a location
picked, a prompt tracked there says it for that location ("No engine
here" included); one not tracked there keeps the dash. A custom range
that ended before today keeps the plain dash.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…no runs in the range
"Within 24h" showed in every tracked location without answers in the
range, so an older prompt whose runs were missing or failed in it read as
a new one. A location now says it only while its first answers can still
come from the next daily run:
- the prompt was added within the last 48 hours; or
- it has answers in another location in the range, so this one was most
likely just added.
Otherwise the cell keeps the plain dash ("No answers here in this
period"). "Paused" and "No engine here" are unchanged, whatever the
prompt's age. Applies to the Locations view and the Table view's
location columns; the guide says so.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…table-pending # Conflicts: # web/src/app/[locale]/(dashboard)/dashboard/prompts/_location-matrix.tsx # web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx
…le-columns # Conflicts: # supabase/schema.sql
…ro-countries # Conflicts: # server/src/lib/catalog/__fixtures__/fake-db.js
…d in the last two days A row with no answers in the range said "Within 24h" whatever the prompt's age, so an older prompt whose runs were missing or failed in the range read as a new one. The row now says it only while the prompt's first answers can still come from the next daily run (awaitsFirstAnswers): it was added within the last 48 hours or, with a location picked, it has answers in another location column shown. Otherwise its first figure column keeps the plain dash, as the others do. "Paused" (Status column hidden) and "No engine here" (a location picked) are unchanged, whatever the prompt's age. The guide now says which ways of adding a prompt start its analysis right away (Add prompt, Bulk import) and which wait for the next daily run (Prompt Suggestions). Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # supabase/schema.sql
# Conflicts: # supabase/schema.sql
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
gkhngyk
left a comment
There was a problem hiding this comment.
Looks good
Reviewed 68d7dd1. It merged main at ce9a3dc, so its own diff is origin/main...68d7dd11: 7 files. No migration, no server or data code. There is no new query: the row reuses the visibility and location-matrix reads already on the page.
What I checked
-
pendingColumn(). It returns null in four cases:- the row has answers;
- the location picked isn't one the prompt is tracked in;
- the prompt is paused and the Status column already says so;
- no answer column is shown.
Otherwise it returns the first answer column in the person's own column order, so a reordered or hidden Visibility moves the text to the next one. The unit tests cover each case.
-
LocationPendingwithout a location.parsedis null, so the "no engine here" branch can't fire for the whole-prompt cell. Pending uses the newpromptPendingTip, and paused keepspausedTip. With a location picked, the cell passes that location and reads exactly as the Locations view does. -
Region-consistent inputs.
visis read with the region filter applied, sohasAnswersand the cell describe the same location.awaitingstill counts answers from other locations (a location just added), as before. -
Dash cases. An older prompt with no runs in the range, and a range that ended before today, both give a dash (
reachesToday,awaitsFirstAnswers). The new_location-matrixtests cover them. -
The tests catch it. With main's
_location-matrix.tsxunder the PR's tests, the 5 new Table-view cases fail. With the PR's file,_location-matrix.test.tsxandprompt-table-columns.test.tspass (33). The rest of the Prompts folder passes too (121 tests in 13 files; the_columns-panelandpage.testtimeouts under machine load pass when run alone). -
Docs. The
prompts.mdxparagraph matches the behaviour. "Starts analyzing right away when it can" matches theanalyze-newcall on add and bulk import. -
tscis clean, and eslint and prettier are clean on the touched files. It merges cleanly on ce9a3dc and alongside #1719 and #1741, which also touchen.json.
Summary
PROMPT-015 follow-up: the Table view says when a new prompt's first results come, as the Locations view does (#1660).
A prompt with no answers in the window showed a dash in every answer column, even right after it was added. The row now says why once, in the first answer column shown (usually Visibility). It uses the same
LocationPendingcell as the Locations view:en.jsonkey,prompts.locations.promptPendingTip.The other answer columns keep the dash, so each row says it only once.
pendingColumn()inprompt-table-columns.tspicks the column, fromANSWER_COLUMNS. It has unit tests.This PR's own commits:
The branch was cut from #1660's tip. Because #1655–#1660 were squash-merged, the commit list also shows their commits. Files changed shows only this PR's 7 files. There's no migration.
Where people see it: Prompts › Tracked Prompts, Table view, on a newly added prompt's row.
Related issue
PROMPT-015 follow-up (Drive spec). No GitHub issue.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
cd web && npx vitest run src/lib/prompt-table-columns.test.ts "src/app/[locale]/(dashboard)/dashboard/prompts/_location-matrix.test.tsx"Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)What was run:
yarn lintandyarn typecheckpass. No change on main since then touches the Prompts page orprompt-table-columns.ts.prettier --checkandeslintpass on the changed files. The fullyarn format:checkwasn't run, so its box is unchecked.profiles → organizationsfollow-up to 62eb7b7) passes.🤖 Generated with Claude Code