File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
webview-ui/src/components/modes Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ export interface ModeState {
1414// Internal type used when returning modes to callers (webview/handlers).
1515// Extends the canonical ModeConfig with source information and an optional
1616// UI-only `overridesBuiltin` flag used by the webview.
17- export type ModeWithSource = ModeConfig & { source : ModeSource ; overridesBuiltin ?: boolean }
17+ export type ModeWithSource = ModeConfig & {
18+ source : ModeSource
19+ overridesBuiltin ?: boolean
20+ overriddenBy ?: ModeSource
21+ }
1822
1923/**
2024 * ModeManager handles mode operations including enable/disable functionality,
@@ -42,6 +46,14 @@ export class ModeManager {
4246 const customOverride = customModes . find ( ( m ) => m . slug === mode . slug )
4347 if ( ! customOverride ) {
4448 allModes . push ( { ...mode , source : "builtin" } )
49+ } else {
50+ // Add overridden built-in mode with override information
51+ allModes . push ( {
52+ ...mode ,
53+ source : "builtin" ,
54+ disabled : customOverride . disabled ,
55+ overriddenBy : customOverride . source as ModeSource ,
56+ } )
4557 }
4658 }
4759
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export type ModeSource = "builtin" | "global" | "project"
4343export interface ModeWithSource extends ModeConfig {
4444 source : ModeSource
4545 disabled ?: boolean
46+ overriddenBy ?: ModeSource
4647}
4748
4849interface ModeEnableDisableDialogProps {
@@ -222,6 +223,11 @@ export const ModeEnableDisableDialog: React.FC<ModeEnableDisableDialogProps> = (
222223 < Badge variant = "outline" className = { cn ( "source-badge text-xs px-1.5 py-0.5" , mode . source ) } >
223224 { SOURCE_INFO [ mode . source ] . icon } { mode . source }
224225 </ Badge >
226+ { mode . overriddenBy && (
227+ < Badge variant = "secondary" className = "text-xs px-1.5 py-0.5" >
228+ Overridden by { mode . overriddenBy }
229+ </ Badge >
230+ ) }
225231 </ div >
226232 { mode . description && (
227233 < p className = { cn ( "mode-description text-xs mt-1 truncate" , mode . disabled && "disabled" ) } >
You can’t perform that action at this time.
0 commit comments