feat(typing): add English autocomplete and Chinese candidate expand panel

Offline English lexicon suggestions with autocapitalization, plus a same-height Chinese more-candidates grid over the key area.
This commit is contained in:
Rocky
2026-08-03 18:30:20 +08:00
parent d1e5fed964
commit 38e5ad570d
35 changed files with 5086 additions and 179 deletions
+5 -4
View File
@@ -20,7 +20,7 @@ public final class LibrimeEngine: RimeEngineBridging {
public init(
schema: TypingInputSchema = .fullPinyin,
candidateLimit: Int = 50,
candidateLimit: Int = 160,
configurationProvider: @escaping () -> TypingInputConfigurationSnapshot = {
TypingInputConfiguration.shared.snapshot
}
@@ -146,11 +146,12 @@ public final class LibrimeEngine: RimeEngineBridging {
let preedit = snapshot.preedit
composition = TypingComposition(
preedit: preedit,
candidates: snapshot.candidates.enumerated().map { index, candidate in
candidates: snapshot.candidates.enumerated().map { displayIndex, candidate in
TypingCandidate(
id: "\(preedit)|\(index)|\(candidate.text)",
id: "\(preedit)|\(displayIndex)|\(candidate.index)|\(candidate.text)",
text: candidate.text,
annotation: candidate.comment.isEmpty ? nil : candidate.comment
annotation: candidate.comment.isEmpty ? nil : candidate.comment,
engineIndex: Int(candidate.index)
)
}
)