Przeglądaj źródła

Removes outdated updates view

main
Eric Amodio 3 lat temu
rodzic
commit
406f17ed22
5 zmienionych plików z 3 dodań i 73 usunięć
  1. +0
    -45
      package.json
  2. +1
    -5
      src/commands/closeView.ts
  3. +0
    -1
      src/commands/common.ts
  4. +0
    -2
      src/constants.ts
  5. +2
    -20
      src/extension.ts

+ 0
- 45
package.json Wyświetl plik

@ -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",
@ -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",
@ -3141,12 +3139,6 @@
"category": "GitLens"
},
{
"command": "gitlens.closeUpdatesView",
"title": "Close",
"category": "GitLens",
"icon": "$(close)"
},
{
"command": "gitlens.closeWelcomeView",
"title": "Close",
"category": "GitLens",
@ -5234,10 +5226,6 @@
"when": "gitlens:enabled"
},
{
"command": "gitlens.closeUpdatesView",
"when": "false"
},
{
"command": "gitlens.closeWelcomeView",
"when": "false"
},
@ -6934,11 +6922,6 @@
],
"view/title": [
{
"command": "gitlens.closeUpdatesView",
"when": "view == gitlens.views.updates",
"group": "navigation@1"
},
{
"command": "gitlens.closeWelcomeView",
"when": "view == gitlens.views.welcome",
"group": "navigation@1"
@ -9541,26 +9524,6 @@
"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)"
},
@ -9572,14 +9535,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",
"when": "gitlens:views:welcome:visible != false",

+ 1
- 5
src/commands/closeView.ts Wyświetl plik

@ -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) {
@ -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;
}
}
}

+ 0
- 1
src/commands/common.ts Wyświetl plik

@ -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',

+ 0
- 2
src/constants.ts Wyświetl plik

@ -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',
}
@ -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',

+ 2
- 20
src/extension.ts Wyświetl plik

@ -87,31 +87,18 @@ export async function activate(context: ExtensionContext): Promise
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);
@ -210,12 +197,7 @@ export async function setEnabled(enabled: boolean): Promise {
}
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) {

Ładowanie…
Anuluj
Zapisz