fix+test: disable action buttons in saved and discarded panel states#47
Merged
Merged
Conversation
The review panel was leaving Save, Append, and Discard enabled after a note was saved or discarded, allowing the user to trigger a second save. Introduces isActionBlocked to cover saving/saved/discarded, and adds five new widget tests for the error, saved, discarded, and overflow edge cases.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
The review panel left Save, Append, and Discard enabled after a note was saved or discarded, making a second accidental save possible. Added
isActionBlocked(coveringsaving | saved | discarded) so those buttons are correctly disabled once the draft is no longer actionable.Also split the existing "shows saved status" test into two focused tests (one for the success message, one for the dropdown callback), and added five new widget tests for error, saved, discarded, and overflow edge cases.
Changed files
lib/widgets/note_draft_review_panel.dart—isActionBlockedguard on buttons and dropdowntest/note_draft_review_panel_test.dart— split one test, add five new state/overflow testsTests run
flutter analyze— no issuesflutter test— 259 passed (was 253; +6 net)Risks / follow-up
Minimal. The only production change is the extra disabled condition on three buttons and the dropdown
onChanged. Existing search-screen integration tests still pass.Intentionally not changed
Persistence, SearchScreen wiring, Brave behaviour, markdown generation, evidence generation, source sorting logic.