Skip to content

fix(CommentComposer): the agent command menu words its rows through the catalog - #14158

Draft
cixzhang wants to merge 2 commits into
lane2/comment-composer-onclickfrom
lane2/comment-composer-agent-menu-catalog
Draft

cixzhang wants to merge 2 commits into
lane2/comment-composer-onclickfrom
lane2/comment-composer-agent-menu-catalog

Conversation

@cixzhang

@cixzhang cixzhang commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-picked from #13739 by @ernestt, who wrote this fix; the commit credits @ernestt with a Co-authored-by line. This team pull request carries it onto current main. It is stacked on #14157, the #13738 replacement, because both add CommentComposer tests at the same place.

User impact

A viewer in any locale but English who types / in a comment composer sees the agent-command menu partly in English. Each row's usage line (/ask <prompt>) and summary (Release Assistant · Ask about the rollout) were built in code, so the placeholder word and the separator could not be translated or reordered.

Problem and solution fit

  1. Why is it English? The menu assembled both lines with string concatenation, outside the catalog.
  2. Why does it harm the task? The usage line tells the viewer what to type after the command. An untranslated placeholder hides that, and a fixed separator cannot follow a locale's punctuation.
  3. Why does it matter? architecture:internationalization requires that every word a component shows comes from the catalog. Core's strict lint enforces it, so the family could not graduate with this.

Two catalog messages now word the rows: @astryx.commentComposer.agentCommandUsage (/{command} '<prompt>', with the angle brackets quoted for the message format) and @astryx.commentComposer.agentCommandSummary ({name} · {description}). English output is unchanged.

Expected behavior and authority

  • architecture:internationalization: components take user-facing text from the catalog. A locale can reorder or re-punctuate an assembled string only when one message holds it.
  • Component audit rubric BLOCK I1 (graduation issue list): the agent-command menu builds text in code. It was confirmed in the source on main.

Smallest restoration

  • packages/core/locales/en.json gains the two messages, with translator descriptions. A Core changeset names the catalog change.
  • CommentComposer renders each row through a small component that calls the translator.

No API, visual, or other behavior change. English text is identical.

Evidence

  • Reproduction before the change: with a French override for both keys, typing / still shows /ask <prompt>.
  • Result after the change: the override applies: /ask <demande>.
  • Representative unchanged path: English shows /ask <prompt> and Release Assistant · Ask about the rollout, as before.
  • Regression test: CommentComposer.test.tsx "words the agent command menu through the catalog". It fails without the fix.
  • check:i18n-catalog and generate-i18n-runtime --check pass with the new keys.

The rows look the same in English, so there are no screenshots.

Scope

Components: CommentComposer

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

Overlap checked: #14157, #13740, #13739, #13738, #13736, #13737, #13735 (separate: #13739 is the original by @ernestt, which this team pull request replaces on current main; it is stacked on #14157, the #13738 replacement, because both add CommentComposer tests at the same place; #13740, #13736, #13737 and #13735 are ernestt's other Comments pull requests)

…he catalog

The `/` menu built each agent's usage line, `/ask <prompt>`, and its
summary, `name · description`, in code, so the placeholder word and the
separator stayed English in every locale. Two catalog messages,
`@astryx.commentComposer.agentCommandUsage` and
`@astryx.commentComposer.agentCommandSummary`, now word them. English output
is unchanged.

Cherry-picked from #13739 (by @ernestt).

Co-authored-by: Ernest Tien <ernesttien@meta.com>
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Dec 1, 2026 8:04pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 1, 2026
@astracat-bot

astracat-bot Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Dec 1, 2026, 8:06 PM UTC

@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec cf6dbc3

@astracat-bot astracat-bot 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.

Approved pending CI: CI has not run on this head yet and runs once this pull request targets main and leaves draft.

Both agent-row lines now come from catalog messages, as the internationalization contract requires, and English output is unchanged from reading the code. The new French-override test covers the translated path; your test plan reports it passing, and CI runs it before merge.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Title: the agent command menu words its rows through the catalog — verified in the component's two translator calls.
  • Before the change, the usage line and summary were built in code — verified in the base component.
  • A non-English viewer sees the menu partly in English — verified for the shipped Vietnamese catalog, which translates the rest of the composer.
  • The internationalization contract requires catalog text, and Core's strict lint enforces it — verified in the contract and the lint configuration.
  • Two catalog messages word the rows, with the angle brackets quoted — verified in the English catalog.
  • English output is unchanged — verified by tracing the message format for every string input.
  • No API, visual or other behavior change — verified; the two new catalog keys are disclosed in the description.
  • A locale can translate the placeholder word and the separator — verified by tracing the resolver's override and catalog lookup.
  • A French override now applies — verified by trace; the new test covers it and has not run on this head.
  • Before the change, a French override had no effect, and the new test fails without the fix — reported.
  • Lab Comments tests, pre-review checks, formatting and lint pass — reported.
  • The catalog and runtime checks pass with the new keys — reported; CI runs them.
  • The changeset is valid — verified, run locally.
  • Cherry-picked with credit to the original author, and stacked on #14157 — verified in the commit and the base branch.
  • Files: .changeset/comment-composer-agent-menu-catalog.md clear; packages/core/locales/en.json clear; packages/lab/src/Comments/CommentComposer.test.tsx clear; packages/lab/src/Comments/CommentComposer.tsx clear.

Automated review (maintainer link)

@cixzhang

cixzhang commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 1826db7

@astracat-bot astracat-bot 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.

Approved pending CI: CI has not run on this head yet and runs once this pull request targets main and leaves draft.

Both agent-row lines now come from catalog messages, as the internationalization contract requires, and English output is unchanged from reading the code. The new French-override test covers the translated path; your test plan reports it passing, and CI runs it before merge.

Claims and files checked

Review mode: incremental; reason: none

  • Changed review rules since the last review: none.
  • Title: the agent command menu words its rows through the catalog — verified in the component's two translator calls.
  • Before the change, the usage line and summary were built in code — verified in the base component and on main.
  • A non-English viewer sees the menu partly in English — reported; consistent with the shipped Vietnamese catalog, which translates the rest of the composer.
  • The internationalization contract requires catalog text, and Core's strict lint enforces it — verified in the contract and the lint configuration.
  • The component audit lists text built in code — reported; the audit is not in the repository, and its finding is verified on main.
  • Two catalog messages word the rows, with the angle brackets quoted — verified in the English catalog.
  • English output is unchanged — verified by tracing the message format for every string input.
  • The catalog gains two described messages and a Core changeset names the change — verified.
  • Each row renders through a small component that calls the translator — verified.
  • No API, visual or other behavior change — verified in the changed files and their importers; the two new catalog keys are disclosed.
  • A locale can translate the placeholder word and the separator — verified by tracing the resolver's override and catalog lookup.
  • A French override now applies — verified by trace; the new test covers it and has not run on this head.
  • Before the change, a French override had no effect, and the new test fails without the fix — reported.
  • On the original pull request, the Comments tests, catalog checks and changeset check passed — reported.
  • At this head, install, build, typecheck, formatting, lint, the catalog and runtime checks and the 19 CommentComposer tests pass — reported; the changeset check also passes, run locally, and CI runs the rest.
  • The catalog check counts two more keys and messages than main — reported; consistent with the English catalog.
  • Cherry-picked with credit to the original author, and stacked on #14157 — verified in the commit, the changeset and the base branch.
  • Files: .changeset/comment-composer-agent-menu-catalog.md clear; packages/core/locales/en.json clear; packages/lab/src/Comments/CommentComposer.test.tsx clear; packages/lab/src/Comments/CommentComposer.tsx clear.

Automated review (maintainer link)

This branch was successfully deployed

1 active deployment
Preview — 1826db7f Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant