feat(ui): add workspace init confirmation before syncing#2822
Merged
tusharmath merged 2 commits intomainfrom Apr 3, 2026
Merged
feat(ui): add workspace init confirmation before syncing#2822tusharmath merged 2 commits intomainfrom
tusharmath merged 2 commits intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add an explicit user consent prompt before syncing a workspace directory, preventing unintended data sharing with ForgeCode Services.
Context
Previously, invoking a sync on an uninitialized directory would immediately begin syncing and sharing its contents with ForgeCode Services without any user acknowledgment. This is a privacy-sensitive operation and users should be given a clear opportunity to accept or decline before the sync proceeds.
Changes
on_workspace_initthat informs users their directory contents will be synced and shared with ForgeCode Services, withyesas the default answer.on_workspace_init, the workspace is re-checked and if it still does not exist (because the user declined), the sync is aborted early rather than proceeding with stale state.Key Implementation Details
The confirmation uses
ForgeWidget::confirmwithwith_default(true), so pressing Enter accepts by default. Theunwrap_or(false)on the result ensures any prompt failure safely cancels the operation. The guard added at the call-site afteron_workspace_initkeeps the sync path honest — it does not assume initialization succeeded.Testing