Translator: take the whole copied text, keep the translation when the notch is stretched

Browsers report only part of a selection over Accessibility; when the clipboard
holds a longer text containing it, translate the clipboard. Dragging the handle
moved the home view to the chat and dropped the card; now the translation goes
into the chat (after it finishes, if still loading).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maksarsanjeev
2026-10-19 11:38:47 +03:00
parent 46901f2b62
commit 4f1e90ad8d
2 changed files with 29 additions and 8 deletions
@@ -449,6 +449,9 @@ struct ChatResizeHandle: View {
DragGesture(minimumDistance: 2, coordinateSpace: .global)
.onChanged { g in
if startHeight == nil {
// A translation card on the home view goes along into the chat
// instead of disappearing.
if state.translation != nil { TranslatorRun.moveToChat(state: state) }
if state.view != .prompt {
state.chatDetent = 0
state.view = .prompt