2022-10-04 20:01:54 +03:00
diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts
2024-07-08 18:17:26 +03:00
index c581ac0..f11c0f0 100644
2022-10-04 20:01:54 +03:00
--- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts
+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts
2024-07-08 18:17:26 +03:00
@@ -319,2 +319,8 @@ configurationRegistry.registerConfiguration({
2022-10-04 20:01:54 +03:00
},
+ 'workbench.welcomePage.extraAnnouncements': {
+ scope: ConfigurationScope.MACHINE,
+ type: 'boolean',
+ default: true,
+ description: localize('workbench.welcomePage.extraAnnouncements', "When enabled, the get started page loads additional announcements from VSCodium's repository.")
+ },
'workbench.startupEditor': {
diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
2024-07-08 18:17:26 +03:00
index 664c55b..43f9e2e 100644
2022-10-04 20:01:54 +03:00
--- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
+++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts
2024-07-08 18:17:26 +03:00
@@ -113,4 +113,8 @@ type GettingStartedActionEvent = {
2022-10-04 20:01:54 +03:00
type RecentEntry = (IRecentFolder | IRecentWorkspace) & { id: string };
+type AnnouncementEntry = { id: string, title: string, url: string };
const REDUCED_MOTION_KEY = 'workbench.welcomePage.preferReducedMotion';
+
+const BUILTIN_ANNOUNCEMENTS: AnnouncementEntry[] = [/* BUILTIN_ANNOUNCEMENTS */];
+
export class GettingStartedPage extends EditorPane {
2024-07-08 18:17:26 +03:00
@@ -149,2 +153,4 @@ export class GettingStartedPage extends EditorPane {
2022-10-04 20:01:54 +03:00
private gettingStartedList?: GettingStartedIndexList<IResolvedWalkthrough>;
+ private announcementList?: GettingStartedIndexList<AnnouncementEntry>;
+ private announcementData?: AnnouncementEntry[];
2024-07-08 18:17:26 +03:00
@@ -812,2 +818,3 @@ export class GettingStartedPage extends EditorPane {
2022-10-04 20:01:54 +03:00
const gettingStartedList = this.buildGettingStartedWalkthroughsList();
+ const announcementList = await this.buildAnnouncementList();
2024-07-08 18:17:26 +03:00
@@ -822,3 +829,3 @@ export class GettingStartedPage extends EditorPane {
this.container.classList.remove('noWalkthroughs');
- reset(rightColumn, gettingStartedList.getDomElement());
+ reset(rightColumn, gettingStartedList.getDomElement(), announcementList.getDomElement());
}
@@ -826,3 +833,3 @@ export class GettingStartedPage extends EditorPane {
this.container.classList.add('noWalkthroughs');
- reset(rightColumn);
+ reset(rightColumn, announcementList.getDomElement());
}
@@ -978,2 +985,55 @@ export class GettingStartedPage extends EditorPane {
2022-10-04 20:01:54 +03:00
+ private async buildAnnouncementList(): Promise<GettingStartedIndexList<AnnouncementEntry>> {
+ const renderAnnouncement = (announcement: AnnouncementEntry) => {
+ const { title, url } = announcement;
+ const li = $('li');
+
+ const anchor: HTMLLinkElement = $('a');
+ anchor.href = url;
+ anchor.innerText = title;
+ anchor.target = '_blank';
+ li.appendChild(anchor);
+
+ return li;
+ };
+
+ if (this.announcementList) { this.announcementList.dispose(); }
+
+ const announcementList = this.announcementList = new GettingStartedIndexList({
+ title: localize('announcements', "VSCodium Announcements"),
+ klass: 'announcements',
+ limit: 5,
+ empty: $('.empty-recent', {}, localize('noAnnouncements', "There are no current announcements.")),
+ renderElement: renderAnnouncement,
+ contextService: this.contextService
+ });
+
+ if (!this.announcementData) {
+ const showExtras = this.configurationService.getValue<boolean>('workbench.welcomePage.extraAnnouncements');
+
+ if (showExtras) {
+ const branch = this.productService.quality === 'insider' ? 'insider' : 'master';
2023-04-26 01:58:13 +03:00
+ await fetch(`https://raw.githubusercontent.com/VSCodium/vscodium/${branch}/announcements-extra.json`)
+ .then(async res => {
+ if (res.ok) {
+ var extraAnnouncements = await res.json() as AnnouncementEntry[];
2022-10-04 20:01:54 +03:00
+
2023-04-26 01:58:13 +03:00
+ this.announcementData = [...extraAnnouncements, ...BUILTIN_ANNOUNCEMENTS];
+ } else {
+ this.announcementData = BUILTIN_ANNOUNCEMENTS;
+ }
+ })
+ .catch(err => {
+ this.announcementData = BUILTIN_ANNOUNCEMENTS;
+ });
2022-10-04 20:01:54 +03:00
+ } else {
+ this.announcementData = BUILTIN_ANNOUNCEMENTS;
+ }
+ }
+
+ announcementList.setEntries(this.announcementData);
+
+ return announcementList;
+ }
+
private buildStartList(): GettingStartedIndexList<IWelcomePageStartEntry> {