Skip to content

feat(insights): open on 24h, always compare same prompts, drop the trend's AC markers and Send biggest gap - #1100

Merged
gkhngyk merged 5 commits into
ansvisor:mainfrom
cihan-gyk:feature/insights-simplify
Oct 17, 2026
Merged

gkhngyk merged 5 commits into
ansvisor:mainfrom
cihan-gyk:feature/insights-simplify

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Four simplifications to the Insights (Visibility) page, from product feedback.

Before Now
Default range 30 days (VIS-007) The last 24 hours; longer ranges are one click away, and Reset returns to 24h
"Compare: Same prompts" switch (VIS-002) On by default, could be turned off Gone; changes always compare the prompts answered in both periods
Trend markers "+" for prompt days and "A" for days Action Center actions were sent, with "AC-61 sent · date" lines under the chart Prompt-day markers only; the "A" markers and their lines are gone
"Send biggest gap to Actions" (VIS-010) Button on the Topics vs competitors heat map Gone; the heat map itself is unchanged

Why:

  • 24h: the page should open on what the latest run found.
  • The switch: few would turn it off. Turning it off made adding prompts inflate every change (e.g. +203% mentions), so its safe behaviour is now the only one. The numbers themselves still cover every prompt.
  • The "A" markers: the trend should show visibility, not Action Center activity. The Action Center goal line stays.
  • "Send biggest gap": the action it created had tasks too general to act on.

How

One commit per change:

  1. feat(insights): open on the last 24 hours: DEFAULT_FILTERS.datePreset is '24h'.
  2. feat(insights): always compare changes on the same prompts
    • samePrompts leaves the filters and the URL; the page always asks for same-prompt changes.
    • A link with ?compare=all from before is cleaned up.
    • The Formulas dialog says how changes are compared.
    • The unused insights.compare.label and samePrompts strings are removed. hint, newExcluded and newIncluded stay, since the summary line and Why it changed use them.
  3. feat(insights): drop the Action Center markers from the trend
    • lib/insights-trend.ts no longer reads actions_sent or keeps an "actions" marker kind.
    • The trend card drops its "A" lines.
    • Tests are updated.
  4. feat(insights): remove "Send biggest gap" from the heat map: the button and the code only it used are removed: sendTopicGapToActionCenter, TopicGapWindow and biggestGap with its test, and its strings.

Left as is, for a follow-up if wanted:

  • the server's POST /api/topics/:id/gap-action and the topic_competitor_gap kind (actions already sent still open);
  • insights_trend_markers (00136) still computing actions_sent, which nothing reads now.

Note on 24h: the Topics vs competitors heat map and the trend's goal line need more than one day of trend points, so the default 24h view doesn't show them; 7d, 30d and 90d do, as before.

These depart from Visibility spec v2 (VIS-002, VIS-007's default and markers, VIS-010's button), which will be updated to match.

Related issue

None. Product feedback on the Insights page.

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. Open Insights. The 24h range is selected, and the filter bar has no "Compare" switch.
  2. Switch to 30d.
    • The trend shows "+ N prompts added" markers and no "A" markers or "AC-… sent" lines.
    • Topics vs competitors has no "Send biggest gap" button.
  3. Open Formulas: the "Changes" section says changes compare the prompts answered in both periods.
  4. Open an old link with ?compare=all: the parameter is dropped, and changes still compare the same prompts.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): no errors; the 7 warnings are in files this PR does not touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Also run:

  • web: yarn test passes (849 with main merged in), and yarn build passes. lib/insights-trend.test.ts covers the prompt-only markers and the payload's actions_sent being left out.

  • In the browser (demo data):

    • 24h is selected on open, with no switch, no "AC-… sent" line and no gap button;
    • at 30d, the trend lists only "+ prompts added" markers, and the heat map renders without the button.

    I checked at 1024px, in the light and dark themes.

  • Review: a code review raised the Formulas heading still naming "Same prompts" and a per-kind marker constant; both are fixed. The default view's missing heat map is noted above, and the server route and RPC field are listed as follow-ups.

🤖 Generated with Claude Code

cihan-gyk and others added 5 commits October 16, 2026 22:02
Insights opened on 30 days (VIS-007); it now opens on the last 24 hours,
what the latest run found, and the longer ranges are one click away. Reset
returns to 24h too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The "Compare: Same prompts" switch (VIS-002) is gone and its behaviour is
always on: every change compares only the prompts answered in both periods,
so adding prompts doesn't inflate it. The numbers themselves still cover
every prompt. A link with ?compare=all from before is cleaned up, and the
Formulas dialog says how changes are compared.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The trend no longer marks the days Action Center actions were sent: the "A"
markers and their "AC-61 sent · date" lines under the chart are gone. The
days the most prompts were added and the Action Center goal line stay.
insights_trend_markers (00136) still returns actions_sent; the web no
longer reads it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
"Send biggest gap to Actions" (VIS-010) sent a Compete action whose tasks
were too general to act on, so the button goes, with the server action and
the biggestGap helper only it used. The heat map is unchanged. The server's
POST /api/topics/:id/gap-action and the topic_competitor_gap kind stay for
the actions already sent.

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

Copy link
Copy Markdown
Collaborator Author

@gkhngyk could you review this when you have a moment? Product feedback on the Insights page: open on 24h, always compare same prompts (the switch goes), drop the trend's Action Center "A" markers, and remove "Send biggest gap" (its tasks were too general). One commit per change; the server gap-action route and insights_trend_markers' actions_sent are left as follow-ups.

@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.

Thanks, approving. Web tests pass on the tree merged with main and #1101/#1102/#1078/#1079. The default 24h read (insights_aggregates over the last day) takes ~0.2 s warm on the largest brand, ~4 s cold.

@gkhngyk
gkhngyk merged commit 0d81dd8 into ansvisor:main Oct 17, 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