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

[explorer]: Badge count for dirty editors #8316

Merged
merged 1 commit into from
Aug 10, 2020

Conversation

Anasshahidd21
Copy link
Contributor

What it does

Fixes: #8296

Adds a badge count for dirty editors on the explorer tab icon.

012

Signed-off-by: Anas Shahid muhammad.shahid@ericsson.com

How to test

  1. Open an editor, make changes and don't save - make sure autosave is off
  2. check the explorer icon if the badge count for dirty editor is increased
  3. Undo the changes or save them, the count should decrease
  4. Test with multiple dirty editors, using steps 1-3.

Review checklist

Reminder for reviewers

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes work correctly:

  • the number of dirty editors is correctly displayed
  • the number of dirty editors are updated when the dirty state is changed, editors are closed
  • the display works with autoSave on with a delay

I understand that NavigatorTabBarDecorator had to implement FrontendApplicationContribution since ApplicationShell could not be injected and used.

@vince-fugnitto vince-fugnitto added badge issues related to badge decorations navigator issues related to the navigator/explorer labels Aug 5, 2020
@Anasshahidd21 Anasshahidd21 force-pushed the dirtyEditors branch 3 times, most recently from 19b7f5a to f20602b Compare August 7, 2020 20:10

protected readonly emitter = new Emitter<void>();
private readonly toDispose = new DisposableCollection();
private readonly toDisposeOnDirtyChanged = new Map<Widget, Disposable>();
Copy link
Member

Choose a reason for hiding this comment

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

please don't hold a reference to a widget, but its id

Fixes: eclipse-theia#8296

Adds a badge count for dirty editors on the explorer tab icon.

Signed-off-by: Anas Shahid <muhammad.shahid@ericsson.com>
Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

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

code-wise looks good to me

@akosyakov
Copy link
Member

@vince-fugnitto could you test and merge please?

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I verified the latest changes and they work well, I'll merge.

@vince-fugnitto vince-fugnitto merged commit 1f795e4 into eclipse-theia:master Aug 10, 2020
@vince-fugnitto vince-fugnitto deleted the dirtyEditors branch August 10, 2020 16:34
@kittaakos
Copy link
Contributor

@Anasshahidd21, how can I disable this feature without code modifications? Is there a preference for this?

@Anasshahidd21
Copy link
Contributor Author

@Anasshahidd21, how can I disable this feature without code modifications? Is there a preference for this?

@kittaakos, in the current state of main, it is only possible to disable this feature with code modifications and not by any preference.

@kittaakos
Copy link
Contributor

Thank you! Here is the follow-up: #8709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
badge issues related to badge decorations navigator issues related to the navigator/explorer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explorer]: Badge count for dirty editors
4 participants