22// SPDX-License-Identifier: Apache-2.0
33
44import { Tooltip } from "@/app/element/tooltip" ;
5+ import { atoms } from "@/app/store/global" ;
56import { globalStore } from "@/app/store/jotaiStore" ;
67import { tryReinjectKey } from "@/app/store/keymodel" ;
78import { CodeEditor } from "@/app/view/codeeditor/codeeditor" ;
@@ -21,6 +22,7 @@ const ConfigSidebar = memo(({ model }: ConfigSidebarProps) => {
2122 const [ isMenuOpen , setIsMenuOpen ] = useAtom ( model . isMenuOpenAtom ) ;
2223 const configFiles = model . getConfigFiles ( ) ;
2324 const deprecatedConfigFiles = model . getDeprecatedConfigFiles ( ) ;
25+ const configErrorFiles = useAtomValue ( model . configErrorFilesAtom ) ;
2426
2527 const handleFileSelect = ( file : ConfigFile ) => {
2628 model . loadFile ( file ) ;
@@ -46,7 +48,12 @@ const ConfigSidebar = memo(({ model }: ConfigSidebarProps) => {
4648 selectedFile ?. path === file . path ? "bg-accentbg text-primary" : "hover:bg-secondary/50"
4749 } `}
4850 >
49- < div className = "whitespace-nowrap overflow-hidden text-ellipsis" > { file . name } </ div >
51+ < div className = "flex items-center gap-1" >
52+ < div className = "whitespace-nowrap overflow-hidden text-ellipsis flex-1" > { file . name } </ div >
53+ { configErrorFiles . has ( file . path ) && (
54+ < i className = "fa fa-solid fa-circle-exclamation text-error text-[14px] shrink-0" />
55+ ) }
56+ </ div >
5057 { file . description && (
5158 < div className = "text-xs text-muted mt-0.5 whitespace-nowrap overflow-hidden text-ellipsis" >
5259 { file . description }
@@ -75,6 +82,9 @@ const ConfigSidebar = memo(({ model }: ConfigSidebarProps) => {
7582 >
7683 deprecated
7784 </ span >
85+ { configErrorFiles . has ( file . path ) && (
86+ < i className = "fa fa-solid fa-circle-exclamation text-error text-[14px] ml-auto shrink-0" />
87+ ) }
7888 </ div >
7989 </ div >
8090 ) ) }
@@ -96,6 +106,8 @@ const WaveConfigView = memo(({ blockId, model }: ViewComponentProps<WaveConfigVi
96106 const [ isMenuOpen , setIsMenuOpen ] = useAtom ( model . isMenuOpenAtom ) ;
97107 const hasChanges = useAtomValue ( model . hasEditedAtom ) ;
98108 const [ activeTab , setActiveTab ] = useAtom ( model . activeTabAtom ) ;
109+ const fullConfig = useAtomValue ( atoms . fullConfigAtom ) ;
110+ const configErrors = fullConfig ?. configerrors ;
99111
100112 const handleContentChange = useCallback (
101113 ( newContent : string ) => {
@@ -148,7 +160,8 @@ const WaveConfigView = memo(({ blockId, model }: ViewComponentProps<WaveConfigVi
148160 const saveTooltip = `Save (${ model . saveShortcut } )` ;
149161
150162 return (
151- < div className = "@container flex flex-row w-full h-full" >
163+ < div className = "@container flex flex-col w-full h-full" >
164+ < div className = "flex flex-row flex-1 min-h-0" >
152165 { isMenuOpen && (
153166 < div className = "absolute inset-0 bg-black/50 z-5 @w600:hidden" onClick = { ( ) => setIsMenuOpen ( false ) } />
154167 ) }
@@ -284,6 +297,17 @@ const WaveConfigView = memo(({ blockId, model }: ViewComponentProps<WaveConfigVi
284297 </ >
285298 ) }
286299 </ div >
300+ </ div >
301+ { configErrors ?. length > 0 && (
302+ < div className = "bg-error text-primary px-4 py-1 max-h-12 overflow-y-auto border-t border-error/50 shrink-0" >
303+ { configErrors . map ( ( cerr , i ) => (
304+ < div key = { i } className = "text-sm" >
305+ < span className = "font-semibold" > Config Error: </ span >
306+ { cerr . file } : { cerr . err }
307+ </ div >
308+ ) ) }
309+ </ div >
310+ ) }
287311 </ div >
288312 ) ;
289313} ) ;
0 commit comments