22// SPDX-License-Identifier: Apache-2.0
33
44import { Tooltip } from "@/app/element/tooltip" ;
5- import { modalsModel } from "@/app/store/modalmodel" ;
65import { TabRpcClient } from "@/app/store/wshrpcutil" ;
76import { useWaveEnv } from "@/app/waveenv/waveenv" ;
87import { WorkspaceLayoutModel } from "@/app/workspace/workspace-layout-model" ;
@@ -76,68 +75,6 @@ const WaveAIButton = memo(({ divRef }: { divRef?: React.RefObject<HTMLDivElement
7675} ) ;
7776WaveAIButton . displayName = "WaveAIButton" ;
7877
79- const ConfigErrorMessage = ( ) => {
80- const env = useWaveEnv < TabBarEnv > ( ) ;
81- const fullConfig = useAtomValue ( env . atoms . fullConfigAtom ) ;
82-
83- if ( fullConfig ?. configerrors == null || fullConfig ?. configerrors . length == 0 ) {
84- return (
85- < div className = "max-w-[500px] p-5" >
86- < h3 className = "font-bold text-base mb-2.5" > Configuration Clean</ h3 >
87- < p > There are no longer any errors detected in your config.</ p >
88- </ div >
89- ) ;
90- }
91- if ( fullConfig ?. configerrors . length == 1 ) {
92- const singleError = fullConfig . configerrors [ 0 ] ;
93- return (
94- < div className = "max-w-[500px] p-5" >
95- < h3 className = "font-bold text-base mb-2.5" > Configuration Error</ h3 >
96- < div >
97- { singleError . file } : { singleError . err }
98- </ div >
99- </ div >
100- ) ;
101- }
102- return (
103- < div className = "max-w-[500px] p-5" >
104- < h3 className = "font-bold text-base mb-2.5" > Configuration Error</ h3 >
105- < ul >
106- { fullConfig . configerrors . map ( ( error , index ) => (
107- < li key = { index } >
108- { error . file } : { error . err }
109- </ li >
110- ) ) }
111- </ ul >
112- </ div >
113- ) ;
114- } ;
115-
116- const ConfigErrorIcon = ( ) => {
117- const env = useWaveEnv < TabBarEnv > ( ) ;
118- const hasConfigErrors = useAtomValue ( env . atoms . hasConfigErrors ) ;
119-
120- const handleClick = useCallback ( ( ) => {
121- modalsModel . pushModal ( "MessageModal" , { children : < ConfigErrorMessage /> } ) ;
122- } , [ ] ) ;
123-
124- if ( ! hasConfigErrors ) {
125- return null ;
126- }
127- return (
128- < Tooltip
129- content = "Configuration Error"
130- placement = "bottom"
131- hideOnClick
132- divClassName = "flex h-[22px] px-2 mb-1 items-center rounded-md box-border cursor-pointer hover:bg-hoverbg transition-colors text-[12px] text-error"
133- divStyle = { { WebkitAppRegion : "no-drag" } as React . CSSProperties }
134- divOnClick = { handleClick }
135- >
136- < i className = "fa fa-solid fa-triangle-exclamation" />
137- </ Tooltip >
138- ) ;
139- } ;
140-
14178function strArrayIsEqual ( a : string [ ] , b : string [ ] ) {
14279 // null check
14380 if ( a == null && b == null ) {
@@ -197,7 +134,6 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
197134 const confirmClose = useAtomValue ( env . getSettingsKeyAtom ( "tab:confirmclose" ) ) ?? false ;
198135 const hideAiButton = useAtomValue ( env . getSettingsKeyAtom ( "app:hideaibutton" ) ) ;
199136 const appUpdateStatus = useAtomValue ( env . atoms . updaterStatusAtom ) ;
200- const hasConfigErrors = useAtomValue ( env . atoms . hasConfigErrors ) ;
201137
202138 let prevDelta : number ;
203139 let prevDragDirection : string ;
@@ -335,7 +271,7 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
335271 } ;
336272 } , [ handleResizeTabs ] ) ;
337273
338- // update layout on changed tabIds, tabsLoaded, newTabId, hideAiButton, appUpdateStatus, hasConfigErrors, or zoomFactor
274+ // update layout on changed tabIds, tabsLoaded, newTabId, hideAiButton, appUpdateStatus, or zoomFactor
339275 useEffect ( ( ) => {
340276 // Check if all tabs are loaded
341277 const allLoaded = tabIds . length > 0 && tabIds . every ( ( id ) => tabsLoaded [ id ] ) ;
@@ -353,7 +289,6 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
353289 saveTabsPosition ,
354290 hideAiButton ,
355291 appUpdateStatus ,
356- hasConfigErrors ,
357292 zoomFactor ,
358293 showMenuBar ,
359294 ] ) ;
@@ -731,7 +666,6 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
731666 < div className = "flex-1" />
732667 < div ref = { rightContainerRef } className = "flex flex-row gap-1 items-end" >
733668 < UpdateStatusBanner />
734- < ConfigErrorIcon />
735669 < div
736670 className = "h-full shrink-0 z-window-drag"
737671 style = { { width : windowDragRightWidth , WebkitAppRegion : "drag" } as any }
@@ -741,4 +675,4 @@ const TabBar = memo(({ workspace, noTabs }: TabBarProps) => {
741675 ) ;
742676} ) ;
743677
744- export { ConfigErrorIcon , ConfigErrorMessage , TabBar , WaveAIButton } ;
678+ export { TabBar , WaveAIButton } ;
0 commit comments