Skip to content

fix(task-board): pluralize the task-cost run count correctly - #6159

Merged
pedrofrxncx merged 1 commit into
mainfrom
fix/task-cost-run-count-plural-w4
Aug 18, 2026
Merged

fix(task-board): pluralize the task-cost run count correctly#6159
pedrofrxncx merged 1 commit into
mainfrom
fix/task-cost-run-count-plural-w4

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

#6154 (merged today) shipped the task-cost chip with a single hardcoded string for the run count and tooltip: "in {runs} runs" / "em {runs} execuções". A task with exactly one linked run — the common case, a card that's just its Super Agent run with no reviewer/re-run rounds — reads "in 1 runs", and the pt-br tooltip has the identical singular/plural mismatch ("1 execuções").

A maintainer wants this fixed because it's user-visible copy shipped hours ago that reads wrong for the majority of cards (single-run tasks are the default, not the exception).

Failure scenario: open any task-board card whose only linked run recorded a cost. The chip currently shows $X.XX in 1 runs. After the fix it shows $X.XX in 1 run.

Fix: split taskBoard.taskDialog.costRunCount / costTooltip into ...Singular / ...Plural key pairs (en + pt-br) and pick by runs === 1 in TaskCost — the same pattern already used by settings.apiKeys.keysCount(Singular|Plural) and settings.secrets.secretsCount(Singular|Plural) elsewhere in this codebase.

To confirm: open a task-board card whose only run has recorded cost — the chip reads "in 1 run", not "in 1 runs".

Checked locally: bun run fmt (clean), cd apps/web && bunx tsc --noEmit (clean — pt-br's satisfies Record<keyof typeof enDomain, string> catches any key mismatch at compile time), bunx oxlint on the three touched files (0 warnings/errors). No unit test exists for this component; the change is UI copy only. Full CI validates the rest.


Summary by cubic

Fixes the task-board cost chip to pluralize the run count and tooltip correctly. Previously it always showed “in {runs} runs” (e.g., “in 1 runs”); now it selects singular/plural for both the label and tooltip. No behavior change beyond copy.

  • Split i18n keys into taskBoard.taskDialog.costRunCountSingular/Plural and taskBoard.taskDialog.costTooltipSingular/Plural in en and pt-br; removed the old costRunCount/costTooltip keys.
  • TaskCost picks singular when runCount === 1; run counting and cost calculation logic are unchanged.
  • Verify by opening a task with a single run and recorded cost: chip reads “in 1 run” (pt-br: “em 1 execução”). No migrations required.

Written for commit 06abbcf. Summary will update on new commits.

Review in cubic

#6154 shipped a single hardcoded string for the cost chip's run count and
tooltip: "in {runs} runs" / "em {runs} execuções". A task with exactly one
linked run — the common case, a card with just its Super Agent run and no
reviewer/re-run rounds — reads "in 1 runs", and the pt-br tooltip has the same
singular/plural mismatch.

Split each key into a Singular/Plural pair and pick by count, following the
existing pattern in settings.apiKeys.keysCount(Singular|Plural) and
settings.secrets.secretsCount(Singular|Plural).

To confirm: open a task-board card whose only run has recorded cost — the
chip now reads "in 1 run" instead of "in 1 runs".

Checked: bun run fmt, cd apps/web && bunx tsc --noEmit (both clean), bunx
oxlint on the three touched files (0 warnings/errors). No unit test exists for
this component; the change is UI copy only, verified by typecheck (pt-br must
satisfy Record<keyof typeof enDomain, string>, so a missing/extra key is a
compile error) and manual reasoning about the count branches. CI runs the rest.
@pedrofrxncx
pedrofrxncx merged commit 867871f into main Aug 18, 2026
25 checks passed
@pedrofrxncx
pedrofrxncx deleted the fix/task-cost-run-count-plural-w4 branch August 18, 2026 14:09
pedrofrxncx added a commit that referenced this pull request Aug 18, 2026
…#6177)

The task-cost chip (#6154/#6159) summed only threads with a recorded costUsd but reported the count of ALL linked threads, including ones with no finish part yet (still running, or crashed before one). A task with 1 priced run and 1 still-running thread showed "$X in 2 runs", claiming the total covered a run it never touched.

Extracted the count/total logic into a pure summarizeTaskCost() helper and fixed it to count only priced threads, with a unit test covering the mismatch.
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.

1 participant