Skip to content

Add confirmation dialog before creating a new project on Planet#5909

Open
anshukaushik4700 wants to merge 2 commits intosugarlabs:masterfrom
anshukaushik4700:adding_confirm_on_newprpoject
Open

Add confirmation dialog before creating a new project on Planet#5909
anshukaushik4700 wants to merge 2 commits intosugarlabs:masterfrom
anshukaushik4700:adding_confirm_on_newprpoject

Conversation

@anshukaushik4700
Copy link
Contributor

Description

This PR adds a confirmation dialog before resetting the current project when the "New Project" option is selected on Planet.
Previously, clicking "New Project" would immediately clear the workspace without any warning. This could result in accidental data loss if the user had unsaved work.

Previous Behavior

  • Clicking "New Project" instantly resets the workspace.
  • No confirmation or warning is shown.
  • Unsaved user work can be lost unintentionally.

Current Behavior

  • When the user clicks "New Project", a confirmation dialog should appear.
  • The workspace should only reset if the user confirms the action.
  • If the user cancels, the current project should remain unchanged.

Video

Music.Blocks.-.Google.Chrome.2026-02-26.03-39-36.mp4

Changes Made

  • Added a confirmation prompt before triggering workspace reset.
  • Ensured the reset action only executes upon user confirmation.
  • Preserved existing behavior if confirmation is accepted.

Why This Change Is Important

This improves user experience and prevents accidental data loss, especially for younger users who may click options unintentionally.

Fixes #5908

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

Copy link
Contributor

@7se7en72025 7se7en72025 left a comment

Choose a reason for hiding this comment

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

Image

LGTM @walterbender .
Confirmed locally that the new confirmation dialog correctly intercepts the reset action, providing a clear warning that prevents accidental data loss in the Planet view.

@anshukaushik4700
Copy link
Contributor Author

Hello @walterbender @omsuneri @vanshika2720, I’d appreciate it if you could review this PR at your convenience. Thank you!

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.

[UI/UX] New Project in Planet resets current project without confirmation (risk of data loss)

2 participants