生理期間の選択肢拡張と長期間表示不具合の修正 - #1379
Merged
Merged
Conversation
ユーザーから13日間の生理期間を記録したいという要望があったため、 設定可能な生理期間の上限を7日から30日に拡張しました。 - SettingMenstruationDynamicDescriptionConstants.durationListを変更 - 30日という値は医学的根拠ではなく、十分な選択肢を提供するための値 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
13日間など長期間の生理期間で、真ん中の週のピンク色の帯が 表示されない不具合を修正しました。 問題の原因: - _containsメソッドが生理期間の開始日または終了日が週に含まれるかのみチェック - 週全体が生理期間内にある場合(例:第2週)が判定されない 修正内容: - 週の期間と生理期間が重なるかどうかを判定するロジックに変更 - dateRange.begin < calendarBandModel.end かつ dateRange.end > calendarBandModel.begin 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
以下のテストケースを追加しました: 1. calendar_menstruation_band_test.dart - 13日間の生理期間が正しく表示されるテスト - 月をまたぐ生理期間の表示テスト - 4日から13日に編集された場合のテスト 2. calendar_band_function_test.dart - bandLength関数のテスト(週をまたぐケース) - isNecessaryLineBreak関数のテスト - offsetForStartPositionAtLine関数のテスト 3. week_calendar_menstruation_test.dart - CalendarWeekLineでの生理期間表示テスト 4. date_range_contains_test.dart - 期間の重なり判定ロジックのテスト 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
カレンダーのバンド表示で期間の重なりを判定する際の注意点を追記しました。 今回の不具合の教訓として、開始日/終了日の包含チェックだけでなく、 期間全体の重なりをチェックする必要があることを明記。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…t format lib -l 150
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
ユーザーから報告された2つの問題を修正しました:
問題の詳細
ユーザーからの報告内容
修正内容
1. 生理期間の選択肢を30日まで拡張
SettingMenstruationDynamicDescriptionConstants.durationListを7日から30日に変更2. 長期間の生理期間表示不具合を修正
問題の原因
CalendarWeekLineの_containsメソッドが、生理期間の開始日または終了日が週に含まれるかのみをチェックしていたため、週全体が生理期間内にある場合(例:第2週)が判定されない修正内容
週の期間と生理期間が重なるかどうかを判定するロジックに変更:
動作確認方法
生理期間の設定
長期間の生理記録
テスト
以下のテストケースを追加し、すべてパスすることを確認しました:
calendar_menstruation_band_test.dart: 13日間の生理期間、月をまたぐケース、編集後の表示calendar_band_function_test.dart: バンド表示関数のロジックテストweek_calendar_menstruation_test.dart: 週ごとの表示テストdate_range_contains_test.dart: 期間の重なり判定ロジックのテスト🤖 Generated with Claude Code