Skip to content

feat/delete flow confirmation#162

Open
willamyalves wants to merge 6 commits intomainfrom
feature/delete-flow-confirmation
Open

feat/delete flow confirmation#162
willamyalves wants to merge 6 commits intomainfrom
feature/delete-flow-confirmation

Conversation

@willamyalves
Copy link
Copy Markdown

Adicionei uma camada de proteção a mais ao tentar excluir fluxos no Typebot. Agora é preciso escrever o nome do fluxo para poder excluir.

1 2 3

Copilot AI review requested due to automatic review settings February 13, 2026 20:14
Copy link
Copy Markdown

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

Este PR adiciona uma confirmação extra para exclusão de fluxos no Builder, exigindo que o usuário digite o nome antes de confirmar a remoção.

Changes:

  • Inclui um campo de input no modal de exclusão e desabilita o botão de confirmação até o nome bater.
  • Estende o ConfirmModal com a prop confirmButtonDisabled.
  • Adiciona a string de label do novo campo de confirmação em pt-BR, en e es.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
apps/builder/src/features/folders/components/TypebotButton.tsx Adiciona input de confirmação no modal de delete e controla confirmButtonDisabled com base no texto digitado.
apps/builder/src/components/ConfirmModal.tsx Suporta desabilitar o botão de confirmar via nova prop.
apps/builder/src/i18n/pt-BR.json Nova chave i18n para label do input de confirmação.
apps/builder/src/i18n/en.json Nova chave i18n para label do input de confirmação.
apps/builder/src/i18n/es.json Nova chave i18n para label do input de confirmação.

Comment on lines +234 to +235
{typebot.publishedTypebotId && (
<FormControl>
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

O requisito descrito no PR (“precisa escrever o nome do fluxo para excluir”) parece valer para qualquer exclusão, mas aqui o campo de confirmação só aparece quando typebot.publishedTypebotId existe (fluxos publicados). Se a intenção for proteger todas as exclusões, remova essa condição; se a intenção for apenas para publicados, ajuste o texto/label e a descrição do PR para refletir isso.

Copilot uses AI. Check for mistakes.
"folders.typebotButton.delete": "Eliminar",
"folders.typebotButton.deleteConfirmationMessage": "¿Estás seguro de que quieres eliminar tu Typebot <strong>typebotName</strong>?",
"folders.typebotButton.deleteConfirmationMessageWarning": "Todos sus datos asociados se eliminarán y no se podrán recuperar.",
"folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del flow:",
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

Consistência de cópia: em outras strings do mesmo contexto o termo aparece como "Flow" (ex.: "Crear un Flow"), mas aqui está "flow". Sugestão: padronizar a capitalização do termo no UI.

Suggested change
"folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del flow:",
"folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del Flow:",

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1

@willamyalves willamyalves self-assigned this Feb 25, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 27, 2026 19:02
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

@@ -371,6 +371,7 @@
"folders.typebotButton.delete": "Delete",
"folders.typebotButton.deleteConfirmationMessage": "Are you sure you want to delete your typebot <strong>typebotName</strong>?",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent terminology: The label uses "flow name" but the confirmation message on line 372 refers to "typebot" and the placeholder in the code uses typebot.name. Additionally, line 369 shows "Create a Flow" which suggests "Flow" is the preferred user-facing term. Consider updating line 372's message to also use "flow" instead of "typebot" for consistency, or update this new label to use "typebot name" instead of "flow name".

Suggested change
"folders.typebotButton.deleteConfirmationMessage": "Are you sure you want to delete your typebot <strong>typebotName</strong>?",
"folders.typebotButton.deleteConfirmationMessage": "Are you sure you want to delete your flow <strong>typebotName</strong>?",

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

+1

@@ -371,6 +371,7 @@
"folders.typebotButton.delete": "Apagar",
"folders.typebotButton.deleteConfirmationMessage": "Tem certeza de que deseja excluir seu typebot <strong>typebotName</strong>?",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent terminology: The label uses "flow" but the confirmation message on line 372 refers to "typebot". Line 369 shows "Criar um Flow" which suggests "Flow" is the preferred user-facing term in Portuguese. Consider updating this to maintain consistency throughout the user interface.

Suggested change
"folders.typebotButton.deleteConfirmationMessage": "Tem certeza de que deseja excluir seu typebot <strong>typebotName</strong>?",
"folders.typebotButton.deleteConfirmationMessage": "Tem certeza de que deseja excluir seu Flow <strong>typebotName</strong>?",

Copilot uses AI. Check for mistakes.
@@ -370,6 +370,7 @@
"folders.typebotButton.delete": "Eliminar",
"folders.typebotButton.deleteConfirmationMessage": "¿Estás seguro de que quieres eliminar tu Typebot <strong>typebotName</strong>?",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Inconsistent terminology: The label uses "flow" but the confirmation message on line 371 refers to "Typebot". Line 368 shows "Crear un Flow" which suggests "Flow" is the preferred user-facing term in Spanish. Consider updating this to maintain consistency throughout the user interface.

Suggested change
"folders.typebotButton.deleteConfirmationMessage": "¿Estás seguro de que quieres eliminar tu Typebot <strong>typebotName</strong>?",
"folders.typebotButton.deleteConfirmationMessage": "¿Estás seguro de que quieres eliminar tu flow <strong>typebotName</strong>?",

Copilot uses AI. Check for mistakes.
}
confirmButtonLabel={t('delete')}
confirmButtonDisabled={
typebot.publishedTypebotId ? confirmInput !== typebot.name : false
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Case sensitivity issue: The confirmation logic uses strict equality (confirmInput !== typebot.name) which is case-sensitive. If a user types the name with different casing (e.g., "my flow" instead of "My Flow"), they won't be able to delete the typebot. Consider using case-insensitive comparison (e.g., confirmInput.trim().toLowerCase() !== typebot.name.trim().toLowerCase()) to improve user experience.

Suggested change
typebot.publishedTypebotId ? confirmInput !== typebot.name : false
typebot.publishedTypebotId
? confirmInput.trim().toLowerCase() !== typebot.name.trim().toLowerCase()
: false

Copilot uses AI. Check for mistakes.
Comment on lines +239 to +243
<Input
value={confirmInput}
onChange={(e) => setConfirmInput(e.target.value)}
placeholder={typebot.name}
/>
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

Missing autoFocus attribute: The Input field should have the autoFocus attribute to automatically focus the input when the modal opens. This improves user experience by allowing immediate typing without needing to click the input field first. This pattern is consistently used in other modal inputs throughout the codebase (e.g., CreateToolModal.tsx, VariablesButton.tsx).

Copilot uses AI. Check for mistakes.
}
confirmButtonLabel={t('delete')}
confirmButtonDisabled={
typebot.publishedTypebotId ? confirmInput !== typebot.name : false
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

White space handling: The confirmation logic doesn't trim whitespace from the input. If a user accidentally adds leading or trailing spaces, they won't be able to delete the typebot even if they type the correct name. Consider trimming the input in the comparison (e.g., confirmInput.trim() !== typebot.name.trim()) to handle this common user error.

Suggested change
typebot.publishedTypebotId ? confirmInput !== typebot.name : false
typebot.publishedTypebotId
? confirmInput.trim() !== typebot.name.trim()
: false

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 27, 2026 19:10
Copy link
Copy Markdown

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

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

"folders.typebotButton.delete": "Apagar",
"folders.typebotButton.deleteConfirmationMessage": "Tem certeza de que deseja excluir seu typebot <strong>typebotName</strong>?",
"folders.typebotButton.deleteConfirmationMessageWarning": "Todos os dados associados serão excluídos e não poderão ser recuperados.",
"folders.typebotButton.deleteConfirmationLabel": "Para apagar, escreva o nome do Flow:",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

O texto menciona “Flow”, mas esta ação está no contexto de exclusão de typebot (a mensagem de confirmação imediatamente acima fala em “typebot”). Isso fica inconsistente na UX. Sugestão: padronizar a nomenclatura (usar “typebot” aqui também, ou então trocar a mensagem anterior para “Flow” para manter consistência).

Suggested change
"folders.typebotButton.deleteConfirmationLabel": "Para apagar, escreva o nome do Flow:",
"folders.typebotButton.deleteConfirmationLabel": "Para apagar, escreva o nome do typebot:",

Copilot uses AI. Check for mistakes.
Comment on lines +234 to +251
{typebot.publishedTypebotId && (
<FormControl>
<FormLabel>
{t('folders.typebotButton.deleteConfirmationLabel')}
</FormLabel>
<Input
value={confirmInput}
onChange={(e) => setConfirmInput(e.target.value)}
placeholder={typebot.name}
/>
</FormControl>
)}
</Stack>
}
confirmButtonLabel={t('delete')}
confirmButtonDisabled={
typebot.publishedTypebotId ? confirmInput !== typebot.name : false
}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

A confirmação por digitar o nome está condicionada a typebot.publishedTypebotId (ou seja, typebots não publicados continuam podendo ser excluídos sem essa etapa). Isso parece divergir da descrição do PR (“Agora é preciso escrever o nome do fluxo para poder excluir”). Se a intenção é proteger qualquer exclusão, remova a condição e aplique a validação sempre; caso a intenção seja apenas para publicados, ajuste a descrição/UX para deixar isso explícito.

Copilot uses AI. Check for mistakes.
"folders.typebotButton.delete": "Eliminar",
"folders.typebotButton.deleteConfirmationMessage": "¿Estás seguro de que quieres eliminar tu Typebot <strong>typebotName</strong>?",
"folders.typebotButton.deleteConfirmationMessageWarning": "Todos sus datos asociados se eliminarán y no se podrán recuperar.",
"folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del flow:",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

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

O texto menciona “Flow”, mas esta ação está no contexto de exclusão de typebot (a mensagem de confirmação imediatamente acima fala em “Typebot”). Isso fica inconsistente na UX. Sugestão: padronizar a nomenclatura (usar “Typebot” aqui também, ou então trocar a mensagem anterior para “Flow” para manter consistência).

Suggested change
"folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del flow:",
"folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del Typebot:",

Copilot uses AI. Check for mistakes.
origin/bloco_de_notas
origin/copilot/sub-pr-148
origin/copilot/sub-pr-148-again
origin/debug-auth-production
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

não entendi o que é esse arquivo

Copy link
Copy Markdown

@alexandre-machado alexandre-machado left a comment

Choose a reason for hiding this comment

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

revisar os comentários

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.

5 participants