Skip to content

Commit

Permalink
Removes outdated updates view
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Oct 4, 2021
1 parent 842fd7f commit 406f17e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 73 deletions.
45 changes: 0 additions & 45 deletions package.json
Expand Up @@ -48,7 +48,6 @@
"activationEvents": [
"onCustomEditor:gitlens.rebase",
"onFileSystem:gitlens",
"onView:gitlens.views.updates",
"onView:gitlens.views.repositories",
"onView:gitlens.views.commits",
"onView:gitlens.views.fileHistory",
Expand Down Expand Up @@ -84,7 +83,6 @@
"onCommand:gitlens.showStashesView",
"onCommand:gitlens.showTagsView",
"onCommand:gitlens.showWelcomeView",
"onCommand:gitlens.closeUpdatesView",
"onCommand:gitlens.closeWelcomeView",
"onCommand:gitlens.compareWith",
"onCommand:gitlens.compareHeadWith",
Expand Down Expand Up @@ -3140,12 +3138,6 @@
"title": "Show Welcome View",
"category": "GitLens"
},
{
"command": "gitlens.closeUpdatesView",
"title": "Close",
"category": "GitLens",
"icon": "$(close)"
},
{
"command": "gitlens.closeWelcomeView",
"title": "Close",
Expand Down Expand Up @@ -5233,10 +5225,6 @@
"command": "gitlens.showWelcomeView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.closeUpdatesView",
"when": "false"
},
{
"command": "gitlens.closeWelcomeView",
"when": "false"
Expand Down Expand Up @@ -6933,11 +6921,6 @@
}
],
"view/title": [
{
"command": "gitlens.closeUpdatesView",
"when": "view == gitlens.views.updates",
"group": "navigation@1"
},
{
"command": "gitlens.closeWelcomeView",
"when": "view == gitlens.views.welcome",
Expand Down Expand Up @@ -9540,26 +9523,6 @@
"view": "gitlens.views.welcome",
"contents": "[Close](command:gitlens.closeWelcomeView \"Closes the Welcome view\")"
},
{
"view": "gitlens.views.updates",
"contents": "[GitLens views](command:gitlens.showSettingsPage%23views) have moved to the Source Control side bar.\nRun [GitLens: Set Views Layout](command:gitlens.setViewsLayout \"Changes the GitLens Views Layout\") from the Command Palette to switch to an alternate side bar layout, or drag & drop them."
},
{
"view": "gitlens.views.updates",
"contents": "★ [Repositories](command:gitlens.showSettingsPage%23repositories-view) — replaced by [Commits](command:gitlens.showSettingsPage%23commits-view), [Branches](command:gitlens.showSettingsPage%23branches-view), [Remotes](command:gitlens.showSettingsPage%23remotes-view), [Stashes](command:gitlens.showSettingsPage%23stashes-view), [Tags](command:gitlens.showSettingsPage%23tags-view), and [Contributors](command:gitlens.showSettingsPage%23contributors-view) views. If you want it back, [click here](command:gitlens.showRepositoriesView)."
},
{
"view": "gitlens.views.updates",
"contents": "★ [File History](command:gitlens.showSettingsPage%23file-history-view) — combines file and line history into a single view"
},
{
"view": "gitlens.views.updates",
"contents": "★ [Search & Compare](command:gitlens.showSettingsPage%23search-compare-view) — combines Search Commits and Compare Commits into a single view"
},
{
"view": "gitlens.views.updates",
"contents": "[Close](command:gitlens.closeUpdatesView)"
},
{
"view": "gitlens.views.searchAndCompare",
"contents": "Search for commits by [message](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22pattern%22%3A%22message%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [author](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22pattern%22%3A%22author%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [SHA](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22pattern%22%3A%22commit%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), [file](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22pattern%22%3A%22file%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D), or [changes](command:gitlens.views.searchAndCompare.searchCommits?%7B%22search%22%3A%7B%22pattern%22%3A%22change%3A%22%7D%2C%22prefillOnly%22%3Atrue%7D)\n\n[Search Commits...](command:gitlens.views.searchAndCompare.searchCommits)"
Expand All @@ -9571,14 +9534,6 @@
],
"views": {
"gitlens": [
{
"id": "gitlens.views.updates",
"name": "Where did my views go?",
"when": "gitlens:views:updates:visible != false",
"contextualTitle": "GitLens",
"icon": "images/gitlens-activitybar.svg",
"visibility": "visible"
},
{
"id": "gitlens.views.welcome",
"name": "Welcome",
Expand Down
6 changes: 1 addition & 5 deletions src/commands/closeView.ts
Expand Up @@ -6,7 +6,7 @@ import { command, Command, CommandContext, Commands } from './common';
@command()
export class CloseViewCommand extends Command {
constructor() {
super([Commands.CloseWelcomeView, Commands.CloseUpdatesView]);
super([Commands.CloseWelcomeView]);
}

protected override preExecute(context: CommandContext) {
Expand All @@ -19,10 +19,6 @@ export class CloseViewCommand extends Command {
await Container.context.globalState.update(SyncedState.WelcomeViewVisible, false);
await setContext(ContextKeys.ViewsWelcomeVisible, false);
break;
case Commands.CloseUpdatesView:
await Container.context.globalState.update(SyncedState.UpdatesViewVisible, false);
await setContext(ContextKeys.ViewsUpdatesVisible, false);
break;
}
}
}
1 change: 0 additions & 1 deletion src/commands/common.ts
Expand Up @@ -34,7 +34,6 @@ export enum Commands {
BrowseRepoBeforeRevisionInNewWindow = 'gitlens.browseRepoBeforeRevisionInNewWindow',
ClearFileAnnotations = 'gitlens.clearFileAnnotations',
CloseUnchangedFiles = 'gitlens.closeUnchangedFiles',
CloseUpdatesView = 'gitlens.closeUpdatesView',
CloseWelcomeView = 'gitlens.closeWelcomeView',
CompareWith = 'gitlens.compareWith',
CompareHeadWith = 'gitlens.compareHeadWith',
Expand Down
2 changes: 0 additions & 2 deletions src/constants.ts
Expand Up @@ -63,7 +63,6 @@ export enum ContextKeys {
ViewsLineHistoryEditorFollowing = 'gitlens:views:lineHistory:editorFollowing',
ViewsRepositoriesAutoRefresh = 'gitlens:views:repositories:autoRefresh',
ViewsSearchAndCompareKeepResults = 'gitlens:views:searchAndCompare:keepResults',
ViewsUpdatesVisible = 'gitlens:views:updates:visible',
ViewsWelcomeVisible = 'gitlens:views:welcome:visible',
Vsls = 'gitlens:vsls',
}
Expand Down Expand Up @@ -167,7 +166,6 @@ export const enum GlyphChars {
}

export enum SyncedState {
UpdatesViewVisible = 'gitlens:views:updates:visible',
Version = 'gitlens:synced:version',
WelcomeViewVisible = 'gitlens:views:welcome:visible',

Expand Down
22 changes: 2 additions & 20 deletions src/extension.ts
Expand Up @@ -87,31 +87,18 @@ export async function activate(context: ExtensionContext): Promise<GitLensApi |
Logger.debug(
`GitLens (v${gitlensVersion}): syncedVersion=${syncedVersion}, localVersion=${localVersion}, previousVersion=${previousVersion}, ${
SyncedState.WelcomeViewVisible
}=${context.globalState.get<boolean>(SyncedState.WelcomeViewVisible)}, ${
SyncedState.UpdatesViewVisible
}=${context.globalState.get<boolean>(SyncedState.UpdatesViewVisible)}`,
}=${context.globalState.get<boolean>(SyncedState.WelcomeViewVisible)}`,
);
}

if (previousVersion == null) {
void context.globalState.update(SyncedState.WelcomeViewVisible, true);
void setContext(ContextKeys.ViewsWelcomeVisible, true);
void context.globalState.update(SyncedState.UpdatesViewVisible, false);
void setContext(ContextKeys.ViewsUpdatesVisible, false);
} else {
// Force Updates welcome view, since for some reason it never showed for many users
if (Versions.compare(previousVersion, Versions.from(11, 0, 5)) !== 1) {
await context.globalState.update(SyncedState.UpdatesViewVisible, true);
}

void setContext(
ContextKeys.ViewsWelcomeVisible,
context.globalState.get<boolean>(SyncedState.WelcomeViewVisible) ?? false,
);
void setContext(
ContextKeys.ViewsUpdatesVisible,
context.globalState.get<boolean>(SyncedState.UpdatesViewVisible) !== false,
);
}

const enabled = workspace.getConfiguration('git', null).get<boolean>('enabled', true);
Expand Down Expand Up @@ -210,12 +197,7 @@ export async function setEnabled(enabled: boolean): Promise<void> {
}

export function setKeysForSync(...keys: (SyncedState | string)[]) {
return _context?.globalState.setKeysForSync([
...keys,
SyncedState.UpdatesViewVisible,
SyncedState.Version,
SyncedState.WelcomeViewVisible,
]);
return _context?.globalState.setKeysForSync([...keys, SyncedState.Version, SyncedState.WelcomeViewVisible]);
}

export function notifyOnUnsupportedGitVersion(version: string) {
Expand Down

0 comments on commit 406f17e

Please sign in to comment.