Repository navigation
Description
Problem
The All Prompts table opens sorted by creation date, newest first. That is a convenient default, not a useful one: after the first week it tells the user nothing, and it answers a question nobody is asking on a visibility product's prompt list.
The table already sorts by visibility — the column header is clickable and the choice persists to the URL — so today every user who wants the obvious view has to click to get it, on every fresh visit that doesn't carry the query string.
Default to visibility, highest score first, so the list opens as a leaderboard: the prompts the brand is strongest on at the top, weakest further down.
Where it lives
- Default ordering: prompts/page.tsx — the
if (!activeSort)branch infiltered, currentlycreatedAtdescending - Sort state and URL sync: same file,
activeSort/dirread fromsearchParams - Comparator: prompt-sort.ts
The part that is easy to get wrong
The header indicator has to agree with the default. activeSort is null when the URL carries no sort parameter, and the sort arrow only renders on the active column. Changing just the fallback ordering would leave the table sorted by visibility while every header still reads as unsorted — the user clicks Visibility expecting something to happen and gets the same order back. So the default has to make visibility the active sort, not merely the fallback comparison.
Re-clicking must still toggle to ascending, and the URL should keep behaving as it does now.
A deliberate consequence, not a bug
compareNullsLast sends null values to the bottom in both directions, on purpose — ascending shouldn't fill the top of the table with blank rows. A prompt that has never been tracked has no visibility score, so under this default newly added prompts sort to the bottom until their first run.
That is the correct behaviour and should stay, but it is worth knowing: someone who adds twenty prompts and reloads will find them at the end of the list rather than the top, which the previous newest-first default gave them for free. If that turns out to bother people in practice, the fix is a separate conversation about surfacing untracked prompts, not a change to the comparator.
Acceptance criteria
- Opening the All Prompts tab with no query string sorts by visibility score, highest first.
- The Visibility header shows itself as the active sort in that state.
- Clicking Visibility toggles to ascending; clicking another column behaves exactly as it does today.
- A shared or reloaded URL that already carries
sortanddirstill wins over the default. - Prompts with no visibility score remain at the bottom in both directions.
Activity
Rithikmahadev12 commentedon Aug 12, 2026
I can implement this by initializing activeSort to 'visibility' and dir to 'desc' when no query parameters are present, and adjusting the header indicator logic to reflect that default state. I estimate the work at $10 USD, contingent upon the scope remaining as straightforward as the issue description indicates. Please confirm whether you would like me to proceed, and I will submit the changes within a day or two of getting the go-ahead. I am offering to handle this fix should it align with your current priorities.
Pavel-glitch-ui commentedon Aug 13, 2026
Hi i can fix this!
Pavel-glitch-ui commentedon Aug 13, 2026
@gkhngyk check it out
Rithikmahadev12 commentedon Aug 14, 2026
Just following up — happy to go ahead on this once you give an explicit thumbs up on the $10 estimate. If the scope turns out bigger once I'm in the code I'll flag that before doing anything, but wanted a clear yes on the price before starting.