Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds UX and persistence improvements around profiles and ringtones, including a long-press profile deletion flow, and an iOS-specific fallback UI for system ringtones when unsupported.
Changes:
- Add long-press profile deletion entry point in the profile selector, with a confirmation dialog and undo affordance.
- Add an iOS “system ringtones not supported” fallback message in the ringtone selection UI.
- Add quote popup logic on app navigation (based on passed route arguments) and update Isar provider profile deletion behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| lib/app/modules/home/views/profile_config.dart | Adds long-press gesture to trigger profile deletion from the UI. |
| lib/app/modules/home/controllers/home_controller.dart | Implements profile deletion dialog/flow and adds quote popup trigger on init. |
| lib/app/modules/addOrUpdateAlarm/views/ringtone_selection_page.dart | Adds iOS fallback UI for system ringtones tab. |
| lib/app/data/providers/isar_provider.dart | Adds Isar profile deletion and modifies SQLite alarm schema/migration-related code. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
238
to
+242
| void writeProfileName(String name) async { | ||
| await storage.writeProfile(name); | ||
| selectedProfile.value = name; | ||
| ProfileModel? p = await IsarDb.getProfile(name); | ||
| if (p != null) | ||
| { | ||
| profileModel.value = p!; | ||
| profileModel.value = p!; |
Comment on lines
374
to
378
| FirebaseAuth.instance.authStateChanges().listen((user) { | ||
| if (user == null) { | ||
| isUserSignedIn.value = false; | ||
| } else { | ||
| isUserSignedIn.value = true; |
| return profileModel; | ||
| } | ||
|
|
||
| static void deleteProfile(String profileName) async { |
Comment on lines
+162
to
+166
| // Widget _buildSystemRingtonesTab() { | ||
| // return SystemRingtonePicker( | ||
| // isFullScreen: true, | ||
| // ); | ||
| // } |
Comment on lines
231
to
+235
| void readProfileName() async { | ||
| String profileName = await storage.readProfile(); | ||
| selectedProfile.value = profileName; | ||
| ProfileModel? p = await IsarDb.getProfile(profileName); | ||
| if (p != null) | ||
| { | ||
| profileModel.value = p!; | ||
| } | ||
|
|
||
| profileModel.value = p!; |
| onPressed: () async { | ||
| ProfileModel deletedProfile = profile; | ||
| try{ | ||
| IsarDb.deleteProfile(profile.profileName); |
| if (profile.isSharedAlarmEnabled) { | ||
| Get.snackbar( | ||
| 'Error', | ||
| 'This profile contains shared alarms.', |
| @@ -142,7 +142,6 @@ class IsarDb { | |||
| label TEXT, | |||
| isOneTime INTEGER NOT NULL DEFAULT 0, | |||
| snoozeDuration INTEGER, | |||
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Description
This PR introduces the ability for users to delete a profile along with its associated alarms. Currently, profiles can only be deleted if they do not contain shared alarms.
A deleted profile can be undone, but when restored it will be retrieved without its previous alarms. Full restoration of alarms is left for future improvements.
Proposed Changes:
Added a delete confirmation dialog for profiles
Implemented an Undo option for profile deletion