Repository navigation
feat(action-center): group copies of one signal and count them once - #1059
Conversation
…ls by platform
The Signals list never said which AI platform or location a signal was
about, and named platforms by their raw ids ("Visibility dropped on
gemini-web", "Weak in JP"). Part one of AC-002:
- Each row's Affected cell gets a line with the engines and locations the
signal is about: from the payload for platform and country signals, and
from the prompts' tracked platforms and locations for prompt and topic
signals. A line rather than a column keeps the table within the page
beside a pinned sidebar.
- Platforms and locations read as people know them ("Gemini", "Japan").
- Descriptions carry the measured fact instead of a generic sentence, e.g.
"Your mention rate fell from 34% to 18% against the week before."
- A Platform filter, search over platform and location names, and
platforms and locations columns in the CSV export.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A brand can track the same prompt text as several prompts, and the detectors write one signal per prompt: on production one pass wrote ten identical "Citations lost for '…'" rows, which read as duplicates and inflated every count. Part two of AC-002: - Signals of one kind, about one prompt text (case, spacing and the closing "?" ignored), found in one pass are one row with a "×N grouped" toggle. Opened, it lists each copy with its topic, place and status; each copy keeps its own drawer and menu, and the group's menu acts on the copies it applies to. - The category tabs, the tab badge and the summary cards count groups. Migration 00141 adds signal_group_key (the same rule as lib/signals/group.ts), counts signals_summary over groups, where a group is resolved only once every copy is, and adds signals_new_count for the badge. - A drawer opened from a link to a copy opens its group. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@gkhngyk Part 2 of AC-002, stacked on #1058 (please review the second commit or merge #1058 first). Copies of one signal (the same prompt text tracked as several prompts) are now one row with a ×N toggle, and the tabs, badge and cards count them once. Migration 00141 changes signals_summary and adds signals_new_count; it is applied on my dev database. |
…uping # Conflicts: # supabase/schema.sql
…uping # Conflicts: # supabase/schema.sql
…uping # Conflicts: # supabase/schema.sql
# Conflicts: # supabase/schema.sql
…ure/signals-grouping # Conflicts: # supabase/schema.sql
…ure/signals-grouping # Conflicts: # supabase/schema.sql
…ure/signals-grouping # Conflicts: # supabase/schema.sql
…uping # Conflicts: # supabase/schema.sql
…uping # Conflicts: # supabase/schema.sql
main carries ansvisor#1058 as a squash, so its files come from main and this branch keeps only its own commit on top; schema.sql is regenerated. The export fixtures from ansvisor#1070 gain SignalWhere's new topics field.
gkhngyk
left a comment
There was a problem hiding this comment.
Thanks, approving. 00141 is applied on production. On the largest brand the 30-day cards go from 394 total, 131 important and 212 resolved to 383, 120 and 203, and the badge from 182 to 180: 407 signals fall into 396 groups, three of them with copies, the largest with 10. The new signals_summary takes 30 ms over 90 days.
I merged main into the branch. With #1058 squashed there, its files come from main and the branch keeps only its own commit; schema.sql is regenerated. One change outside this PR's files: SignalWhere now requires topics, and #1070's two export test fixtures didn't set it, so main would have failed the typecheck after this merge. Both fixtures now pass topics: []. CI is green.
…-where main carries ansvisor#1058 and ansvisor#1059 as squashes, so their files come from main and this branch keeps only its own commit on top. The MCP data imports keep both main's prompt-usage helpers and this branch's signal helpers.
…-evidence main carries ansvisor#1058 and ansvisor#1059 as squashes; this branch keeps ansvisor#1060's commit and its own on top.
Summary
Part two of AC-002 (Signals list). Stacked on #1058: this branch contains #1058's commit, so please review the second commit,
feat(action-center): group copies of one signal and count them once, or merge #1058 first.The problem
On production, one pass on Oct 8 wrote about ten identical rows, "Citations lost for 'Which tools track AI search visibility and answer engine optimization performance over time?'".
What changes
Migration
00141_signal_groups.sqlsignal_group_key(id, kind, detected_at, payload): the same rule asweb/src/lib/signals/group.ts. Signals not about a prompt are their own group.signals_summary: 00080's function, counting groups instead of rows. A group is:signals_new_count(p_brand_id): the badge's count of untriaged groups. It returns one number, where the old head count of every row now has to group.schema.sqlis regenerated. On the dev database, the dry run and then the applied migration gave these numbers for the demo brand, which has 16 signals including 4 copies of one lost citation:Review
I ran a code review before opening this. Fixed:
whereobject (now readonly).Left as is:
Related issue
None. Product spec AC-002 (Action Center), part 2 of 2.
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
00141_signal_groups.sql.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/): 0 errors; the 7 warnings are in files this PR doesn't touchyarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Also run:
yarn test: 573/573, new and updated tests:group.test.ts: the key, normalisation, ordering, group status and place.where.test.ts: topics and the merged place.signal-table.test.tsx: a group opens onto its copies, a copy opens its drawer, a selected copy opens its group, and the group menu resolves only the open copies.yarn build: passed.bash supabase/build-schema.sh: schema.sql is up to date.🤖 Generated with Claude Code