Skip to content

fix(ui): empty-string i18n params render the raw {placeholder} - #123474

Merged
steipete merged 8 commits into
mainfrom
codex/autoqa-i18n-empty-param
Aug 14, 2026
Merged

steipete merged 8 commits into
mainfrom
codex/autoqa-i18n-empty-param

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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 — only null maps to the default branch, so binding === "" reaches the interpolation with an empty param).

Why This Change Was Made

translate.ts interpolated with params[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

  • Regressions in ui/src/i18n/test/translate.test.ts: provided-empty renders empty (fails pre-fix with Copy command: {command}), missing param keeps the placeholder. Suite 25 passed post-fix; fails pre-fix.
  • Fresh autoreview (codex/gpt-5.6-sol, high): clean, "patch is correct (0.99)".
  • Production LOC: +3/−1 (comment is 2 of the 3).

Found via the i18n/formatting lane of the round-2 web-UI QA campaign.

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.
@clawsweeper

clawsweeper Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete
steipete marked this pull request as ready for review August 14, 2026 04:56
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 14, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@clawsweeper

clawsweeper Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 14, 2026, 8:53 AM ET / 12:53 UTC.

ClawSweeper review

What this changes

This PR changes Control UI translation interpolation so an explicitly supplied empty string renders blank while an omitted parameter still renders a visible placeholder.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep 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
Reviewed head: 8e6934753474d9e6a36a318167a8176936b9b43f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is small and mechanically coherent, but its claimed user-visible failure path has not been established.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate, although a real rendered consumer remains necessary to justify the semantic change.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate, although a real rendered consumer remains necessary to justify the semantic change.
Evidence reviewed 5 items Current interpolation behavior: Current main uses logical-OR fallback, so a supplied empty string becomes the visible placeholder at the sole interpolation owner.
Claimed Devices path is unreachable: The Devices renderer can syntactically pass an empty fallback at the interpolation call, but binding resolution converts empty or whitespace-only node values to null; the sibling UI test also expects an empty select choice to emit null.
Known command-rendering callers avoid blanks: The shared command component forwards its command into the interpolator, while the machine dialog only renders it after a non-empty trimmed join URL produces a command and the chat dialog only renders a truthy generated command.
Findings 1 actionable finding [P2] Prove a reachable empty-parameter consumer
Security None None.

How this fits together

The 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
Loading

Decision needed

Question Recommendation
Should a supplied empty string globally mean intentional blank output in Control UI translations, or should visible placeholders remain until a caller has an explicit blank-value contract? Require a real consumer: Retain the fallback until the PR demonstrates a reachable rendered UI path whose intended output is blank.

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

  • Prove a reachable empty-parameter consumer (P2) - The stated Devices case cannot reach this branch: blank bindings normalize to null, and its UI test expects that normalization. The inspected command-rendering callers also gate on nonempty commands, so this global change can hide unexpected data rather than repair an observed UI path. This blocker was already raised and the relevant files are unchanged since the prior reviewed head.
  • Resolve merge risk (P2) - Changing the shared fallback without a proven consumer can hide an unexpected blank parameter where current UI intentionally exposes a visible placeholder for diagnosis.
  • Resolve merge risk (P1) - Production code is net +2 solely from the explanatory comment; that growth is avoidable if the semantic change is accepted.
  • Complete next step (P2) - A maintainer must choose the shared empty-string versus diagnostic-placeholder contract before a safe repair can be specified.

Findings

  • [P2] Prove a reachable empty-parameter consumer — ui/src/i18n/lib/translate.ts:269
Agent review details

Security

None.

PR surface

Source +2, Tests +8. Total +10 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 3 1 +2
Tests 1 8 0 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 11 1 +10

Review metrics

Metric Value Why it matters
Production versus test LOC production +2 net; tests +8 net The functional operator change is one replacement; the two-line production increase is an avoidable comment pending confirmation of the semantic contract.

Merge-risk options

Maintainer options:

  1. Prove and scope the behavior (recommended)
    Add a reachable Control UI rendering case where an empty parameter is intentional, then retain only the net-neutral owner-level semantic change.
  2. Accept blank-as-provided globally
    A maintainer may explicitly choose to let blank data suppress the existing placeholder diagnostic across all translation consumers.

Technical review

Best 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:

  • [P2] Prove a reachable empty-parameter consumer — ui/src/i18n/lib/translate.ts:269
    The stated Devices case cannot reach this branch: blank bindings normalize to null, and its UI test expects that normalization. The inspected command-rendering callers also gate on nonempty commands, so this global change can hide unexpected data rather than repair an observed UI path. This blocker was already raised and the relevant files are unchanged since the prior reviewed head.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f39f48f7b962.

Labels

Label justifications:

  • P2: This is a bounded Control UI formatting-policy change with no proven current user-visible failure path.
  • merge-risk: 🚨 compatibility: Changing the shared placeholder fallback changes how existing blank parameters are displayed across Control UI translation consumers.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored PR is not subject to the external-contributor proof gate, although a real rendered consumer remains necessary to justify the semantic change.

Evidence

What I checked:

  • Current interpolation behavior: Current main uses logical-OR fallback, so a supplied empty string becomes the visible placeholder at the sole interpolation owner. (ui/src/i18n/lib/translate.ts:267, f39f48f7b962)
  • Claimed Devices path is unreachable: The Devices renderer can syntactically pass an empty fallback at the interpolation call, but binding resolution converts empty or whitespace-only node values to null; the sibling UI test also expects an empty select choice to emit null. (ui/src/pages/devices/view.ts:129, f39f48f7b962)
  • Known command-rendering callers avoid blanks: The shared command component forwards its command into the interpolator, while the machine dialog only renders it after a non-empty trimmed join URL produces a command and the chat dialog only renders a truthy generated command. (ui/src/components/connect-command.ts:19, f39f48f7b962)
  • Prior blocker remains unchanged: The interpolation and translation-test files have no diff between the last reviewed head and the current head, so the earlier request for a reachable consumer has not been addressed. (ui/src/i18n/lib/translate.ts:267, 8e6934753474)
  • Current-behavior provenance: Blame attributes the current fallback line to the recent Control UI change commit; available local history identifies it as the commit carrying this behavior forward. (ui/src/i18n/lib/translate.ts:267, 0bd50cc0a5ba)

Likely related people:

  • Jason (Json): Git blame identifies this author on the current interpolation fallback line carried by the recent Control UI commit. (role: current behavior line author; confidence: medium; commits: 0bd50cc0a5ba; files: ui/src/i18n/lib/translate.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Demonstrate a reachable rendered Control UI consumer whose empty value is intentional.
  • Decide whether the shared diagnostic placeholder should yield to that consumer, then keep the production change net-neutral.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-08-14T05:29:51.405Z sha cf49a94 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T07:29:24.911Z sha 94ee3ae :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T09:28:42.776Z sha 1528ee0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T11:40:13.195Z sha 3131ec1 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T11:49:56.205Z sha 45dcd97 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T12:29:16.132Z sha 06b291e :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T12:44:34.078Z sha a65cd5b :: found issues before merge. :: [P2] Prove a reachable empty-parameter consumer

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. labels Aug 14, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 14, 2026
@steipete
steipete merged commit 45d5b5e into main Aug 14, 2026
147 checks passed
@steipete
steipete deleted the codex/autoqa-i18n-empty-param branch August 14, 2026 13:26
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 15, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant