元の英字キー列から大小文字の変換候補を追加する - #370
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8201dd3a25
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| requireEnglishPrediction: Config.DebugPredictiveTyping().value ? .manualMix : .disabled | ||
| ) | ||
| ) | ||
| let romanInput = self.composingText.input.map(\.piece).inputString(preferIntention: false) |
There was a problem hiding this comment.
Scope case candidates to the edited segment
When the user changes the conversion boundary with editSegment, candidates are expected to consume only the focused prefix so the unfocused suffix remains available. Reconstructing romanInput from the entire composingText instead makes every case candidate represent the whole composition (and line 583 gives it the whole input count), so selecting one after Shift-Left/Shift-Right consumes the suffix rather than converting only the edited segment. Build the candidate from prefixToCursorPosition() with the corresponding input count, as the existing selecting-mode Roman candidate path does.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
🟡 Changes recommended
追加候補の DicdataElement.ruby が元ローマ字入力ではなく convertTarget.toKatakana() になっており、候補の読み/学習データとして不整合になり得るためです。
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
日本語モードのローマ字入力で、かな変換後の表示(例: ふぁbぇ)から元の英字キー列に基づく大小文字バリアント(lower/title/upper)を変換候補として追加し、単語登録なしで選択・確定できるようにする変更です。
Changes:
- 変換候補生成後に、元入力ローマ字の大小文字バリアント候補を
mainResultsに差し込み - 大小文字バリアント生成ロジック(
RomanCaseCandidates)を追加 - 生成ロジックと
SegmentsManager経由での候補提示・全文確定をカバーするテストを追加
File summaries
| File | Description |
|---|---|
| Core/Tests/CoreTests/InputUtilsTests/RomanCaseCandidatesTests.swift | 大小文字バリアント生成と、候補選択〜全文確定の統合テストを追加 |
| Core/Sources/Core/InputUtils/SegmentsManager.swift | 変換結果にローマ字大小文字候補を差し込む処理を追加 |
| Core/Sources/Core/InputUtils/RomanCaseCandidates.swift | 元入力ローマ字から lower/title/upper を生成するユーティリティを追加 |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| composingCount: .inputCount(self.composingText.input.count), | ||
| lastMid: MIDData.一般.mid, | ||
| data: [.init(word: text, ruby: self.composingText.convertTarget.toKatakana(), cid: CIDData.固有名詞.cid, mid: MIDData.一般.mid, value: -18)], | ||
| isLearningTarget: false |
|
AzooKeyKanaKanjiConverterの側でやるのが適切な処理なのでそちらにお願いしたいです 🙏 |
日本語モードでfableと打ち「ふぁbぇ」と表示された状態から、fable・Fable・FABLEを選べるようにします。元のキー列を利用するため単語登録は不要です。
検証
複数のキー列・大小3種類・重複・候補選択と全文確定をテスト。
このブランチ単独で
swift test --package-path Core --jobs 4を実行し、Coreの70テストが成功しました。git diff --checkも成功しています。検証は各ブランチ単独で実施しています。並行実行時に既存の設定共有テストが一度失敗したため、単独再実行で成功を確認しました。
変換範囲と処理負荷
文節編集中は選択中の範囲の元キー列から候補を作り、その入力数だけを確定します。候補の読みには既存の英数変換と同様に元キー列を使用します。候補が空の場合の重複チェックは省略します。