来週の曜日・月末・日数後の日付候補を追加する - #369
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.
🟡 Changes recommended
READMEの仕様説明が実装(ニチゴの数字部最大4桁制限)と一致していないため、ユーザー向け仕様が誤解されないよう修正が必要です。
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
相対日付(「らいしゅうのげつよう(び)」「げつまつ」「3にちご」など)を日付候補として変換候補に追加し、既存の通常候補も維持したまま入力体験を拡張するPRです。
Changes:
- 相対日付文字列を解釈して対象日付を算出し、複数フォーマットの候補を生成する
RelativeDateShortcutsを追加 SegmentsManager.updateRawCandidateで相対日付候補を既存候補へ重複排除しつつ挿入- 週/月/年境界、うるう年、DST、入力範囲などのテストを追加し、READMEに機能説明を追記
File summaries
| File | Description |
|---|---|
| README.md | 相対日付変換機能の説明を追加 |
| Core/Tests/CoreTests/InputUtilsTests/RelativeDateShortcutsTests.swift | 相対日付解釈・候補生成・入力コミットのテストを追加 |
| Core/Sources/Core/InputUtils/SegmentsManager.swift | 変換候補生成時に相対日付候補を挿入 |
| Core/Sources/Core/InputUtils/RelativeDateShortcuts.swift | 相対日付の解釈と候補生成ロジックを追加 |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| let formats: [Format] = [ | ||
| .init(pattern: "M/d", value: -18, calendar: .gregorian), | ||
| .init(pattern: "yyyy/MM/dd", value: -18.1, calendar: .gregorian), | ||
| .init(pattern: "yyyy-MM-dd", value: -18.2, calendar: .gregorian), | ||
| .init(pattern: "M月d日(E)", value: -18.3, calendar: .gregorian), | ||
| .init(pattern: "yyyy年M月d日", value: -18.4, calendar: .gregorian), | ||
| .init(pattern: "Gyyyy年M月d日", value: -18.5, calendar: .japanese), | ||
| .init(pattern: "E曜日", value: -18.6, calendar: .gregorian) | ||
| ] |
|
|
||
| ## 機能 | ||
|
|
||
| * 相対日付変換:「らいしゅうのげつよう(び)」など全曜日、「げつまつ」、「3にちご」を日付候補に追加します。来週は月曜始まりの次週、月末は今月末、日数は今日基準の0〜3660日(半角・全角数字)です。通常の変換候補も残ります。 |
|
このレイヤーのロジックはAzooKeyKanaKanjiConverter側に入れたいです。 |
らいしゅうのげつよう、げつまつ、3にちごなどを日付へ変換します。来週は月曜始まり、日数は0〜3660日を対象とします。
検証
週/月/年境界・うるう年・DST・入力範囲をテスト。
このブランチ単独で
swift test --package-path Core --jobs 4を実行し、Coreの77テストが成功しました。git diff --checkも成功しています。変換範囲と処理負荷
既存日付変換と相対日付で書式・候補スコアの定義を共有します。数字部分は最大4桁です。文節編集中は全入力向けの日付候補を追加しません。