Repository navigation
fix(ui): empty-string i18n params render the raw {placeholder} - #123474
Conversation
t() interpolation used || so a provided empty-string param fell through to
the visible {placeholder} fallback meant for missing params — e.g. the
devices page rendered 'Bound to {node}' whenever an agent binding was the
empty string. ?? keeps the missing-param debugging aid and renders provided
empties as empty.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 14, 2026, 8:53 AM ET / 12:53 UTC. ClawSweeper reviewWhat this changesThis PR changes Control UI translation interpolation so an explicitly supplied empty string renders blank while an omitted parameter still renders a visible placeholder. Merge readinessKeep open for maintainer review: current main still has the claimed interpolation behavior, but the PR’s stated Devices reproduction is impossible because blank bindings normalize to null before rendering, and no reachable empty-string UI consumer was established. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI i18n manager resolves locale strings and substitutes parameters for labels, descriptions, and accessibility text. Page and component renderers provide those parameters before the resulting text reaches the browser UI. flowchart LR
A[Control UI renderer] --> B[Translation key and parameters]
B --> C[i18n manager]
C --> D{Parameter value present}
D -->|missing| E[Visible placeholder]
D -->|empty string| F[Rendered text]
E --> G[Browser UI]
F --> G
Decision needed
Why: Current code and tests disprove the concrete Devices example, while the shared helper’s diagnostic fallback affects every translation consumer; source evidence cannot choose that product and observability policy. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +2, Tests +8. Total +10 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Either retain the visible-placeholder fallback, or establish one real Control UI path where blank text is intentional, cover that rendered path, and make the accepted operator semantic change net-neutral. Do we have a high-confidence way to reproduce the issue? No high-confidence user-visible reproduction is established: current source proves the helper maps an empty string to a placeholder, but the cited Devices path normalizes blank bindings to null before it can reach that branch. Is this the best way to solve the issue? No. The one-token change is at the correct owner if blank values are intentional, but a reachable consumer or explicit maintainer decision is needed before replacing the diagnostic fallback globally. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f39f48f7b962. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
|
Merged via squash.
|
…nclaw#123474) t() interpolation used || so a provided empty-string param fell through to the visible {placeholder} fallback meant for missing params — e.g. the devices page rendered 'Bound to {node}' whenever an agent binding was the empty string. ?? keeps the missing-param debugging aid and renders provided empties as empty.
What Problem This Solves
Any
t()call that passes an empty-string parameter renders the raw{placeholder}to the user instead of an empty value. Concretely: the Devices page binding row shows "Override: {node}" whenever an agent's binding is the empty string (devices/view.ts:129— onlynullmaps to the default branch, sobinding === ""reaches the interpolation with an empty param).Why This Change Was Made
translate.tsinterpolated withparams[k] ||{${k}}``: the||conflates "param provided but empty" with "param missing". The `{placeholder}` fallback exists as a debugging aid for genuinely missing params; an empty string is a provided value and must render empty. One-character root-cause fix (`||` → `??`) at the single interpolation owner, with an invariant comment.User Impact
Localized strings with legitimately empty parameters render cleanly instead of leaking template syntax. Missing params still show the visible
{placeholder}so catalog drift stays debuggable.Evidence
ui/src/i18n/test/translate.test.ts: provided-empty renders empty (fails pre-fix withCopy command: {command}), missing param keeps the placeholder. Suite 25 passed post-fix; fails pre-fix.Found via the i18n/formatting lane of the round-2 web-UI QA campaign.