@@ -15,7 +15,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
15
15
import { hiddenEntriesConfigurationKey , IGettingStartedCategory , IGettingStartedCategoryWithProgress , IGettingStartedService } from 'vs/workbench/contrib/welcome/gettingStarted/browser/gettingStartedService' ;
16
16
import { IThemeService , registerThemingParticipant , ThemeIcon } from 'vs/platform/theme/common/themeService' ;
17
17
import { welcomePageBackground , welcomePageProgressBackground , welcomePageProgressForeground , welcomePageTileBackground , welcomePageTileHoverBackground , welcomePageTileShadow } from 'vs/workbench/contrib/welcome/page/browser/welcomePageColors' ;
18
- import { activeContrastBorder , buttonBackground , buttonForeground , buttonHoverBackground , contrastBorder , descriptionForeground , focusBorder , foreground , textLinkActiveForeground , textLinkForeground } from 'vs/platform/theme/common/colorRegistry' ;
18
+ import { activeContrastBorder , badgeBackground , buttonBackground , buttonForeground , buttonHoverBackground , contrastBorder , descriptionForeground , focusBorder , foreground , textLinkActiveForeground , textLinkForeground } from 'vs/platform/theme/common/colorRegistry' ;
19
19
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
20
20
import { firstSessionDateStorageKey , ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
21
21
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement' ;
@@ -61,6 +61,7 @@ import { Schemas } from 'vs/base/common/network';
61
61
import { IEditorOptions } from 'vs/platform/editor/common/editor' ;
62
62
import { coalesce , flatten } from 'vs/base/common/arrays' ;
63
63
import { ThemeSettings } from 'vs/workbench/services/themes/common/workbenchThemeService' ;
64
+ import { ACTIVITY_BAR_BADGE_FOREGROUND } from 'vs/workbench/common/theme' ;
64
65
65
66
const SLIDE_TRANSITION_TIME_MS = 250 ;
66
67
const configurationKey = 'workbench.startupEditor' ;
@@ -107,7 +108,7 @@ export class GettingStartedPage extends EditorPane {
107
108
private hasScrolledToFirstCategory = false ;
108
109
private recentlyOpenedList ?: GettingStartedIndexList < IRecentFolder | IRecentWorkspace > ;
109
110
private startList ?: GettingStartedIndexList < IGettingStartedCategory > ;
110
- private gettingStartedList ?: GettingStartedIndexList < IGettingStartedCategory > ;
111
+ private gettingStartedList ?: GettingStartedIndexList < IGettingStartedCategoryWithProgress > ;
111
112
112
113
private stepsSlide ! : HTMLElement ;
113
114
private categoriesSlide ! : HTMLElement ;
@@ -906,39 +907,58 @@ export class GettingStartedPage extends EditorPane {
906
907
return startList ;
907
908
}
908
909
909
- private buildGettingStartedWalkthroughsList ( ) : GettingStartedIndexList < IGettingStartedCategory > {
910
+ private buildGettingStartedWalkthroughsList ( ) : GettingStartedIndexList < IGettingStartedCategoryWithProgress > {
910
911
911
- const renderGetttingStaredWalkthrough = ( category : IGettingStartedCategory ) => {
912
+ const renderGetttingStaredWalkthrough = ( category : IGettingStartedCategoryWithProgress ) => {
912
913
const hiddenCategories = this . getHiddenCategories ( ) ;
913
914
914
915
if ( category . content . type !== 'steps' || hiddenCategories . has ( category . id ) ) {
915
916
return undefined ;
916
917
}
917
918
918
- return $ ( 'button.getting-started-category' ,
919
+ const newBadge = $ ( '.new-badge' , { } ) ;
920
+ if ( category . content . accolades === 'newCategory' ) {
921
+ reset ( newBadge , $ ( '.new-category' , { } , localize ( 'new' , "New" ) ) ) ;
922
+ } else if ( category . content . accolades === 'newContent' ) {
923
+ reset ( newBadge , $ ( '.new-items' , { } , localize ( 'newItems' , "New Items" ) ) ) ;
924
+ }
925
+
926
+ const featuredBadge = $ ( '.featured-badge' , { } ) ;
927
+ const descriptionContent = $ ( '.description-content' , { } , ) ;
928
+
929
+ if ( category . content . accolades === 'featured' ) {
930
+ reset ( featuredBadge , $ ( '.featured' , { } , $ ( 'span.featured-icon.codicon.codicon-star-empty' ) ) ) ;
931
+ reset ( descriptionContent , category . description ) ;
932
+ }
933
+
934
+ return $ ( 'button.getting-started-category' + ( category . content . accolades === 'featured' ? '.featured' : '' ) ,
919
935
{
920
936
'x-dispatch' : 'selectCategory:' + category . id ,
921
937
'role' : 'listitem' ,
922
938
'title' : category . description
923
939
} ,
924
- this . iconWidgetFor ( category ) ,
925
- $ ( 'a.codicon.codicon-close.hide-category-button' , {
926
- 'x-dispatch' : 'hideCategory:' + category . id ,
927
- 'title' : localize ( 'close' , "Hide" ) ,
928
- } ) ,
929
- $ ( 'h3.category-title.max-lines-3' , { 'x-category-title-for' : category . id } , category . title ) ,
940
+ featuredBadge ,
941
+ $ ( '.main-content' , { } ,
942
+ this . iconWidgetFor ( category ) ,
943
+ $ ( 'h3.category-title.max-lines-3' , { 'x-category-title-for' : category . id } , category . title , ) ,
944
+ newBadge ,
945
+ $ ( 'a.codicon.codicon-close.hide-category-button' , {
946
+ 'x-dispatch' : 'hideCategory:' + category . id ,
947
+ 'title' : localize ( 'close' , "Hide" ) ,
948
+ } ) ,
949
+ ) ,
950
+ descriptionContent ,
930
951
$ ( '.category-progress' , { 'x-data-category-id' : category . id , } ,
931
952
$ ( '.progress-bar-outer' , { 'role' : 'progressbar' } ,
932
953
$ ( '.progress-bar-inner' ) ) ) ) ;
933
954
} ;
934
955
935
956
if ( this . gettingStartedList ) { this . gettingStartedList . dispose ( ) ; }
936
957
937
- const limit = Math . min ( this . gettingStartedCategories . filter ( c => c . priority > 0 ) . length , 5 ) ;
938
958
const gettingStartedList = this . gettingStartedList = new GettingStartedIndexList (
939
959
localize ( 'gettingStarted' , "Getting Started" ) ,
940
960
'getting-started' ,
941
- limit ,
961
+ 5 ,
942
962
undefined ,
943
963
undefined ,
944
964
$ ( 'button.button-link.see-all-walkthroughs' , { 'tabindex' : '0' , 'x-dispatch' : 'seeAllWalkthroughs' } , localize ( 'seeMore' , "See More" ) ) ,
@@ -1018,7 +1038,9 @@ export class GettingStartedPage extends EditorPane {
1018
1038
}
1019
1039
1020
1040
private iconWidgetFor ( category : IGettingStartedCategory ) {
1021
- return category . icon . type === 'icon' ? $ ( ThemeIcon . asCSSSelector ( category . icon . icon ) ) : $ ( 'img.category-icon' , { src : category . icon . path } ) ;
1041
+ const widget = category . icon . type === 'icon' ? $ ( ThemeIcon . asCSSSelector ( category . icon . icon ) ) : $ ( 'img.category-icon' , { src : category . icon . path } ) ;
1042
+ widget . classList . add ( 'icon-widget' ) ;
1043
+ return widget ;
1022
1044
}
1023
1045
1024
1046
private buildStepMarkdownDescription ( container : HTMLElement , text : LinkedText [ ] ) {
@@ -1474,4 +1496,16 @@ registerThemingParticipant((theme, collector) => {
1474
1496
if ( progressForeground ) {
1475
1497
collector . addRule ( `.monaco-workbench .part.editor > .content .gettingStartedContainer .gettingStartedSlideCategories .progress-bar-inner { background-color: ${ progressForeground } ; }` ) ;
1476
1498
}
1499
+
1500
+ const newBadgeForeground = theme . getColor ( ACTIVITY_BAR_BADGE_FOREGROUND ) ;
1501
+ if ( newBadgeForeground ) {
1502
+ collector . addRule ( `.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .new-badge { color: ${ newBadgeForeground } ; }` ) ;
1503
+ collector . addRule ( `.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .featured .featured-icon { color: ${ newBadgeForeground } ; }` ) ;
1504
+ }
1505
+
1506
+ const newBadgeBackground = theme . getColor ( badgeBackground ) ;
1507
+ if ( newBadgeBackground ) {
1508
+ collector . addRule ( `.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .new-badge { background-color: ${ newBadgeBackground } ; }` ) ;
1509
+ collector . addRule ( `.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-category .featured { border-top-color: ${ newBadgeBackground } ; }` ) ;
1510
+ }
1477
1511
} ) ;
0 commit comments