Skip to content

日付候補の優先書式を設定できるようにする - #364

Open
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/date-format-preference
Open

日付候補の優先書式を設定できるようにする#364
sinoda1114 wants to merge 2 commits into
azooKey:mainfrom
sinoda1114:codex/date-format-preference

Conversation

@sinoda1114

@sinoda1114 sinoda1114 commented Sep 5, 2026

Copy link
Copy Markdown

日付候補の書式を「標準」「MM/DD」「曜日付き」から選択できるようにします。日付と識別できる候補だけを並べ替え、通常の変換候補は維持します。

検証

設定と候補の並べ替え・不足書式の補完をテスト。

このブランチ単独で swift test --package-path Core --jobs 4 を実行し、Coreの77テストが成功しました。git diff --check も成功しています。

対象範囲

このPR単独では既存の「きょう」などの日付候補が対象です。別途提案する曜日・相対日付・4桁MMDDの候補生成処理との接続は含みません。関連PRが採用された場合は、接続する差分を追加して検証します。

変換範囲と処理負荷

文節の変換範囲を縮めている間は、全入力向けの日付候補の補完を行いません。未接続だった数値日付の曜日補完は、この独立PRの対象から外しています。

Copilot AI lite review requested due to automatic review settings September 5, 2026 03:43
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T03:45:38.537355Z 0db3f07 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0db3f071fb

ℹ️ 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".

Comment on lines +580 to +583
let dateEntries = dynamicShortcuts.compactMap { entry -> DicdataElement? in
guard entry.ruby == self.composingText.convertTarget.toKatakana(),
entry.word.hasPrefix("<date ") else {
return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Source numeric dates before applying the weekday preference

When the user converts a four-digit month/day such as 1111, dateEntries is always empty because it is built exclusively from dynamicShortcuts, whose readings are fixed words such as キョウ and アシタ; the converter's numeric 11/11 candidate is never inspected. Consequently numericWeekday is unreachable through SegmentsManager, so the documented 11月11日(水) candidate does not appear in actual input despite the direct helper test passing. Include numeric date entries from the conversion result or its provider before applying the preference.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

変更範囲が日付候補の並べ替えに限定されており、設定経路の接続と挙動テストが追加されているため。

Pull request overview

日付変換候補(「きょう」等)について、ユーザーが希望する表示書式(標準 / MM/DD優先 / 曜日付き優先)を選べるようにし、日付と識別できる候補のみを対象に並べ替え・不足書式の補完を行う変更です。通常の変換候補の並びは維持しつつ、日付候補内だけを安定に入れ替えることで選択しやすさを改善しています。

Changes:

  • 新しい設定項目 DateFormatPreference を追加し、設定UI/設定更新経路(ConverterServer・ConfigWindow)に接続
  • 変換結果に対して日付候補のみを並べ替え、必要に応じて「09/05」や「M月d日(E)」形式の不足候補を追加するロジックを追加
  • 上記挙動のユニットテストを追加し、READMEに設定内容を追記
File summaries
File Description
README.md 新しい「日付候補の優先書式」設定と挙動の説明を追記
Core/Tests/CoreTests/InputUtilsTests/DateCandidatePreferenceTests.swift 並べ替え・補完・安定性・実変換での提供をテスト追加
Core/Sources/Core/InputUtils/SegmentsManager.swift 変換結果に日付候補優先ロジックを適用し、テスト注入用Contextに設定を追加
Core/Sources/Core/InputUtils/DateCandidatePreference.swift 日付候補の抽出済み語群に対する安定並べ替えと不足候補の補完実装を追加
Core/Sources/Core/Configs/DateFormatPreference.swift 新しい設定値(standard/monthDay/weekday)とキーを追加
Core/Sources/ConverterServer/ConverterServer+Settings.swift 設定ディスクリプタ追加と設定更新処理の分岐を追加
azooKeyMac/Windows/ConfigWindow.swift カスタマイズ(入力オプション)に新設定キーを追加
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants