Skip to content

components: ConfigPanelRenderer's undoLabel / redoLabel default to English — dormant today, and #4750 records the opposite #4752

Description

@yinlianghui

Found while implementing #4750 (routing the same file's saveLabel / discardLabel defaults through the locale pack). Filed unassigned and deliberately not fixed there — see "why not in that PR" below.

What was measured (on origin/main at ef0d1502f, and identically at 616a2a547)

packages/components/src/custom/config-panel-renderer.tsx gives two more of its parameters English literals as defaults:

undoLabel = 'Undo',
redoLabel = 'Redo',

Both are rendered as the title attribute of the header's undo / redo buttons (config-panel-undo, config-panel-redo) — a visible tooltip and the buttons' accessible name, since neither carries text.

This contradicts #4750's issue body, which states that closeTitle, ariaLabel, undoLabel and redoLabel "have no default at all, so they contribute no English". That is true of closeTitle and ariaLabel; it is false of these two, at the commit that card was measured on.

Why it is dormant rather than user-visible

The two buttons render only when the caller passes onUndo / onRedo:

grep -rn "onUndo=\|undoLabel=\|redoLabel=" packages/*/src apps/*/src | grep -v components/src   # zero hits

No caller wires either handler, so neither button — and therefore neither label — reaches a user today. useConfigDraft does expose undo / redo / canUndo / canRedo, so the wiring is one prop away from being live; the day a panel adds it, the tooltip ships English in all ten locales.

Why it was not folded into #4750's PR

Same defect class and same file, but the key choice is a fresh decision rather than a mechanical one, which is what the in-place exemption requires:

  • the packs carry no common.undo / common.redo (common.save did exist, which is why the footer fix could just reuse it);
  • the four spellings that do exist are each scoped to one surface — grid.bulk.undo, gantt.toolbar.undo, designer.undo / designer.redo, appDesigner.undo / appDesigner.redo;
  • so fixing it means either adding a shared common.undo / common.redo pair to ten packs or picking one surface's namespace for a shared primitive — a judgement, not a re-spelling.

Whoever picks this up should also decide whether closeTitle and ariaLabel (genuinely defaulted to nothing, so the close button and the panel have no accessible name unless a caller supplies one) belong in the same change; that is an a11y gap rather than an i18n one, and #4750 explicitly left all four alone.

Backlinks: #4750, #4748.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions