fix(translate): say why Translate did nothing (#287) #407

Merged
jared merged 1 commits from fix/translate-feedback into lotus 2026-10-18 08:59:31 -04:00
Owner

Fixes #287.

Clicking Translate could do nothing visible. If the message was already in the target language, or detection failed or was low-confidence, useMessageTranslation set skipped and switched itself back off: no chip, no "Translating…", no error.

Change: a manual Translate that has nothing to do now shows a short toast with the reason:

  • "This message is already in English." (uses the target language's name);
  • "Couldn't tell what language this message is in, so it wasn't translated."

"Translation isn't available" was already shown as the chip's error state. Auto-translate never gets here, because it only activates for detected, available pairs.

Verified (Chromium 153 with Translator/LanguageDetector; Translate on a message from Bob):

  • Before: nothing.
  • After: the toast shows. In headless Chromium the detector can't resolve a language, so this run covers the "couldn't tell" path; the "already in English" text is covered by the unit test.

tsc clean · unit tests pass · ESLint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5

Fixes #287. Clicking **Translate** could do nothing visible. If the message was already in the target language, or detection failed or was low-confidence, `useMessageTranslation` set `skipped` and switched itself back off: no chip, no "Translating…", no error. **Change:** a manual Translate that has nothing to do now shows a short toast with the reason: - "This message is already in English." (uses the target language's name); - "Couldn't tell what language this message is in, so it wasn't translated." "Translation isn't available" was already shown as the chip's error state. Auto-translate never gets here, because it only activates for detected, available pairs. **Verified** (Chromium 153 with Translator/LanguageDetector; Translate on a message from Bob): - **Before:** nothing. - **After:** the toast shows. In headless Chromium the detector can't resolve a language, so this run covers the "couldn't tell" path; the "already in English" text is covered by the unit test. `tsc` clean · unit tests pass · ESLint clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared added 1 commit 2026-10-18 00:17:08 -04:00
fix(translate): say why Translate did nothing (#287)
CI / Build & Quality Checks (pull_request) Successful in 3m5s
CI / Trigger Desktop Build (pull_request) Skipped
CI / Docker image build & smoke test (pull_request) Skipped
CI / Secret scan (gitleaks) (pull_request) Successful in 8s
CI / Playwright smoke (e2e) (pull_request) Successful in 13m42s
3e11a6fc0b
When a message was already in the target language, or its language
could not be detected, Translate switched itself back off with no chip,
no "Translating…" and no error. Show a short toast instead: "This
message is already in English." or "Couldn't tell what language this
message is in, so it wasn't translated."

Fixes #287

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5
jared merged commit a02eda05cb into lotus 2026-10-18 08:59:31 -04:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#407