Conversation
There was a problem hiding this comment.
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
ConfirmModalcom a propconfirmButtonDisabled. - Adiciona a string de label do novo campo de confirmação em
pt-BR,enees.
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. |
| {typebot.publishedTypebotId && ( | ||
| <FormControl> |
There was a problem hiding this comment.
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.
| "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:", |
There was a problem hiding this comment.
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.
| "folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del flow:", | |
| "folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del Flow:", |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| @@ -371,6 +371,7 @@ | |||
| "folders.typebotButton.delete": "Delete", | |||
| "folders.typebotButton.deleteConfirmationMessage": "Are you sure you want to delete your typebot <strong>typebotName</strong>?", | |||
There was a problem hiding this comment.
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".
| "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>?", |
| @@ -371,6 +371,7 @@ | |||
| "folders.typebotButton.delete": "Apagar", | |||
| "folders.typebotButton.deleteConfirmationMessage": "Tem certeza de que deseja excluir seu typebot <strong>typebotName</strong>?", | |||
There was a problem hiding this comment.
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.
| "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>?", |
| @@ -370,6 +370,7 @@ | |||
| "folders.typebotButton.delete": "Eliminar", | |||
| "folders.typebotButton.deleteConfirmationMessage": "¿Estás seguro de que quieres eliminar tu Typebot <strong>typebotName</strong>?", | |||
There was a problem hiding this comment.
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.
| "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>?", |
| } | ||
| confirmButtonLabel={t('delete')} | ||
| confirmButtonDisabled={ | ||
| typebot.publishedTypebotId ? confirmInput !== typebot.name : false |
There was a problem hiding this comment.
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.
| typebot.publishedTypebotId ? confirmInput !== typebot.name : false | |
| typebot.publishedTypebotId | |
| ? confirmInput.trim().toLowerCase() !== typebot.name.trim().toLowerCase() | |
| : false |
| <Input | ||
| value={confirmInput} | ||
| onChange={(e) => setConfirmInput(e.target.value)} | ||
| placeholder={typebot.name} | ||
| /> |
There was a problem hiding this comment.
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).
| } | ||
| confirmButtonLabel={t('delete')} | ||
| confirmButtonDisabled={ | ||
| typebot.publishedTypebotId ? confirmInput !== typebot.name : false |
There was a problem hiding this comment.
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.
| typebot.publishedTypebotId ? confirmInput !== typebot.name : false | |
| typebot.publishedTypebotId | |
| ? confirmInput.trim() !== typebot.name.trim() | |
| : false |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| "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:", |
There was a problem hiding this comment.
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).
| "folders.typebotButton.deleteConfirmationLabel": "Para apagar, escreva o nome do Flow:", | |
| "folders.typebotButton.deleteConfirmationLabel": "Para apagar, escreva o nome do typebot:", |
| {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 | ||
| } |
There was a problem hiding this comment.
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.
| "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:", |
There was a problem hiding this comment.
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).
| "folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del flow:", | |
| "folders.typebotButton.deleteConfirmationLabel": "Para eliminar, escribe el nombre del Typebot:", |
| [31morigin/bloco_de_notas[m | ||
| [31morigin/copilot/sub-pr-148[m | ||
| [31morigin/copilot/sub-pr-148-again[m | ||
| [31morigin/debug-auth-production[m |
There was a problem hiding this comment.
não entendi o que é esse arquivo
Adicionei uma camada de proteção a mais ao tentar excluir fluxos no Typebot. Agora é preciso escrever o nome do fluxo para poder excluir.