Skip to content

fix(tui): use the singular for a count of one in the file activity receipt - #7050

Merged
Hmbown merged 8 commits into
codewhale-hq:mainfrom
Lstarsky0:ux/file-activity-plurals
Oct 22, 2026
Merged

Hmbown merged 8 commits into
codewhale-hq:mainfrom
Lstarsky0:ux/file-activity-plurals

Conversation

@Lstarsky0

Copy link
Copy Markdown
Contributor

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:

 ✓ Read 1 files · Searched 1 patterns            README.md

After:

 ✓ Read 1 file · Searched 1 pattern              README.md

A single edit goes from Wrote 1 files to Wrote 1 file, and one listed directory reads Listed 1 directory. FileActivitySummary::compact_display now counts through counted in history/tool_run.rs, the helper the tool-run summary already uses for Explored 1 file, 1 search; it only becomes pub(super) so history.rs can 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

  • Ran a debug build in a pseudo-terminal with an empty HOME against a local OpenAI-compatible mock, with work_surface_placement = "left" and a 60-column rail, with this change and with a build of main from before it. The receipt above is from a turn that calls read and file_search; a turn that calls edit once goes from Wrote 1 files to Wrote 1 file. Apart from the ttft readout, nothing else on the screen changed.
  • cargo check -p codewhale-tui --all-targets and cargo +1.89.0 check -p codewhale-tui: clean. cargo fmt --all -- --check and CI's clippy (stable and 1.99) only complain about main itself at 1f8d4be: fmt wants core/engine/tool_preparation.rs:665 reformatted and clippy flags tools/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 on main; in the full run it lost its review-report trailer.

Checklist

  • One focused change, on 1f8d4be; it merges cleanly into current main
  • cargo fmt --all passes, and tests cover new or changed behavior
  • If this adds or changes a user-facing feature, I updated its docs and its row in docs/features.toml (cargo test -p codewhale-tui --test feature_registry checks it) — n/a

…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>
@Lstarsky0
Lstarsky0 requested a review from Hmbown as a code owner October 22, 2026 15:52

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 22, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T15:55:38.672530Z e7bf889 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +3559 to +3560
"Read {}",
tool_run::counted(self.files_read as usize, "file", "files")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Hmbown pushed a commit that referenced this pull request Oct 22, 2026
`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).
@Hmbown
Hmbown enabled auto-merge (squash) October 22, 2026 20:25
@Hmbown
Hmbown merged commit bee52fe into codewhale-hq:main Oct 22, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants