-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore clarifying that remote repository has uncommitted changes on entry and exit #115
Comments
This comment was marked as outdated.
This comment was marked as outdated.
@bpasero do you have any recommendations for how RemoteHub can reliably display a dialog when the user is about to navigate away from a repo with uncommitted changes? Based on @sandy081's suggestion at UX sync yesterday, I looked into whether we can display a warning before the user leaves a page containing uncommitted changes. Something like this in vscode.dev when the user navigates away, so that uncommitted changes are not abandoned: Implementation above is done by registering a command in RemoteHub to display a prompt when there are uncommitted changes, and then including it as a command to run before page unload using the embedder's const onWillDisposeWorkbench: IPreWorkbenchDisposalActions = {
runCommands: [{ command: 'remoteHub.uncommittedChangesPrompt', args: [] }],
}; Sadly it seems like we are limited by the browser's APIs here: https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event This approach would result in us displaying two dialogs--one from RemoteHub with a detailed message about uncommitted changes, and one generic one from the browser with a non-configurable message that contradicts what the RemoteHub dialog says. :( In addition it seems that
|
@joyceerhl in short: there is absolutely nothing we can do:
In long: MicrosoftEdge/MSEdgeExplainers#147 |
To give a bit more context: VSCode allows participants to participate in the shutdown phase (via
When we ported VSCode to the web we had to drop all of that and limit it to a single veto from the A few examples:
To mitigate some of it, UI state is written to IndexedDB every 10 seconds (I know, ugly) to make sure that any accumulated UI state is not lost when leaving the app. The answer from browser vendors so far has been to either:
|
Yeah, this is unfortunate but it makes sense, and thank you for the context. Until this behavior changes, it seems that it's not feasible for RemoteHub to clarify what happens to uncommitted changes on exit. In that case I think it's viable to pursue clarifying that there are uncommitted changes which prevent us from syncing with the remote. The proposal here is a dialog shown on entering a repo which is outdated, controlled by a setting I also briefly explored nudging the user to commit often, and clarifying that uncommitted changes are stored locally until the user commits since we've gotten feedback that it's unclear where edits go. The prototype I showed of this is a setting |
After selfhosting the uncommitted changes prompt without issues since last Friday, I've pushed a change to enable it in tonight's pre-release RemoteHub (therefore also insiders.vscode.dev). I added a Don't Show Again action to the dialog so that users can easily disable it if they don't find it helpful. Feedback is very welcome. |
Closing this out as the modal dialog is now enabled in pre-releases by default and I've tweaked it based on feedback from the team. |
Problem
User may or may not notice that there are uncommitted changes and may or may not know that uncommitted changes prevent syncing with the remote.
Ideas
onWillDisposeWorkbench.runCommands
) that displays a custom modal (Ben or Deepak may know more). We already do a blocking native dialog when the user does Ctrl+W (which normally closes the active editor but in web closes the tab). At minimum the dialog we display here must have a Don't Show Again optionThe text was updated successfully, but these errors were encountered: