Skip to content
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

Allow scrapbook untitled working copies #174485

Closed
amunger opened this issue Feb 15, 2023 · 7 comments
Closed

Allow scrapbook untitled working copies #174485

amunger opened this issue Feb 15, 2023 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan workbench-editors Managing of editor widgets in workbench window workbench-untitled-editors Managing of untitled editors in workbench window
Milestone

Comments

@amunger
Copy link
Contributor

amunger commented Feb 15, 2023

required for #172974

We would like a IFileWorkingCopy implementation that is related to UntitledFileWorkingCopy as in, there is no file on disk backing the model so it wouldn't auto-save and would be recovered from a hot exit, but can more easily be discarded without prompting to save.

  • If a user closes a window without onExitAndWindowClose hot exit enabled, the user would not be prompted to save
  • The dirty indicator would not show for that file type
@amunger amunger added the feature-request Request for new features or functionality label Feb 15, 2023
@bpasero bpasero added the workbench-editors Managing of editor widgets in workbench window label Feb 15, 2023
@bpasero bpasero added this to the On Deck milestone Feb 15, 2023
@bpasero
Copy link
Member

bpasero commented Mar 8, 2023

@amunger I am trying to understand the requirements for such a change and maybe notebook team could help out. I see that backups are really tied to dirty state tracking, meaning that if a working copy does not report it is dirty, we do not create any backups. My hope would be to do a minimal change that does not disrupt how we manage backups...

So I am wondering if we can keep the dirty state of the working copy as it is today so that backups work, but see for certain UI locations where we show a dirty indicator today to hide it based on a new WorkingCopyCapability. We can expand on that strategy that to also hide any dialogs that would appear today when hot exit is off.

However, I miss a little bit the greater picture here for where else scrapbook working copies would have to alter its behaviour.

For my testing, I am running the command "New GitHub Issue Notebook" which normally opens an editor dirty, but with a few tweaks shows like a scrapbook. Contents restore after window reload too:

image

Dirty State in Editor
Changing this line to return false should remove the dirty indicator in the editor tab:

Dirty State for Working Copies
Changing this method to do an early return should remove the global dirty indicator:

private onWorkingCopyDidChangeDirty(workingCopy: IWorkingCopy): void {

☝️ above are just hacks for now, but once we found all locations we can productise this further by checking for the working copy capability

@bpasero bpasero changed the title create a "scrapbook working copy" implementation of the IFileWorkingCopy Allow scrapbook untitled working copies Mar 24, 2023
@bpasero
Copy link
Member

bpasero commented Mar 24, 2023

Ping

@bpasero bpasero added the workbench-untitled-editors Managing of untitled editors in workbench window label Mar 24, 2023
@amunger
Copy link
Contributor Author

amunger commented Mar 24, 2023

Sorry - I read through your comment too fast the first time and missed the ask.

Playing around with those two hacks seems to provide the behavior we're looking for except for the case of exiting with hotexit=off/onExit - Ideally we would not prompt to save the file in that case.

@amunger
Copy link
Contributor Author

amunger commented May 26, 2023

could probably verify with #183310

@amunger amunger added the verification-needed Verification of issue is requested label May 26, 2023
@bpasero
Copy link
Member

bpasero commented May 26, 2023

I will not push those changes for May though, there are still some UX concerns.

@amunger
Copy link
Contributor Author

amunger commented May 26, 2023

I figured that was the case, but still probably the best way to verify - checking that out and running locally. Or you could mark verified if you're comfortable with that.

@bpasero bpasero modified the milestones: May 2023, June 2023 May 26, 2023
@bpasero
Copy link
Member

bpasero commented May 26, 2023

I think we can move this to June and have it verified then, either with notebooks or my work 👍

@amunger amunger removed the verification-needed Verification of issue is requested label Jun 27, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan workbench-editors Managing of editor widgets in workbench window workbench-untitled-editors Managing of untitled editors in workbench window
Projects
None yet
Development

No branches or pull requests

2 participants