fix(channels-settings): localize log and edit dialog close labels - #19519
Conversation
The shared DialogContent close control used a hard-coded English
sr-only label, so Chinese channel log and edit dialogs announced
"Close". Pass t('common.close') through a closeLabel prop.
Fixes #19518
Signed-off-by: Siin Xu <31815270+SiinXu@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_af391218-20b9-4caf-bd4f-0bdce25e7ae1) |
|
Reviewed the changes. This is a focused, backward-compatible accessibility fix:
No correctness, data, security, contract, or migration concerns were identified in this PR. |
ChannelDetail was asserting translation keys against a local DialogContent stand-in. The packages/ui dialog tests already prove default and custom accessible names on the real primitive. Signed-off-by: Siin Xu <31815270+SiinXu@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_cefe56f5-dda0-46ed-9976-063c1b0dd792) |
|
Review complete. No correctness, data, security, contract, or migration findings. The |
What this PR does
Before this PR:
Channel log and edit dialogs in Settings → Channels used the shared
DialogContentclose control with a hard-coded Englishsr-onlylabel (Close). In a Chinese UI, screen readers and accessibility inspectors announcedClosewhile the rest of the dialog was already localized.After this PR:
DialogContentacceptscloseLabel. The channel log and edit dialogs passt('common.close'), so a Chinese UI names the close control关闭and an English UI keepsClose.Fixes #19518
Why we need it and why it was done in this way
Localized interfaces should not expose an English-only accessible name on a dialog close control. The primitive stays language-agnostic with an English default for stories and unlocalized callers; product dialogs pass the existing
common.closekey.The following tradeoffs were made:
QR login dialogs in
ChannelFormsstill use the primitive default. This PR only covers the reported log and edit dialogs.The following alternatives were considered:
Hard-coding Chinese in the primitive was rejected because the UI package does not own i18n. Adding a visible footer Close button was rejected because the existing control is the top-right close button with an
sr-onlyname.Links to places where the discussion took place: None.
Breaking changes
None.
Special notes for your reviewer
DEV record recvqyjY6Q1syp. Head
5a442b38983049159d88cdb8ca81732316ac9650.Accessible-name contract is owned by the real
packages/uiDialog primitive tests (names the close control Close by default,uses a caller-provided closeLabel as the close control name). Those cases fail if the default sr-only name changes or ifcloseLabelis ignored.The ChannelDetail renderer case that queried
common.closeagainst a local@cherrystudio/uistand-in was removed: it never opened the dialogs, asserted translation keys, and would still pass if productionDialogContentignoredcloseLabel. The ChannelDetail mock no longer recreates a close-button accessible name. Remaining ChannelDetail tests cover create/edit/close behavior, not a11y naming.Focused tests:
packages/ui/src/components/primitives/__tests__/dialog.test.tsx,src/renderer/pages/settings/ChannelsSettings/__tests__/ChannelDetail.test.tsx.pnpm lintandpnpm test:lintpassed locally after the test repair.Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
main/gh-pr-review,gh pr diff, or GitHub UI) before requesting review from othersRelease note