@@ -59,28 +59,20 @@ const mockWidgets: { [key: string]: WidgetConfigType } = {
5959 "display:order" : 2 ,
6060 blockdef : { meta : { view : "web" , url : "https://waveterm.dev" } } ,
6161 } ,
62- "defwidget@ai" : {
63- icon : "sparkles" ,
64- color : "#a78bfa" ,
65- label : "AI" ,
66- description : "Open Wave AI" ,
67- "display:order" : 3 ,
68- blockdef : { meta : { view : "waveai" } } ,
69- } ,
7062 "defwidget@files" : {
7163 icon : "folder" ,
7264 color : "#fbbf24" ,
7365 label : "Files" ,
7466 description : "Open file browser" ,
75- "display:order" : 4 ,
67+ "display:order" : 3 ,
7668 blockdef : { meta : { view : "preview" , connection : "local" } } ,
7769 } ,
7870 "defwidget@sysinfo" : {
7971 icon : "chart-line" ,
8072 color : "#34d399" ,
8173 label : "Sysinfo" ,
8274 description : "Open system info" ,
83- "display:order" : 5 ,
75+ "display:order" : 4 ,
8476 blockdef : { meta : { view : "sysinfo" } } ,
8577 } ,
8678} ;
@@ -90,7 +82,6 @@ const fullConfigAtom = atom<FullConfigType>({ settings: {}, widgets: mockWidgets
9082function makeWidgetsEnv (
9183 baseEnv : WaveEnv ,
9284 isDev : boolean ,
93- hasCustomAIPresets : boolean ,
9485 apps ?: AppInfo [ ] ,
9586 atomOverrides ?: Partial < GlobalAtomsType >
9687) {
@@ -99,7 +90,6 @@ function makeWidgetsEnv(
9990 rpc : { ListAllAppsCommand : ( ) => Promise . resolve ( apps ?? [ ] ) } ,
10091 atoms : {
10192 fullConfigAtom,
102- hasCustomAIPresetsAtom : atom ( hasCustomAIPresets ) ,
10393 ...atomOverrides ,
10494 } ,
10595 } ) ;
@@ -108,20 +98,18 @@ function makeWidgetsEnv(
10898function WidgetsScenario ( {
10999 label,
110100 isDev = false ,
111- hasCustomAIPresets = true ,
112101 height,
113102 apps,
114103} : {
115104 label : string ;
116105 isDev ?: boolean ;
117- hasCustomAIPresets ?: boolean ;
118106 height ?: number ;
119107 apps ?: AppInfo [ ] ;
120108} ) {
121109 const baseEnv = useWaveEnv ( ) ;
122110 const envRef = useRef < WaveEnv > ( null ) ;
123111 if ( envRef . current == null ) {
124- envRef . current = makeWidgetsEnv ( baseEnv , isDev , hasCustomAIPresets , apps , {
112+ envRef . current = makeWidgetsEnv ( baseEnv , isDev , apps , {
125113 hasConfigErrors : hasConfigErrorsAtom ,
126114 } ) ;
127115 }
@@ -149,7 +137,7 @@ function WidgetsResizable({ isDev }: { isDev: boolean }) {
149137 const baseEnv = useWaveEnv ( ) ;
150138 const envRef = useRef < WaveEnv > ( null ) ;
151139 if ( envRef . current == null ) {
152- envRef . current = makeWidgetsEnv ( baseEnv , isDev , true , mockApps , { hasConfigErrors : hasConfigErrorsAtom } ) ;
140+ envRef . current = makeWidgetsEnv ( baseEnv , isDev , mockApps , { hasConfigErrors : hasConfigErrorsAtom } ) ;
153141 }
154142
155143 return (
@@ -224,8 +212,7 @@ export function WidgetsPreview() {
224212 < PreviewControls />
225213 < div key = { mockVersion } className = "flex flex-col gap-8" >
226214 < div className = "flex flex-row gap-8 items-start flex-wrap" >
227- < WidgetsScenario label = "normal (with AI presets)" height = { 550 } isDev = { isDev } />
228- < WidgetsScenario label = "no custom AI presets" hasCustomAIPresets = { false } height = { 550 } isDev = { isDev } />
215+ < WidgetsScenario label = "normal" height = { 550 } isDev = { isDev } />
229216 < WidgetsScenario label = "dev mode (apps button)" height = { 550 } isDev = { isDev } apps = { mockApps } />
230217 < WidgetsScenario label = "compact (200px)" height = { 200 } isDev = { isDev } apps = { mockApps } />
231218 </ div >
0 commit comments