Skip to content

fix(action-center): one date sort, most recent first by default, a clickable Updated column, AC numbers on rows, and no tab or menu counts - #2418

Merged
gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/action-center-date-sort
Nov 15, 2026
Merged

gkhngyk merged 2 commits into
ansvisor:mainfrom
cihan-gyk:fix/action-center-date-sort

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

The owner asked for these three changes after reviewing the Actions list (/dashboard/action-center/actions).

  1. Sorting. With Sort: Newest, the Updated column read "5d, 5d, 6d, 16d, 8d, 23d, 24d, 21d ago". Newest sorted by when an action was created, a date the list never shows, so the order looked wrong. People also couldn't tell Newest from Recently updated. Now the list has one date sort, by the date it shows. The list opens on Recently updated (most recent first), and clicking the Updated or Priority Score header sorts by that column. Priority is still in the dropdown.
  2. Action numbers. Chat refers to actions by number ("AC-251"), but the list never showed those numbers. Now each row shows its number, the list's search finds an action by it, and the CSV includes it. (Moving to per-brand numbers, AC-01…, is a separate PR; it only needs to change the two helpers below.)
  3. Tab and menu counts. The counts didn't match the lists: "Signals 207" sat above a list whose All chip said 445, "Actions 53" above 55, and the menu's Action Center said 53. Each count was counting a different set from its list. The owner asked to remove these numbers rather than make them match. The menu's coloured dots already show when something is new or waiting, and each list shows its own count.

The changes are in two commits: sorting and numbers first, then the count removal.

Changes

Sorting

  • One date sort. Recently updated is the default when the URL has no ?sort=. Newest is gone from the dropdown, and old ?sort=newest links open the same date sort, so they still work. Priority and Due date are unchanged.
  • Clickable headers.
    • The first click on Updated sorts most recent first. A click while the list is already sorted that way turns it to oldest first (?sort=updated_asc).
    • Priority Score works the same way: highest first, then lowest first (?sort=priority_asc). Actions with no score yet stay last in both directions.
    • Each header shows an arrow and aria-sort. The dropdown's trigger names the current sort, for example "Least recently updated".
    • The default sort stays out of the URL, as the page's other defaults do.
  • Stable ties. Rows with the same date are ordered by action number (newer first), then by id. The reversed sort is the exact reverse, so rows with equal dates don't swap places between loads.
  • Server read. getActions used to read up to 1,000 rows in no particular order. It now reads in the same order as the default sort (updated_at desc, action_no desc). Above the cap, the list keeps the most recently updated actions, and the same ones on every read. There is no pagination. No index is needed: the read is already filtered by (brand_id, status), so Postgres only sorts one brand's rows.
  • The sort logic lives in a new plain module, web/src/lib/action-center/sort.ts. ActionSort moves there from registry.ts.

Action numbers

  • Each row shows its number (for example "AC-251") as small muted text under the title, next to the category badge. Long titles still truncate, and the number stays whole.
  • Search finds an action from "AC-251", "ac-251", "AC 251", "test(server): unit tests for parseResponse (mention/citation/visibility scoring) #251" or "251". It matches the number exactly, so "251" doesn't also return AC-2510. Any other search text is matched against titles as before.
  • One helper builds the number and one matches it: actionCode() and matchesActionCode() in web/src/lib/action-center/action-ref.ts. The list rows, the search, the list CSV, the drawer header and the drawer's exports all use them.
  • CSV change: the list's Export CSV already had a number column. It now holds the same "AC-251" code the list shows, where it used to hold the bare number.
  • The drawer header already showed the number. It now gets it from the same helper.

Tab and menu counts

  • The Action Center tab row no longer shows a count next to Actions or Signals. Agents still shows how many of the person's agents are waiting on them.
  • The sidebar and the mobile menu no longer show a number next to Action Center. A new action still lights the yellow "Needs you" dot (the owner confirmed yellow).
  • Code used only by those counts is removed:
    • the menu read's open-action count: MenuStateAsk.count, MenuState.openActions, openActionCount, OpenActionsCount, ACTION_CENTER_ITEM and the menuDots.openActions string;
    • the tab's new-signal read, getNewSignalCount.
  • getMyOpenActionCount stays because Today uses it. The signals_new_count database function now has no caller, but it stays (no migration).
  • Unchanged: the lists' default filters, the KPI cards and the counts on the filter chips.
  • The only change to menu-state.ts, a 'use server' file, is removing internal code. Its exports are still async functions and types only.

Strings, Help and docs

  • Strings are in en.json:
    • added: the sort labels and table.sortTo (the header's tooltip);
    • removed: sort.newest and menuDots.openActions.
  • Help, "Work with Action Center actions":
    • a new section, Sort the list;
    • the list's sentence now says each row shows its number and that search finds it;
    • Export CSV now lists the number.
  • Help, "Dots in the menu": no longer describes the Action Center number, and says the tabs and the menu show no count.
  • Every edited section is 150 words or fewer, and approved-articles.json is regenerated.
  • The docs guide's Actions paragraph is updated to match.

How to test

  1. Open Action Center → Actions with no ?sort=. The dropdown reads Sort: Recently updated, and the Updated column runs from the most recent down. The dropdown offers Recently updated, Priority and Due date, and no Newest.
  2. Open …/actions?sort=newest. The list is sorted the same way as in step 1, and sort drops out of the URL.
  3. Click the Updated header. The list turns to oldest first, the arrow points up, the URL gets ?sort=updated_asc, and the trigger reads Least recently updated. Click it again to go back to most recent first.
  4. Click Priority Score. The list shows the highest score first (?sort=priority). Click again for lowest first (?sort=priority_asc). Unscored actions stay last. Refresh: the sort is kept.
  5. Each row shows "AC-…" under its title. Search for "AC-251", "ac-251" or "251", using a number from your list: only that action is listed. In Export CSV, each row starts with its "AC-…" number. The drawer header shows the same number.
  6. The Action Center tab row shows Actions and Signals without numbers, and Agents still shows its number when agents are waiting. The sidebar's and the mobile menu's Action Center show no number, and their dots still show.

Checks

  • Web typecheck (tsc --noEmit): clean.
  • ESLint and Prettier on the changed files: clean.
  • Vitest, 83 files and 1,023 tests passed:
    • the Action Center pages;
    • src/components/action-center and src/components/layout;
    • src/lib/action-center;
    • src/lib/actions/action-signals, action-center*, menu-state and today*;
    • src/lib/menu-dots;
    • use-server-exports;
    • the subscription guard coverage;
    • Help, regenerated with -u.
  • New and updated tests cover:
    • the default sort being most recently updated first;
    • ?sort=newest mapping to that sort;
    • header clicks changing the direction and the URL;
    • aria-sort and the arrows;
    • stable ties, including mixed timestamp formats;
    • the order of the server read;
    • the number shown on each row;
    • search by "AC-251", "ac-251" and "251";
    • the CSV's number column;
    • no count next to Actions, Signals or the menu's Action Center, with the Agents count kept;
    • the menu read no longer asking for or returning a count.
  • No migrations, lockfile changes or new dependencies. The server package is not touched.

Generated by Claude Code

…a clickable Updated column

The Actions list's Newest sort ordered rows by creation date, which the list
shows nowhere, so beside the Updated column ("5d, 5d, 6d, 16d, 8d ago") its
order read as wrong, and people couldn't tell it from Recently updated.

- One date sort, by the shown date: Recently updated (most recent first) is
  now the default; Newest is gone from the dropdown and ?sort=newest in old
  links lands on the same date sort. Priority and Due date stay.
- The Updated and Priority Score headers sort on a click: most recent (or
  highest) first, then the other way round (?sort=updated_asc /
  ?sort=priority_asc), with an arrow and aria-sort; the dropdown names the
  current sort.
- Ties keep one order (the later action number first, then id), and
  getActions reads in the same order, so the 1,000-row cap keeps the most
  recently updated, the same ones on every read.
- Each row shows the action's code ("AC-251", as Chat names it) on the line
  under its title, and the search finds it by "AC-251", "ac-251" or "251".
  The code is built by one helper (actionCode) and matched by one
  (matchesActionCode) for the list, its search and CSV, and the drawer and
  its exports; the list CSV's number column now holds the code.
- Help (Action Center actions) and the docs guide say how the list sorts and
  that the number is shown and searchable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
…he menu's Action Center

The owner found the counts disagreeing with the lists: "Signals 207" over a
list whose All chip said 445, "Actions 53" over 55, and the menu's
Action Center "53". Each counted a different set from its list (untriaged
signals of all time; open actions unassigned or the person's), so the number
read as wrong. The owner asked to remove the numbers rather than align them:
the menu's dots already say when something is new or waiting, and each list
shows its own count.

- The Action Center tab row shows no count beside Actions or Signals. Agents
  keeps its count of agents waiting on the person.
- The menu (sidebar and mobile) shows no number beside Action Center.
- What only those counts used is gone: the menu read's open-action count
  (MenuStateAsk.count, MenuState.openActions, openActionCount,
  OpenActionsCount, ACTION_CENTER_ITEM, the menuDots.openActions string)
  and the tab's new-signal read (getNewSignalCount). getMyOpenActionCount
  stays for Today. The lists, their default filters, the KPI cards and the
  chips' counts are unchanged.
- Help (Dots in the menu) no longer describes the number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
@mintlify

mintlify Bot commented Nov 14, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 8dda930.

Approve preview

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

LGTM.

@gkhngyk
gkhngyk merged commit 53374cd into ansvisor:main Nov 15, 2026
14 checks passed
cihan-gyk pushed a commit to cihan-gyk/ansvisor that referenced this pull request Nov 16, 2026
Conflicts:
- help/chat/chat.md: main's keywords (Settings in the chat menu) plus this
  branch's (most important actions, top actions, action title); main's new
  text and this branch's "Ask about your actions" section both kept.
- action-ref.test.ts: both sets of tests (actionRef from this branch;
  actionCode, searchedActionNo and matchesActionCode from main's ansvisor#2418).
  actionCode now builds its code with actionRef, so one formatter remains.
- web/src/lib/chat/skills/library.json: regenerated from skills/*/SKILL.md
  (yarn vitest run -u src/lib/chat/skills).
- approved-articles.json: regenerated (yarn vitest run -u src/lib/help).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
cihan-gyk pushed a commit to cihan-gyk/ansvisor that referenced this pull request Nov 16, 2026
…umbers

Brings the updated ansvisor#2420, which carries upstream main.

Conflicts:
- action-ref.ts and action-ref.test.ts: this branch's versions (actionCode
  from the brand's number via actionCodeNo, with every test from both
  branches and ansvisor#2418).
- server/src/lib/action-center/from-chat.js: main's Ads source (`source`
  param, verifiedPlace without a conversation for Ads) and this branch's
  `brandNo` in the answer and actionCode in the duplicate message.
- from-chat.test.js: main's Ads test now expects the answer's brandNo
  for the same key again (this branch's answer shape).
- server/src/lib/demo/coverage.js: both SKIPPED entries,
  brand_number_counters (00534) and mentions_terms_packed_ready (00540).
- supabase/schema.sql: regenerated (bash supabase/build-schema.sh); 00534
  sits before 00535-00540 by file order.
- library.json and approved-articles.json: regenerated, unchanged from
  the automatic merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SvzkMf5TZg7yqwaSeMFba9
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.

3 participants