Skip to content

fix(webui): translate the chat header buttons and sidebar handle - #7958

Merged
kovtcharov-amd merged 5 commits into
amd:mainfrom
tylerbea:fix/hunt-S2-arabic-chat-header-buttons
Nov 13, 2026
Merged

kovtcharov-amd merged 5 commits into
amd:mainfrom
tylerbea:fix/hunt-S2-arabic-chat-header-buttons

Conversation

@tylerbea

@tylerbea tylerbea commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

In Arabic, the chat's private chat, browse files and export buttons and the sidebar's resize handle kept English names and hover text, so screen readers read English and the hover text was English. They now read in Arabic with the usual English gloss, like the neighbouring resource and session-panel buttons.

Closes #7959

Before After

Test plan

  • npm test on the ChatView, Sidebar, PrivateChip, SettingsDialogFocus and i18n files passes, including a new Arabic test for the header buttons and resize handle
  • npm run build passes
  • Arabic, open chat: names and hover text read from the page are Arabic (shots; the yellow box is an overlay listing them, since hover text can't be photographed headless, and the before list was read from the page before the fix)
  • Reviewer: hover the three header icons in Arabic and in English; English text is unchanged
🔍 Technical details
  • PrivateChatButton.tsx, ChatView.tsx (browse, export, loading skeleton) and SidebarResizer.tsx had English literals outside useT.
  • The private button reuses the existing composer.privateOn* strings; new keys are chat.privateOffTitle, chat.browseFiles, chat.exportTitle, chat.exportLabel, chat.loadingMessages, sidebar.resize, sidebar.resizeTitle, with Arabic in ar.ts. English wording is unchanged.
  • hardcodedText.baseline.json lowered for the three files.

In Arabic the private chat, browse files and export buttons, the loading label and the sidebar resize handle kept English names and hover text. They now read in Arabic with the usual English gloss.
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This PR fixes three chat-header buttons and the sidebar resize handle, which stayed in English in the Arabic UI. They now read in Arabic, and the English text doesn't change. The fix is correct and well tested, but it breaks an existing Electron test, and the Test Electron Framework check on this PR is failing.

  • Update the Electron source test. It still looks for the old literal English labels on the export and browse buttons in the chat view's source. Switch those two checks to the translated form that the same test already uses for the composer buttons.

Real-world evidence

N/A: no evidence bundle was produced for this run. The PR body has before/after Arabic screenshots taken by the author. This verdict rests on static review plus the CI result above. Hovering the icons in the packaged app, as the author's last test-plan item asks, was not done here.

🔍 Technical details

🟡 Electron test still asserts the removed literals (tests/electron/test_electron_chat_app.js:1184-1185)
expect(chatContent).toContain('aria-label="Export chat"') and ...'aria-label="Browse files on this PC"' no longer match ChatView.tsx, which now uses aria-label={t('chat.exportLabel')} / {t('chat.browseFiles')}. The Test Electron Framework job (run 43358140543) is failing on this PR. I couldn't pull its log here, but this is the only reference to the removed strings in that suite. Use the existing expectTranslated helper:

      expectTranslated(chatContent, "aria-label={t('chat.exportLabel')}", 'chat.exportLabel', 'Export chat');
      expectTranslated(chatContent, "aria-label={t('chat.browseFiles')}", 'chat.browseFiles', 'Browse files on this PC');

🟢 Near-duplicate key. chat.privateOffTitle ("isn't saved") sits next to the existing composer.privateOffTitle ("won't be saved"). Keeping it preserves the English wording exactly, which is defensible. Folding the two together later would leave one string to translate instead of two.

Checked: the reused composer.privateOn / privateOnTitle / privateOff keys exist in both locales with the old English text, so the English labels in App.newTask and ChatView.actionErrors/exportError tests still match. useT inside the useSidebarWidth hook is a valid hook call. The baseline counts drop by exactly the number of literals removed.

Strengths

  • Reuses the existing composer strings instead of adding duplicates for the private toggle's label.
  • The new Arabic test checks both the accessible name (with its English gloss) and the hover text, which is the gap that let these strings through.
  • The hard-coded-text baseline was tightened, so these strings can't come back without a test failing.

@kovtcharov-amd kovtcharov-amd added bug Something isn't working agent-ui Agent UI changes labels Nov 13, 2026
@kovtcharov-amd kovtcharov-amd added the multilingual Language support: translations, right-to-left layout, Arabic and other non-English languages label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

🟡 The Electron test from the last review is still not fixed, and Test Electron Framework still fails on this push. The test checks the chat view's source for the old English labels on the export and browse buttons, but those buttons now take their labels from translations. Change those two checks to the translated form, the way the same test already handles the composer buttons.

🔍 Technical details

tests/electron/test_electron_chat_app.js:1184-1185 still asserts aria-label="Export chat" and aria-label="Browse files on this PC". ChatView.tsx:1681,1684 now uses aria-label={t('chat.browseFiles')} / aria-label={t('chat.exportLabel')}. This PR doesn't touch the test file.

      expectTranslated(chatContent, "aria-label={t('chat.exportLabel')}", 'chat.exportLabel', 'Export chat');
      expectTranslated(chatContent, "aria-label={t('chat.browseFiles')}", 'chat.browseFiles', 'Browse files on this PC');

@tylerbea
tylerbea marked this pull request as draft November 13, 2026 05:24
@tylerbea
tylerbea marked this pull request as ready for review November 13, 2026 05:24
@github-actions github-actions Bot added the tests Test changes label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve

In Arabic, the chat header's private, browse-files and export buttons, the loading placeholder, and the sidebar's resize handle now have Arabic names and hover text. English wording doesn't change. The change is small, follows the same useT pattern as the neighbouring buttons, and adds an Arabic test. I found nothing blocking.

Real-world evidence

N/A here: no evidence bundle was produced for this run. The PR description has before/after screenshots of the Arabic chat header, with an overlay listing the names and hover text read from the page. A real hover check in both languages is still an open item for the reviewer in the PR's test plan. Apart from those screenshots, this verdict rests on static review.

🔍 Technical details

Checked

  • English is unchanged. Every new en.ts value matches the literal it replaces. The private button reuses composer.privateOn, composer.privateOnTitle and composer.privateOff, whose English matches the old strings exactly, so ChatView.privateButton.test.tsx, PrivateChip.test.tsx, Sidebar.test.tsx and App.newTask.test.tsx still match on the English names.
  • ar.ts is typed Messages, so a missing Arabic key would fail the build. All seven new keys are present.
  • The baseline counts drop to match: ChatView goes 14→9 and the two fully cleaned files are removed. The Electron source test switches to expectTranslated for the two labels it pinned.

Issues

  • 🟢 chat.privateOffTitle (en.ts / ar.ts) nearly duplicates composer.privateOffTitle. The English differs only in "isn't saved" vs "won't be saved". Keeping it preserves the exact English, which is reasonable. If the two wordings are ever unified, the header can reuse the composer key, as it already does for the other three private-button strings.

Strengths

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 13, 2026
Merged via the queue into amd:main with commit 5439e5c Nov 13, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-ui Agent UI changes bug Something isn't working multilingual Language support: translations, right-to-left layout, Arabic and other non-English languages tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In Arabic, the private chat, browse files and export buttons keep English names

2 participants