Repository navigation
fix(tui): use the singular for a count of one in the file activity receipt - #7050
Conversation
…ceipt The work surface's file activity receipt counts with a fixed plural, so a turn that reads one file and runs one search shows "Read 1 files · Searched 1 patterns", and a single edit shows "Wrote 1 files". Count through tool_run's `counted`, which the tool-run summary already uses for "Explored 1 file, 1 search", and update the three tests that pinned the plural. Signed-off-by: Lstarsky0 <59827030+Lstarsky0@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7bf88959a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "Read {}", | ||
| tool_run::counted(self.files_read as usize, "file", "files") |
There was a problem hiding this comment.
Route activity labels through localization
When ui_locale is any shipped non-English locale, this receipt still renders English because compact_display receives no locale and the newly added verb/noun forms are literals; aggregate_activity_row calls it directly. This makes the grammar fix English-only and bypasses the complete locale packs, so pass the active locale and select translated MessageId values (including the singular/plural forms) instead.
AGENTS.md reference: crates/tui/AGENTS.md:L25-L26
Useful? React with 👍 / 👎.
`tui::views::tests::config_panel_golden_at_eighty_and_one_twenty` failed on frozen `main` (877d013), before PR #7050 is considered: the golden still says `comfortable` where the panel renders `spacious`. `39621ffb5f` made spacious the default and left this golden behind, the same miss that left the two transcript tests wrong. `comfortable` is still an accepted setting value, but `TranscriptSpacing::from_setting` maps it to Spacious, so `spacious` is what the panel honestly reports. The value is padded to the old width so every later column stays put — the file diff is one row. Verification: the test fails 0-passed/1-failed before this change and passes after it, run from the same binary (goldens are read at runtime).
What and why
The work surface's file activity receipt counts with a fixed plural. With the work surface on a side rail, a turn that reads one file and runs one search shows, before:
After:
A single edit goes from
Wrote 1 filestoWrote 1 file, and one listed directory readsListed 1 directory.FileActivitySummary::compact_displaynow counts throughcountedinhistory/tool_run.rs, the helper the tool-run summary already uses forExplored 1 file, 1 search; it only becomespub(super)sohistory.rscan reach it. Counts above one read as before.Three tests pinned the plural (
Read 1 files,Searched 1 patterns,Wrote 1 files); they now check the singular, with the trailing·where the old text would still match as a prefix.Issue
No-Issue: the file activity receipt says "1 files" and "1 patterns"; I searched and found no issue for it
How I tested it
work_surface_placement = "left"and a 60-column rail, with this change and with a build ofmainfrom before it. The receipt above is from a turn that callsreadandfile_search; a turn that callseditonce goes fromWrote 1 filestoWrote 1 file. Apart from the ttft readout, nothing else on the screen changed.cargo check -p codewhale-tui --all-targetsandcargo +1.89.0 check -p codewhale-tui: clean.cargo fmt --all -- --checkand CI's clippy (stable and 1.99) only complain aboutmainitself at 1f8d4be: fmt wantscore/engine/tool_preparation.rs:665reformatted and clippy flagstools/review_core.rs:870. Neither file is touched here.cargo nextest run -p codewhale-tui --lib: 15354 passed, 8 failed, with the three updated tests among the passes. Seven of the eight fail the same way on 1f8d4be without this change (catalog, computer-use posture, PR-review markdown, two transcript, config golden, chat widget). The eighth,actual_cli_review_report_host_matches_legacy_and_core_keeps_inline_authority, passes on its own both here and onmain; in the full run it lost its review-report trailer.Checklist
maincargo fmt --allpasses, and tests cover new or changed behaviordocs/features.toml(cargo test -p codewhale-tui --test feature_registrychecks it) — n/a