Skip to content

Add confirmation dialogs for removal operations in CardAreaComum - #1

Draft
Davi0fc with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-cardareacomum-items
Draft

Add confirmation dialogs for removal operations in CardAreaComum#1
Davi0fc with Copilot wants to merge 2 commits into
mainfrom
copilot/remove-cardareacomum-items

Conversation

Copilot AI commented Nov 6, 2025

Copy link
Copy Markdown

Adds user confirmation prompts before deleting environments and items in CardAreaComum to prevent accidental data loss.

Changes

  • removerAmbiente: Wraps deletion in window.confirm() with "Tem certeza que deseja remover este ambiente?"
  • removerLinha: Wraps deletion in window.confirm() with "Tem certeza que deseja remover este item?"
const removerAmbiente = (idx) => {
  if (window.confirm('Tem certeza que deseja remover este ambiente?')) {
    setAmbientes(ambientes.filter((_, i) => i !== idx))
  }
}

const removerLinha = (idxAmb, idxLinha) => {
  if (window.confirm('Tem certeza que deseja remover este item?')) {
    const novos = [...ambientes]
    novos[idxAmb].items.splice(idxLinha, 1)
    setAmbientes(novos)
  }
}
Original prompt

Agora siga a mesma lógica e faça a confirmação de remoção para os ambientes e itens do CardAreaComum


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

Co-authored-by: Davi0fc <238536592+Davi0fc@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove confirmation for CardAreaComum items and environments Add confirmation dialogs for removal operations in CardAreaComum Nov 6, 2025
Copilot AI requested a review from Davi0fc November 6, 2025 19:11
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