Skip to content

fix: improve unsaved changes confirmation message#6146

Open
daqige123 wants to merge 1 commit intoFlowiseAI:mainfrom
daqige123:fix/improve-confirm-message
Open

fix: improve unsaved changes confirmation message#6146
daqige123 wants to merge 1 commit intoFlowiseAI:mainfrom
daqige123:fix/improve-confirm-message

Conversation

@daqige123
Copy link
Copy Markdown

Description

Improve the confirmation message for unsaved changes.

Changes

  • Add a clearer default message when no custom message is provided

Why

The previous message may be unclear or inconsistent.
This improves user understanding when navigating away with unsaved changes.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the unsaved changes prompt message across the agent flow and canvas views to a more standard phrasing. The feedback suggests refactoring the usePrompt hook to include this message as a default value, which would eliminate string duplication and improve maintainability.

}, [templateFlowData])

usePrompt('You have unsaved changes! Do you want to navigate away?', canvasDataStore.isDirty)
usePrompt('You have unsaved changes. Are you sure you want to leave this page?', canvasDataStore.isDirty)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The pull request description mentions adding a default message when none is provided, but this implementation hardcodes the same string in multiple components. To improve maintainability and align with the stated objective, consider refactoring the usePrompt hook in packages/ui/src/utils/usePrompt.js to use this string as a default value for the message parameter. This would eliminate the need to repeat the string here and in packages/ui/src/views/canvas/index.jsx.

}, [templateFlowData])

usePrompt('You have unsaved changes! Do you want to navigate away?', canvasDataStore.isDirty)
usePrompt('You have unsaved changes. Are you sure you want to leave this page?', canvasDataStore.isDirty)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

This string is identical to the one used in packages/ui/src/views/agentflowsv2/Canvas.jsx. To avoid duplication and follow the "default message" approach mentioned in the PR description, it would be better to define this string as a default value within the usePrompt hook itself rather than hardcoding it at every call site.

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.

1 participant