fix(task-board): pluralize the task-cost run count correctly - #6159
Merged
Conversation
#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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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/costTooltipinto...Singular/...Pluralkey pairs (en + pt-br) and pick byruns === 1inTaskCost— the same pattern already used bysettings.apiKeys.keysCount(Singular|Plural)andsettings.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'ssatisfies Record<keyof typeof enDomain, string>catches any key mismatch at compile time),bunx oxlinton 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.
taskBoard.taskDialog.costRunCountSingular/PluralandtaskBoard.taskDialog.costTooltipSingular/Pluralinenandpt-br; removed the oldcostRunCount/costTooltipkeys.TaskCostpicks singular whenrunCount === 1; run counting and cost calculation logic are unchanged.Written for commit 06abbcf. Summary will update on new commits.