Skip to content

option to delete profile#905

Open
NihalDR wants to merge 3 commits intoCCExtractor:mainfrom
NihalDR:contribution_v2
Open

option to delete profile#905
NihalDR wants to merge 3 commits intoCCExtractor:mainfrom
NihalDR:contribution_v2

Conversation

@NihalDR
Copy link

@NihalDR NihalDR commented Mar 14, 2026

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

image image

Copilot AI review requested due to automatic review settings March 14, 2026 17:33
@NihalDR NihalDR changed the title contribution v2 option to delete profile Mar 14, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants