-
Notifications
You must be signed in to change notification settings - Fork 19
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: Drag with mouse
switch
#195
Conversation
Reviewer's Guide by SourceryThis pull request fixes a bug where the "Drag with mouse" switch would activate the "AMOLED black" switch and become unresponsive unless the "AMOLED black" switch was deactivated. The fix updates the Sequence diagram for fixed mouse drag switch interactionsequenceDiagram
actor User
participant Switch as Mouse Drag Switch
participant Settings as Client Settings Provider
Note over User, Settings: Before Fix
User->>Switch: Toggle switch
Switch->>Settings: setAmoledBlack(value)
Settings-->>Switch: Update AMOLED setting (incorrect)
Note over User, Settings: After Fix
User->>Switch: Toggle switch
Switch->>Settings: update(mouseDragSupport: !current)
Settings-->>Switch: Update mouse drag setting (correct)
State diagram for mouse drag switch behaviorstateDiagram-v2
[*] --> MouseDragOff: Initial State
MouseDragOff --> MouseDragOn: Toggle Switch
MouseDragOn --> MouseDragOff: Toggle Switch
note right of MouseDragOff
Fixed: Now correctly toggles
mouseDragSupport instead of
AMOLED setting
end note
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @bazzadazza72 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the duplicate state update logic into a single function to avoid repetition between the ListTile and Switch widgets
- The Switch's onChanged callback receives the new value as a parameter - consider using this directly instead of reading the current state and negating it
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Review instructions: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -498,7 +498,9 @@ class _ClientSettingsPageState extends ConsumerState<ClientSettingsPage> { | |||
.update((current) => current.copyWith(mouseDragSupport: !clientSettings.mouseDragSupport)), |
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.
issue (bug_risk): The Switch's onChanged callback should use the provided 'value' parameter instead of negating the current value
This could cause incorrect behavior if the switch is toggled rapidly. Use 'value' directly: .update((current) => current.copyWith(mouseDragSupport: value))
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.
Looks good to me, thanks for finding and fixing this 👍🏼
Pull Request Description
Previously, the "Drag with mouse" switch in the settings would turn on the "AMOLED black" switch and would not respond to input unless the latter switch was turned off.
Now, it works as it should and responds correctly to users enabling the setting.
Issue Being Fixed
Resolves #194
Screenshots / Recordings
No screenshots/recordings required
Checklist