Skip to content

fix(prompts): show what "Late or missing" leaves and put the furthest behind first - #1098

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/prompts-late-missing-filter
Oct 16, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/prompts-late-missing-filter

Conversation

@cihan-gyk

@cihan-gyk cihan-gyk commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Clicking "Late or missing" on Tracked Prompts seemed to do nothing. It now says how many prompts it leaves and lists the furthest behind first.

The filter worked, but its effect was invisible:

  • Nearly every prompt qualifies. A prompt counts as late or missing if it is named late, or in fewer than half its answers, on at least one platform (feat(prompts): show average position and trend in the Positions column #1017, the Improve tab's rule). On production, every one of the 202 prompts answered in the last 24h matched.
  • The order didn't change. The list kept its sort, so the first page looked the same and only the row count at the bottom changed.

The definition stays as #1017 set it. What changes:

Before Now
Button Late or missing Late or missing · 202: the prompts it leaves, after search, prompt status (#1054) and work status
Order while on The table's sort (Visibility) Furthest behind first (below)
A column picked before Kept Set aside while the filter is on, back when it's off

Furthest behind first (compareLateness in lib/prompt-position-summary.ts):

  1. late or missing on the most platforms;
  2. then missing on more of them;
  3. then the worse average position, a prompt never ranked counting as the furthest back;
  4. then the higher Visibility.

Sorting while the filter is on:

  • No column shows as sorted, and a screen-reader caption says what the order is.
  • Clicking a header sorts by that column as usual, starting from its usual direction.
  • Turning the filter off brings back the column set aside, unless a header was clicked in between; then that column stays.

Also: the button's text and title move to en.json (prompts.lateFilter).

Depends on #1094 for 30d and 90d. On main those ranges still lose most prompts' positions to the 1000-row cap, so the count reads low there (167 instead of about 700 on production) until #1094 merges. 24h and 7d are not affected.

Related issue

None. Reported by the user on the live Tracked Prompts 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 Prompts → Tracked Prompts and look at the button: it reads Late or missing · N.
  2. Type in the search box, or change the prompt status (Active / Paused) or the work status. N follows.
  3. Sort by a column, e.g. Position, then turn the filter on.
    • The list keeps N prompts, starting with the one late or missing on the most platforms. Hover its Positions value to see them.
    • No column shows as sorted.
  4. Click a header. It sorts by that column, starting at its usual direction.
  5. Turn the filter off: Position's sort comes back. If you clicked a header in step 4, that column stays instead.

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 (802, with main merged in for feat(prompts): show usage cards above the tracked prompts table #1054's usage cards), and yarn build passes. lib/prompt-position-summary.test.ts tests compareLateness:

    • the most late or missing platforms first;
    • then missing, then the worse average;
    • never ranked counts as furthest back;
    • no cell comes last.
  • In the browser (demo data, 30d):

    • the button read · 5, and turning it on left 5 of 10 prompts, ordered 8, 6, 3, 2 and 2 platforms behind;
    • a header click sorted from its usual direction;
    • turning it off brought back the column set aside, or kept one clicked in between;
    • a quick double click left it off with the sort intact.

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

  • Production, read only: before the change, the filter took 24h from 709 to 202 prompts with the first page unchanged.

  • Review: a code review raised:

    • ties falling back to the roster order;
    • a stale toggle on double click;
    • the picked sort being lost;
    • no screen-reader cue for the order.

    All four are fixed above. A test of the page wiring was left out; the behavior was checked in the browser.

🤖 Generated with Claude Code

… behind first

Clicking "Late or missing" on Tracked Prompts seemed to do nothing. It
filtered, but nearly every prompt with answers is late or missing on at
least one platform (on production, 202 of the 202 answered in 24h), and the
list kept its order, so the first page stayed the same and only the row
count at the bottom changed.

The definition stays (ansvisor#1017). The button now says how many prompts it
leaves ("Late or missing · 202", after search and work status), and while
it is on the list starts with the prompts furthest behind:
- late or missing on the most platforms;
- then missing on more of them;
- then the worse average position, a prompt never ranked counting as
  furthest back;
- then the more visible.

A column picked before is set aside and comes back when the filter is
turned off, unless a header is clicked in between; a header click starts
at its usual direction. The order is announced in a screen-reader caption,
and the button's text moves to en.json.

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? "Late or missing" on Tracked Prompts filtered, but on production every prompt answered in 24h matched (202 of 202) and the order didn't change, so clicking it looked like nothing happened. The definition from #1017 stays; the button now shows its count and the filtered list starts with the prompts furthest behind. At 30d and 90d its count relies on #1094 (the 1000-row cap).

…ssing-filter

# Conflicts:
#	web/src/app/[locale]/(dashboard)/dashboard/prompts/page.tsx

@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 its neighbours (832), and the late-only state only changes through toggleLateOnly, so the ref and the state stay in step. As you note, the count reads low at 30 and 90 days until #1094 lands.

@gkhngyk
gkhngyk merged commit ddd0513 into ansvisor:main Oct 16, 2026
5 checks passed
gkhngyk added a commit to cihan-gyk/ansvisor that referenced this pull request Oct 16, 2026
…entioned

Keeps both sides where ansvisor#1098 added compareLateness next to positionCellKind and opensPositionsPanel.
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