# agent_ui: Fix project rule pluralization in context usage popover \(\#61184\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/df9321ec8167e593092e1f0bf3847b463e5c868c)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: df9321ec8167e593092e1f0bf3847b463e5c868c

Requested commit: df9321ec8167e593092e1f0bf3847b463e5c868c

Commit: df9321ec8167e593092e1f0bf3847b463e5c868c

Tree: 0d51abde812fa3c13965edb9c88338a64acb9cd6

Author: Ibrahim Khan

Committer: GitHub

## Message

```
agent_ui: Fix project rule pluralization in context usage popover (#61184)

The agent panel's context usage popover showed "1 project rules" when
exactly one project rule (e.g. `.rules`) was loaded, because the
project-rules button used an unconditional `format!("{} project rules",
...)`.

Reuse the existing `pluralize` helper (already used for diagnostics
labels in the same crate) so a single rule renders as "1 project rule"
and multiple rules render as "N project rules". The sibling "1 global
rule" label is intentionally left unchanged, since there is only ever
one global rule.

Closes #57759

Release Notes:

- Fixed the agent panel context usage popover showing "1 project rules"
instead of "1 project rule" when a single project rule is loaded.
```

## Parents

- [fd013f7f560dbf1d2738ecc071c796dec4117984](https://git.cafe/gitcafe/zed/commit/fd013f7f560dbf1d2738ecc071c796dec4117984?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/df9321ec8167e593092e1f0bf3847b463e5c868c?format=markdown)
