Conversation
Settings → Translation (off by default) translates chats in apps the user picks (WhatsApp, Teams, Telegram, Slack, Outlook, Mail, Messages): - Incoming: every 2 s, and right after scrolling, TranslationCoordinator captures the frontmost chat window (new captureActiveWindow), reads it with Vision OCR using language hints, groups lines into messages (MessageBlockGrouper: conversation area above the reply field, timestamps and low-confidence lines dropped), and draws each translation under its message in a click-through overlay. Unchanged windows are skipped by a pixel fingerprint. - Replies: when the user writes in their reading language in a chat whose language is known, the reply is translated after a 700 ms pause and shown in a card under the field; ⌃⌥T (recordable) replaces the draft via select-all + paste with the clipboard restored. Never sends. - Engines: Apple Translation (TranslationSession(installedSource:target:), on-device) for its ~20 languages; for pairs it lacks, such as Macedonian, the selected Open Source model with a few-shot prompt, as the bundled models are base models. Results are cached in memory only. - TranslationLanguagePolicy is conservative (≥12 letters, ≥0.8 confidence, no links or numbers) and recognizes Macedonian by its alphabet, since Natural Language reports it as Bulgarian. Respects Cotabby's own gates (globally on, not paused, app not disabled, Low Power Mode), never reads secure fields, and stores nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the field icon Clicking Cotabby's field-edge icon opens a small popup for the focused app and window. It has an app switch and a window choice (same as app, on, off) for Autocomplete and for Translate. A window is its app plus its normalized title (unread badges like "(3) " dropped), so a Teams or WhatsApp chat can be configured on its own. - WindowFeatureScope (pure): window keys, "window choice wins over the app", and the disabled-apps set adjusted for the focused window, which every existing autocomplete gate now reads. - WindowFeatureOverrideStore: window choices in UserDefaults, bounded to 500 windows per feature. - App switches write to the existing owners (disabled-apps list, the translation app list), so Settings and the popup agree. - The icon is clickable, and stays visible but dimmed where autocomplete is off, since it is the way back on. The popup is a non-activating panel, so the host app keeps keyboard focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LptEE4YbaWL55YwQRnTt74
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Smaller popup (216pt): one row per feature with a compact switch, a mini "This window: App / On / Off" picker, Settings as a gear icon. - A SwiftUI switch instead of the system one: the popup panel is never key (the host keeps focus), and AppKit drew inactive-window switches gray, so "on" looked "off". The hosting view accepts the first click. - Teams, Slack and WhatsApp (Chromium/Electron) do not link the web field to its window in the AX tree, so no window title was found and the popup offered app switches only. FocusedInputSnapshot gains appFocusedWindowTitle (the app's focused-window title, read only when the field-relative read fails) and featureScopeWindowTitle. It is used only for window choices and the translation conversation key, never for prompts or session identity. This also fixes reply translation in Teams, whose conversation key never matched the incoming one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LptEE4YbaWL55YwQRnTt74
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LptEE4YbaWL55YwQRnTt74
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds on #845 (translation). This branch contains #845's commit; review only the last commit.
Clicking Cotabby's field-edge icon opens a small popup for the focused app and window:
(3)dropped. Chats in Teams or WhatsApp can therefore be configured individually.Design
WindowFeatureScope(pure,Support/Settings): window keys and the precedence rule. It also adjusts the disabled-apps set for the focused window, so every existing autocomplete availability gate respects window choices without changing their signatures.WindowFeatureOverrideStore: window choices in UserDefaults, capped at 500 windows per feature.windowAutocompleteOverride), so its tests need no store.Test plan
WindowFeatureScopeTests,WindowFeatureOverrideStoreTests).🤖 Generated with Claude Code
https://claude.ai/code/session_01LptEE4YbaWL55YwQRnTt74