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): show IME composition on the iPad remote screen

leepokai4e5e38330111
diff --git a/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenCanvas.swift b/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenCanvas.swift
index fbd3a18c..03d41826 100644
--- a/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenCanvas.swift
+++ b/apps/ios/Kit/Sources/CodyncUI/Screen/ScreenCanvas.swift
@@ -44,6 +44,7 @@ final class ScreenCanvas: UIView, UIGestureRecognizerDelegate {
addSubview(video)
keys.onText = { [weak self] in self?.typed($0) }
keys.onKey = { [weak self] key, mods in self?.pressKey(key, mods) }
+ keys.onComposingChanged = { [weak self] in self?.setNeedsLayout() }
addSubview(keys)
installGestures()
}
@@ -93,10 +94,23 @@ final class ScreenCanvas: UIView, UIGestureRecognizerDelegate {
viewport.pan(by: .zero)
scheduleViewRequest()
}
- keys.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
+ layoutKeys()
layoutVideo()
}
+ /// Hidden while idle; while an IME composes, the field shows above the bottom bar so its
+ /// marked text and the candidate popup anchored to its caret are visible.
+ private func layoutKeys() {
+ guard keys.isComposing else {
+ keys.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
+ return
+ }
+ let area = bounds.inset(by: safeAreaInsets).insetBy(dx: 16, dy: 16)
+ let fit = keys.sizeThatFits(CGSize(width: area.width, height: .greatestFiniteMagnitude))
+ let size = CGSize(width: min(max(fit.width + 28, 80), area.width), height: max(fit.height + 16, 40))
+ keys.frame = CGRect(x: area.midX - size.width / 2, y: area.maxY - size.height, width: size.width, height: size.height)
+ }
+
override func didMoveToWindow() {
super.didMoveToWindow()
// First responder even with the keyboard hidden, so a hardware keyboard just works.
@@ -304,6 +318,11 @@ final class ScreenCanvas: UIView, UIGestureRecognizerDelegate {
private final class KeyProxyField: UITextField, UITextFieldDelegate {
var onText: (String) -> Void = { _ in }
var onKey: (String, [String]) -> Void = { _, _ in }
+ /// The composition started, changed or ended: the canvas places and sizes the field.
+ var onComposingChanged: () -> Void = {}
+ private(set) var isComposing = false {
+ didSet { alpha = isComposing ? 1 : 0.02 }
+ }
/// With the soft keyboard hidden the field stays first responder, so hardware keys still arrive.
var showsSoftKeyboard = false {
@@ -320,6 +339,11 @@ private final class KeyProxyField: UITextField, UITextFieldDelegate {
delegate = self
alpha = 0.02
tintColor = .clear
+ textColor = .white
+ backgroundColor = UIColor(white: 0.12, alpha: 1)
+ layer.cornerRadius = 12
+ leftView = UIView(frame: CGRect(x: 0, y: 0, width: 14, height: 1))
+ leftViewMode = .always
autocorrectionType = .no
autocapitalizationType = .none
spellCheckingType = .no
@@ -338,6 +362,8 @@ private final class KeyProxyField: UITextField, UITextFieldDelegate {
/// Sends committed text; text still being composed by an IME waits.
@objc private func changed() {
+ isComposing = markedTextRange != nil
+ onComposingChanged()
guard markedTextRange == nil, let t = text, !t.isEmpty else { return }
onText(t)
text = ""
diff --git a/apps/ios/WhatsNew.md b/apps/ios/WhatsNew.md
index 9c470a7e..a418804e 100644
--- a/apps/ios/WhatsNew.md
+++ b/apps/ios/WhatsNew.md
@@ -5,16 +5,14 @@ listing what iPhone users notice. tools/asc-submit.py reads the released version
a version without one gets a generic "Bug fixes and improvements" line. Delete old sections.
-->
-## 2.9.0
+## 2.9.1
### zh-Hant
-- 可以選擇分享使用分析,幫助我們改善 Codync:只記錄用了哪些功能,絕不收集訊息、程式碼或檔案,隨時能在設定關閉。
-- 現在也能用 Windows 電腦執行你的 bot:在 Windows 安裝 Codync 後,用 iPhone 配對就能傳訊息、批准。
- 修正 iPad 外接鍵盤用注音等輸入法打字時,選好的字從輸入框消失、之後無法再輸入的問題。
+- 在遠端畫面用 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.
+- On the remote screen, text you're composing with Zhuyin or another input method on an iPad hardware keyboard now shows, along with its candidates.