-
Notifications
You must be signed in to change notification settings - Fork 35
fix: conflicting snackbars #107
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
Conversation
Our Pull Request Approval ProcessThanks for contributing! ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
Other🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise. |
|
@zxnb01 add a working recording. |
|
@zxnb01 The dialogs seem to be appearing twice because CustomSnackBar is called in both the screens/UI code and the cubit. Please make sure to remove one and keep it in a single location. |
|
@may-tas , removed the duplication of snackbar. User Actions That Trigger Snackbars: 1.Canvas Operations
2.Page Management
3.Background Operations
4.the red snackbar triggers in time of failure Untitled.video.-.Made.with.Clipchamp.mp4 |
|
@zxnb01, please remove the snackbar for redo/undo features. Users will use redo/undo frequently, causing snackbars to stack on top of each other. |
|
@zxnb01, I kindly ask you to |
|
|
okay, it was present from before so i didnt remove that. ill do it. |
|
Yes
|
What kind of change does this PR introduce?
Bug fix - Fixes snackbar message conflicts and improves UI feedback system
Issue Number:
Fixes #104
Snapshots/Videos:
uploaded in the #104
Summary
This PR addresses critical issues with the snackbar implementation in the canvas screen:
Problems Solved:
Message Overshadowing: The BlocConsumer listener was automatically showing snackbars for any state.message using only CustomSnackbar.showInfo(), which could overshadow other snackbars triggered by user actions (like undo, redo, clear canvas operations)
Limited Snackbar Types: The automatic message system only used showInfo(), preventing the use of showSuccess() or showError() snackbars for appropriate contextual feedback
Inefficient State Management: The system required a message parameter in the state that needed to be manually cleared after each use, leading to unnecessary state updates and potential race conditions
Changes Made:
✅ Removed message field from CanvasState and related state management methods
✅ Replaced automatic snackbar display in BlocConsumer listener with direct calls to appropriate CustomSnackbar methods
✅ Implemented proper success (green), error (red), and info (blue) snackbar types with contextual feedback
✅ Eliminated the need for clearMessage() method and related state updates
✅ Improved separation of concerns between business logic and UI feedback
Does this PR introduce a breaking change?
no
Other information
Testing performed:
✅ Verified success snackbars display correctly for save operations
✅ Verified info snackbars display correctly for informational messages
✅ Confirmed no snackbar message conflicts occur during rapid operations
✅ Ensured all existing functionality works as expected
Have you read the contributing guide , README.md , code of conduct?
yes