@@ -53,6 +53,12 @@ export const QUOTA_TOAST_SETTING_SOURCE_KEYS = [
5353 "toastDurationMs" ,
5454 "onlyCurrentModel" ,
5555 "showSessionTokens" ,
56+ "tuiSidebarPanel.enabled" ,
57+ "tuiCompactStatus.enabled" ,
58+ "tuiCompactStatus.homeBottom" ,
59+ "tuiCompactStatus.sessionPrompt" ,
60+ "tuiCompactStatus.suppressWhenNativeProviderQuota" ,
61+ "tuiCompactStatus.maxWidth" ,
5662 "layout.maxWidth" ,
5763 "layout.narrowAt" ,
5864 "layout.tinyAt" ,
@@ -110,6 +116,8 @@ const NETWORK_SETTING_SOURCE_KEYS = [
110116] as const satisfies readonly QuotaToastSettingSourceKey [ ] ;
111117
112118type PricingSnapshotPatch = Partial < QuotaToastConfig [ "pricingSnapshot" ] > ;
119+ type TuiSidebarPanelPatch = Partial < QuotaToastConfig [ "tuiSidebarPanel" ] > ;
120+ type TuiCompactStatusPatch = Partial < QuotaToastConfig [ "tuiCompactStatus" ] > ;
113121type LayoutPatch = Partial < QuotaToastConfig [ "layout" ] > ;
114122
115123type ValidatedQuotaToastPatch = {
@@ -137,6 +145,8 @@ type ValidatedQuotaToastPatch = {
137145 toastDurationMs ?: number ;
138146 onlyCurrentModel ?: boolean ;
139147 showSessionTokens ?: boolean ;
148+ tuiSidebarPanel ?: TuiSidebarPanelPatch ;
149+ tuiCompactStatus ?: TuiCompactStatusPatch ;
140150 layout ?: LayoutPatch ;
141151} ;
142152
@@ -257,6 +267,8 @@ function cloneConfig(config: QuotaToastConfig): QuotaToastConfig {
257267 googleModels : [ ...config . googleModels ] ,
258268 opencodeGoWindows : [ ...config . opencodeGoWindows ] ,
259269 pricingSnapshot : { ...config . pricingSnapshot } ,
270+ tuiSidebarPanel : { ...config . tuiSidebarPanel } ,
271+ tuiCompactStatus : { ...config . tuiCompactStatus } ,
260272 layout : { ...config . layout } ,
261273 } ;
262274}
@@ -344,6 +356,53 @@ function extractPricingSnapshotPatch(value: unknown): PricingSnapshotPatch | und
344356 return Object . keys ( patch ) . length > 0 ? patch : undefined ;
345357}
346358
359+ function extractTuiSidebarPanelPatch ( value : unknown ) : TuiSidebarPanelPatch | undefined {
360+ if ( ! isPlainObject ( value ) ) {
361+ return undefined ;
362+ }
363+
364+ const patch : TuiSidebarPanelPatch = { } ;
365+
366+ if ( hasOwnKey ( value , "enabled" ) && typeof value . enabled === "boolean" ) {
367+ patch . enabled = value . enabled ;
368+ }
369+
370+ return Object . keys ( patch ) . length > 0 ? patch : undefined ;
371+ }
372+
373+ function extractTuiCompactStatusPatch ( value : unknown ) : TuiCompactStatusPatch | undefined {
374+ if ( ! isPlainObject ( value ) ) {
375+ return undefined ;
376+ }
377+
378+ const patch : TuiCompactStatusPatch = { } ;
379+
380+ if ( hasOwnKey ( value , "enabled" ) && typeof value . enabled === "boolean" ) {
381+ patch . enabled = value . enabled ;
382+ }
383+
384+ if ( hasOwnKey ( value , "homeBottom" ) && typeof value . homeBottom === "boolean" ) {
385+ patch . homeBottom = value . homeBottom ;
386+ }
387+
388+ if ( hasOwnKey ( value , "sessionPrompt" ) && typeof value . sessionPrompt === "boolean" ) {
389+ patch . sessionPrompt = value . sessionPrompt ;
390+ }
391+
392+ if (
393+ hasOwnKey ( value , "suppressWhenNativeProviderQuota" ) &&
394+ typeof value . suppressWhenNativeProviderQuota === "boolean"
395+ ) {
396+ patch . suppressWhenNativeProviderQuota = value . suppressWhenNativeProviderQuota ;
397+ }
398+
399+ if ( hasOwnKey ( value , "maxWidth" ) && isPositiveNumber ( value . maxWidth ) ) {
400+ patch . maxWidth = value . maxWidth ;
401+ }
402+
403+ return Object . keys ( patch ) . length > 0 ? patch : undefined ;
404+ }
405+
347406function extractLayoutPatch ( value : unknown ) : LayoutPatch | undefined {
348407 if ( ! isPlainObject ( value ) ) {
349408 return undefined ;
@@ -522,6 +581,20 @@ function extractValidatedQuotaToastPatch(
522581 patch . showSessionTokens = quotaToastConfig . showSessionTokens ;
523582 }
524583
584+ if ( hasOwnKey ( quotaToastConfig , "tuiSidebarPanel" ) ) {
585+ const tuiSidebarPanel = extractTuiSidebarPanelPatch ( quotaToastConfig . tuiSidebarPanel ) ;
586+ if ( tuiSidebarPanel ) {
587+ patch . tuiSidebarPanel = tuiSidebarPanel ;
588+ }
589+ }
590+
591+ if ( hasOwnKey ( quotaToastConfig , "tuiCompactStatus" ) ) {
592+ const tuiCompactStatus = extractTuiCompactStatusPatch ( quotaToastConfig . tuiCompactStatus ) ;
593+ if ( tuiCompactStatus ) {
594+ patch . tuiCompactStatus = tuiCompactStatus ;
595+ }
596+ }
597+
525598 if ( hasOwnKey ( quotaToastConfig , "layout" ) ) {
526599 const layout = extractLayoutPatch ( quotaToastConfig . layout ) ;
527600 if ( layout ) {
@@ -671,6 +744,45 @@ function applyValidatedQuotaToastPatch(
671744 applySettingSource ( settingSources , "showSessionTokens" , sourcePath ) ;
672745 }
673746
747+ if ( patch . tuiSidebarPanel ) {
748+ if ( hasOwnKey ( patch . tuiSidebarPanel , "enabled" ) ) {
749+ config . tuiSidebarPanel . enabled = patch . tuiSidebarPanel . enabled ! ;
750+ applySettingSource ( settingSources , "tuiSidebarPanel.enabled" , sourcePath ) ;
751+ }
752+ }
753+
754+ if ( patch . tuiCompactStatus ) {
755+ if ( hasOwnKey ( patch . tuiCompactStatus , "enabled" ) ) {
756+ config . tuiCompactStatus . enabled = patch . tuiCompactStatus . enabled ! ;
757+ applySettingSource ( settingSources , "tuiCompactStatus.enabled" , sourcePath ) ;
758+ }
759+
760+ if ( hasOwnKey ( patch . tuiCompactStatus , "homeBottom" ) ) {
761+ config . tuiCompactStatus . homeBottom = patch . tuiCompactStatus . homeBottom ! ;
762+ applySettingSource ( settingSources , "tuiCompactStatus.homeBottom" , sourcePath ) ;
763+ }
764+
765+ if ( hasOwnKey ( patch . tuiCompactStatus , "sessionPrompt" ) ) {
766+ config . tuiCompactStatus . sessionPrompt = patch . tuiCompactStatus . sessionPrompt ! ;
767+ applySettingSource ( settingSources , "tuiCompactStatus.sessionPrompt" , sourcePath ) ;
768+ }
769+
770+ if ( hasOwnKey ( patch . tuiCompactStatus , "suppressWhenNativeProviderQuota" ) ) {
771+ config . tuiCompactStatus . suppressWhenNativeProviderQuota =
772+ patch . tuiCompactStatus . suppressWhenNativeProviderQuota ! ;
773+ applySettingSource (
774+ settingSources ,
775+ "tuiCompactStatus.suppressWhenNativeProviderQuota" ,
776+ sourcePath ,
777+ ) ;
778+ }
779+
780+ if ( hasOwnKey ( patch . tuiCompactStatus , "maxWidth" ) ) {
781+ config . tuiCompactStatus . maxWidth = patch . tuiCompactStatus . maxWidth ! ;
782+ applySettingSource ( settingSources , "tuiCompactStatus.maxWidth" , sourcePath ) ;
783+ }
784+ }
785+
674786 if ( patch . layout ) {
675787 if ( hasOwnKey ( patch . layout , "maxWidth" ) ) {
676788 config . layout . maxWidth = patch . layout . maxWidth ! ;
@@ -933,5 +1045,5 @@ export async function loadConfig(
9331045 meta . networkSettingSources = { } ;
9341046 meta . configIssues = [ ] ;
9351047 }
936- return DEFAULT_CONFIG ;
1048+ return cloneDefaultConfig ( ) ;
9371049}
0 commit comments