Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix(ios): keep hardware-keyboard IME text in the composer

leepokai8979be48b65c
diff --git a/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift b/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift
index fb4f3d9a..952272d6 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Thread/Composer.swift
@@ -15,10 +15,9 @@ struct Composer: View {
var onInterrupt: (() -> Void)?
@Environment(BotStore.self) private var model
@Environment(\.accessibilityReduceMotion) private var reduceMotion
- private var draft: String {
- get { model.composerDraft(for: botId, thread: thread) }
- nonmutating set { model.setComposerDraft(newValue, for: botId, thread: thread) }
- }
+ /// The field owns its text; the store only keeps a copy. A field bound straight to the
+ /// store loses a hardware keyboard's IME composition (Zhuyin, Pinyin, Kana) on iPad.
+ @State private var draft = ""
/// Files going out with the next message.
@State private var files: [OutgoingFile] = []
@State private var pickingFiles = false
@@ -108,7 +107,8 @@ struct Composer: View {
box
}
.glass(in: RoundedRectangle(cornerRadius: 24, style: .continuous))
- .animation(Motion.layout, value: draft)
+ // Lines, not the text: an animated transaction on every keystroke breaks IME composition.
+ .animation(Motion.layout, value: draft.count(where: \.isNewline))
}
.animation(Motion.layout, value: files.map(\.id))
.dropDestination(for: PickedFile.self) { picked, _ in
@@ -188,7 +188,7 @@ struct Composer: View {
private var box: some View {
HStack(alignment: .bottom, spacing: 8) {
- TextField(placeholder, text: Binding(get: { draft }, set: { draft = $0 }), axis: .vertical)
+ TextField(placeholder, text: $draft, axis: .vertical)
.lineLimit(1...8)
.font(.body)
.textFieldStyle(.plain)
@@ -201,6 +201,10 @@ struct Composer: View {
.padding(.leading, 18)
.padding(.trailing, 6)
.padding(.vertical, boxPadding)
+ .onChange(of: [botId, thread], initial: true) {
+ draft = model.composerDraft(for: botId, thread: thread)
+ }
+ .onChange(of: draft) { _, value in model.setComposerDraft(value, for: botId, thread: thread) }
.onChange(of: model.routineDrafts[botId]) { _, value in
guard thread == nil, let value else { return }
draft = draft.isEmpty ? value : draft + "\n" + value
@@ -294,6 +298,7 @@ struct Composer: View {
guard canSend else { return }
withAnimation(Motion.reduced(Motion.conversation, reduceMotion)) {
guard model.sendComposerDraft(to: botId, thread: thread, files: files) else { return }
+ draft = ""
files = []
}
}
diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.md
index c0b4d894..9c470a7e 100644
--- a/apps/ios/WhatsNew.md
+++ b/apps/ios/WhatsNew.md
@@ -11,8 +11,10 @@ a version without one gets a generic "Bug fixes and improvements" line. Delete o
- 可以選擇分享使用分析,幫助我們改善 Codync:只記錄用了哪些功能,絕不收集訊息、程式碼或檔案,隨時能在設定關閉。
- 現在也能用 Windows 電腦執行你的 bot:在 Windows 安裝 Codync 後,用 iPhone 配對就能傳訊息、批准。
+- 修正 iPad 外接鍵盤用注音等輸入法打字時,選好的字從輸入框消失、之後無法再輸入的問題。
### en-US
- You can choose to share usage analytics to help improve Codync: only which features you use, never your messages, code or files. Turn it off anytime in Settings.
- Your bots can now run on a Windows PC too: install Codync there and pair your iPhone to message and approve them.
+- Fixed text typed with Zhuyin or another input method on an iPad hardware keyboard vanishing from the message box and blocking further input.