-
Notifications
You must be signed in to change notification settings - Fork 240
fix: macOS, iPad Delete Action Fails and Causes Bottom Overflow Error in Confirmation Dialog #1326
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: macOS, iPad Delete Action Fails and Causes Bottom Overflow Error in Confirmation Dialog #1326
Conversation
Reviewer's GuideThis PR refactors the delete confirmation dialog into a responsive, scrollable layout using ScreenUtil, connects the OK button to the badge deletion logic with a UI refresh, and simplifies the SnowFlakeAnimation by moving frame calculations out of the loop, handling empty grids, and condensing the canvas update. Sequence Diagram for Badge Deletion ProcesssequenceDiagram
actor User
participant Dialog as DeleteConfirmationDialog
participant Logic as BadgeDeletionService
participant UI as ClipartListUI
User->>Dialog: Clicks "OK" button
Dialog->>Logic: deleteBadge()
Logic->>Logic: Performs deletion
Logic->>UI: Trigger UI update
UI->>UI: Refreshes list
Updated Class Diagram for DeleteBadgeDialogclassDiagram
class DeleteBadgeDialog {
+Widget build(BuildContext context)
// build() method: UI structure refactored for responsiveness and to fix overflow:
// - Root widget changed from fixed-size Container to Padding.
// - Uses Column with MainAxisSize.min for intrinsic content sizing.
// - Leverages ScreenUtil for responsive dimensions and font sizes.
// - Confirmation message Text is wrapped with Expanded for better layout.
}
StatelessWidget <|-- DeleteBadgeDialog
Updated Class Diagram for SnowFlakeAnimationclassDiagram
class SnowFlakeAnimation {
+animate(int badgeHeight, int badgeWidth, int animationIndex, List<List<bool>> processGrid, List<List<bool>> canvas) void
// animate() method: Logic refactored for clarity and performance:
// - Frame count calculation (framesCount) is now outside the loops.
// - Added a safeguard: framesCount defaults to 1 if calculated as 0.
// - Current frame calculation (currentFrame) simplified.
// - Starting column (startCol) calculation based on currentFrame.
// - Canvas cell update logic is more direct.
}
BadgeAnimation <|-- SnowFlakeAnimation
File-Level Changes
Assessment against 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 @samruddhi-Rahegaonkar - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `lib/view/widgets/badge_delete_dialog.dart:38` </location>
<code_context>
- width: 20,
+ Expanded(
+ child: Text(
+ 'Are you sure want to delete this badge?',
+ style: TextStyle(fontSize: 14.sp),
+ ),
</code_context>
<issue_to_address>
Fix grammar in confirmation message
Change the prompt to: “Are you sure you want to delete this badge?”
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
child: Text(
'Are you sure want to delete this badge?',
style: TextStyle(fontSize: 14.sp),
),
=======
child: Text(
'Are you sure you want to delete this badge?',
style: TextStyle(fontSize: 14.sp),
),
>>>>>>> REPLACE
</suggested_fix>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
child: Text( | ||
'Are you sure want to delete this badge?', | ||
style: TextStyle(fontSize: 14.sp), | ||
), |
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.
nitpick (typo): Fix grammar in confirmation message
Change the prompt to: “Are you sure you want to delete this badge?”
child: Text( | |
'Are you sure want to delete this badge?', | |
style: TextStyle(fontSize: 14.sp), | |
), | |
child: Text( | |
'Are you sure you want to delete this badge?', | |
style: TextStyle(fontSize: 14.sp), | |
), |
ec31ae8
to
f20a1dd
Compare
Build StatusBuild successful. APKs to test: https://github.com/fossasia/badgemagic-app/actions/runs/16625096560/artifacts/3649326250. Screenshots (Android)
Screenshots (iPhone)
Screenshots (iPad)
|
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.
Dropping fixed dimensions risks content overflow or clipping (especially with longer/localized text) and may reduce touch‐target areas below accessibility guidelines.
… in Confirmation Dialog fix: according to review
24bc1e2
to
f091233
Compare
@nope3472 please review this again |
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 Great work
@samruddhi-Rahegaonkar please update the branch so we can merge |
Done 👍 |
@Jhalakupadhyay we need an approval from you to merge this |
Fixes #1219
Changes
Dialog
content in aSingleChildScrollView
.ScreenUtil
for padding, spacing, and font sizes.Screenshots / Recordings
Checklist:
constants.dart
without hard coding any value.Summary by Sourcery
Fix the delete confirmation dialog to prevent overflow and enable actual deletion with responsive layout, and simplify the snowflake animation grid logic
Bug Fixes:
Enhancements: