-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Select already existing due date chip when creating a custom chip. #1276
Conversation
When trying to create a custom chip with the value of the already pre-existing chips, the pre-existing chips should be selected instead creating a custom chip and selecting both the pre-existing and new chip. Fixes #1272
WalkthroughThe recent update to the application focuses on enhancing the user interface for homework scheduling. It introduces a logical check to prevent the duplication of scheduling chips when selecting a due date for homework. Additionally, the update includes regression tests to ensure the new functionality works as expected and that the specific lesson interval chips are created correctly. Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- app/lib/homework/homework_dialog/homework_dialog.dart (4 hunks)
- app/test/homework/homework_dialog_test.dart (1 hunks)
Additional comments: 4
app/lib/homework/homework_dialog/homework_dialog.dart (2)
- 27-27: The import statement for
platform_check
has been added. Ensure that this package is used within the file and that it is necessary for the changes made.- 516-526: The logic in
addInXLessonsChip
method now checks if a chip already exists before adding a new one. This change aligns with the PR objectives to prevent duplicate chips. However, ensure that the label for the new chip is consistent with the existing naming convention and that the selection of the chip is handled correctly.app/test/homework/homework_dialog_test.dart (2)
- 635-654: The test case starting at line 635 correctly sets up the necessary context and performs actions to simulate the issue described in the PR objectives. It verifies that selecting a custom chip for "in 2 lessons" results in the selection of the "Übernächste Stunde" chip without creating a new custom chip. The assertions at lines 652 and 653 confirm the expected behavior, which aligns with the PR's objectives.
- 656-673: The test case starting at line 656 follows a similar pattern to the previous one, targeting the "in 1 lesson" scenario. It ensures that the "Nächste Stunde" chip is selected without creating a new custom chip. The assertions at lines 671 and 672 validate the correct behavior. This test case is well-structured and achieves the intended purpose of preventing duplicate chip creation.
Visit the preview URL for this PR (updated for commit f7526c7): https://sharezone-test--pr1276-fix-due-date-chip-se-6lvt8r9z.web.app (expires Wed, 24 Jan 2024 18:03:49 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 4cb3ae61e1e018abfd9841fd3239f5b49ccc034b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
When trying to create a custom chip with the value of the already pre-existing chips, the pre-existing chips should be selected instead creating a custom chip and selecting both the pre-existing and new chip.
Fixes #1272
Summary by CodeRabbit
New Features
Tests