Skip to content

Add delete button to edit contacts screen#1

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/add-delete-button-to-edit-contacts
Draft

Add delete button to edit contacts screen#1
Copilot wants to merge 2 commits into
masterfrom
copilot/add-delete-button-to-edit-contacts

Conversation

Copilot AI commented Nov 26, 2025

Copy link
Copy Markdown

Users need to delete contacts directly from the edit screen instead of navigating back to the list view.

Changes

  • Delete button: Added OutlinedButton with error color styling below the save button
  • Confirmation dialog: AlertDialog with localized title/message showing contact name, confirm/cancel actions
  • Navigation: Returns to previous screen after deletion (matches existing save behavior)
// Delete button triggers confirmation dialog
OutlinedButton(
    onClick = { showDeleteDialog = true },
    colors = ButtonDefaults.outlinedButtonColors(contentColor = MaterialTheme.colorScheme.error)
) { Text(stringResource(R.string.common_delete)) }

// Dialog confirms before calling existing ViewModel method
if (showDeleteDialog) {
    AlertDialog(
        title = { Text(stringResource(R.string.contacts_delete_title)) },
        text = { Text(stringResource(R.string.contacts_delete_text, contacto.nombre)) },
        confirmButton = {
            TextButton(onClick = {
                viewModel.onDeleteContacto(context, contacto.id, contacto.fotoUrl)
                navController.popBackStack()
            }) { Text(stringResource(R.string.common_delete)) }
        },
        dismissButton = { TextButton(onClick = { showDeleteDialog = false }) { ... } }
    )
}

Reuses existing onDeleteContacto ViewModel method and localized strings (ES/EN/FR).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.13-bin/5xuhj0ry160q40clulazy9h7d/gradle-8.13/lib/gradle-daemon-main-8.13.jar (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

en editar contactos se deveria añadir un boton para eliminar el contacto

CONVERSATION SUMMARY

TITLE: Add Delete Button to Edit Contacts Feature

USER INTENT: The user wants to add a delete button functionality to the contact editing interface.

TASK DESCRIPTION:
Implement a delete button in the contact editing view/form that allows users to remove a contact while they are editing it. This is a feature enhancement to improve user workflow by allowing contact deletion directly from the edit screen rather than requiring navigation back to a list view.

EXISTING:

  • An edit contacts feature/interface is already implemented
  • Users can currently edit contact information

PENDING:

  • Add a delete button to the edit contacts interface
  • Implement the delete functionality that removes the contact from the system
  • Handle the user flow after deletion (likely redirect to contacts list or previous view)
  • Add confirmation dialog to prevent accidental deletions (recommended best practice)

CODE STATE:
No specific files or code were discussed in this brief conversation. The implementation will likely involve:

  • The edit contacts view/template file
  • The contacts controller or handler for the delete action
  • Possibly routing configuration for the delete endpoint

RELEVANT CODE/DOCUMENTATION SNIPPETS:
None provided in the conversation.

OTHER NOTES:

  • This is a common UX pattern where edit forms include delete functionality
  • Implementation should consider user confirmation before deletion
  • May need to handle edge cases like what happens if deletion fails
  • Should consider success/error messaging after deletion attempt

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: David-LS-Bilbao <221296404+David-LS-Bilbao@users.noreply.github.com>
Copilot AI changed the title [WIP] Add delete button to edit contacts feature Add delete button to edit contacts screen Nov 26, 2025
@David-LS-Bilbao

Copy link
Copy Markdown
Owner

@copilot prueba ahora

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