Skip to content

fix(action-center): say "1 prompt" and "1 day" in action history - #1092

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/history-affected-plural
Oct 16, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:fix/history-affected-plural

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Action Center History says "1 prompt", "1 page", "1 signal" and "1 day" instead of "1 prompts", "1 pages", "1 signals" and "1 days".

These History messages put the count in front of a fixed plural noun, so a count of one read wrong:

  • Affected (actionCenter.historyPage.affected.*): the table's Affected column and the drawer's Affected badges. The prompt, url, citation, keyword, topic and platform messages are ICU plurals now, in the style the file already uses ({count, plural, one {# page} other {# pages}}). competitor has no count and is unchanged.
  • Time to Close (actionCenter.historyPage.drawer.days): the drawer's card. Now {n, plural, one {# day} other {# days}}; the call site passes n, so the variable stays n.

These keys are used only in history-table.tsx and history-drawer.tsx, and en.json is the only locale. No component code changes.

Tests

New web/src/components/action-center/history-table.test.tsx renders HistoryTable and HistoryDrawer inside NextIntlClientProvider with the real en.json. It checks:

  • the Affected column for every counted type at 1 and 3;
  • the drawer's Affected badge at 1 and 3;
  • Time to Close at 1 and 4 days.

Against the old messages, all 8 cases with a count of one fail (e.g. expected '1 signals' to be '1 signal'); the plural cases pass. With this change all 16 pass.

Related issue

None. Found next to #1091, which fixes the drawer's "Consolidated from 1 signals" line. The two PRs change different lines of en.json and merge cleanly together. The drawer tests are in this new file so they don't collide with #1091's new history-drawer.test.tsx; they can move there once both are in.

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. Have an action in History with a count of one, e.g. a Completed action whose payload is {"promptCount":1,"pageCount":1,"citationCount":1}, closed a day after it was created.
  2. Open Action Center → History. The Affected column reads "1 prompt" and "1 page".
  3. Open the action. Time to Close reads "1 day"; Affected reads "1 prompt", "1 page", "1 signal".
  4. Or run yarn test src/components/action-center/history-table.test.tsx from web/.

Checklist

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

Also checked:

  • Tests and build. yarn test: 75 files and 734 tests pass. yarn build passes with CI's Stripe placeholder key.
  • The browser. I added a temporary Completed action like the one in step 1 to my dev database and opened History at 1024px in light and dark themes. The table and drawer showed the singular forms. Then I deleted the action.

Known, left as is: npm run version:check fails on main too (docker-compose images 0.2.0 vs packages 0.3.0); version bumps are for maintainers.

🤖 Generated with Claude Code

History's Affected column and the drawer's Affected badges read
"1 prompts", "1 pages", "1 signals" and so on for a count of one, and
the drawer's Time to Close card read "1 days". Make those messages ICU
plurals and cover every counted type, plus the days, with render tests
against en.json.

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

Copy link
Copy Markdown
Collaborator Author

@gkhngyk a small follow-up to #1091 is ready for review: History's Affected column and badges and the drawer's Time to Close now say "1 prompt", "1 page", "1 signal" and "1 day" for a count of one. Only en.json messages change, with render tests against the real messages. It merges cleanly with #1091 in either order.

@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. tAffected and drawer.days get numbers at both call sites, and the 16 cases pass on the tree merged with #1091.

@gkhngyk
gkhngyk merged commit 5b8b874 into ansvisor:main Oct 16, 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