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

Show 'File saved' not Cell Metadata Updated #208053

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

DonJayamanne
Copy link
Contributor

@DonJayamanne DonJayamanne commented Mar 19, 2024

For #207968

Work around for better Notebook Timeline entries
In notebooks when adding a cell, we (built in ipynb serializer extension) performs additional edits as a side effect of adding a cell

  • As a result, we do not see the Insert Cell in Timeline as the last edit operations is Update Cell Metadata
  • As Cell Metadata Updated is not a user friendly operation we would prefer to replace this label in favour of File Saved (as is done today for Text Buffer edits)

Looking at how this is done for text editor, we need to ensure the code === 'undoredo.textBufferEdit'

@bpasero
Wanted to check if this simple work around is sufficient, or whether we should come up with a different strategy.

We want notebook edit operations to end up in the line return undefined, thats the code path that leads to File Saved in the timeline view.

	private resolveSourceFromUndoRedo(e: IWorkingCopySaveEvent): SaveSource | undefined {
		const lastStackElement = this.undoRedoService.getLastElement(e.workingCopy.resource);
		if (lastStackElement) {
			if (lastStackElement.code === 'undoredo.textBufferEdit') {
				return undefined; // ignore any unspecific stack element that resulted just from typing
			}

@DonJayamanne DonJayamanne marked this pull request as ready for review March 19, 2024 06:44
@DonJayamanne DonJayamanne merged commit 690a5a8 into main Mar 19, 2024
7 checks passed
@DonJayamanne DonJayamanne deleted the issue207968FileSavedInsteadOfUpdateCellMetadata branch March 19, 2024 06:45
@vscodenpa vscodenpa added this to the March 2024 milestone Mar 19, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants