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" ;
@@ -71,68 +70,6 @@ const WaveAIButton = memo(({ divRef }: { divRef?: React.RefObject<HTMLDivElement
7170} ) ;
7271WaveAIButton . displayName = "WaveAIButton" ;
7372
74- const ConfigErrorMessage = ( ) => {
75- const env = useWaveEnv < TabBarEnv > ( ) ;
76- const fullConfig = useAtomValue ( env . atoms . fullConfigAtom ) ;
77-
78- if ( fullConfig ?. configerrors == null || fullConfig ?. configerrors . length == 0 ) {
79- return (
80- < div className = "max-w-[500px] p-5" >
81- < h3 className = "font-bold text-base mb-2.5" > Configuration Clean</ h3 >
82- < p > There are no longer any errors detected in your config.</ p >
83- </ div >
84- ) ;
85- }
86- if ( fullConfig ?. configerrors . length == 1 ) {
87- const singleError = fullConfig . configerrors [ 0 ] ;
88- return (
89- < div className = "max-w-[500px] p-5" >
90- < h3 className = "font-bold text-base mb-2.5" > Configuration Error</ h3 >
91- < div >
92- { singleError . file } : { singleError . err }
93- </ div >
94- </ div >
95- ) ;
96- }
97- return (
98- < div className = "max-w-[500px] p-5" >
99- < h3 className = "font-bold text-base mb-2.5" > Configuration Error</ h3 >
100- < ul >
101- { fullConfig . configerrors . map ( ( error , index ) => (
102- < li key = { index } >
103- { error . file } : { error . err }
104- </ li >
105- ) ) }
106- </ ul >
107- </ div >
108- ) ;
109- } ;
110-
111- const ConfigErrorIcon = ( ) => {
112- const env = useWaveEnv < TabBarEnv > ( ) ;
113- const hasConfigErrors = useAtomValue ( env . atoms . hasConfigErrors ) ;
114-
115- const handleClick = useCallback ( ( ) => {
116- modalsModel . pushModal ( "MessageModal" , { children : < ConfigErrorMessage /> } ) ;
117- } , [ ] ) ;
118-
119- if ( ! hasConfigErrors ) {
120- return null ;
121- }
122- return (
123- < Tooltip
124- content = "Configuration Error"
125- placement = "bottom"
126- hideOnClick
127- 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"
128- divStyle = { { WebkitAppRegion : "no-drag" } as React . CSSProperties }
129- divOnClick = { handleClick }
130- >
131- < i className = "fa fa-solid fa-triangle-exclamation" />
132- </ Tooltip >
133- ) ;
134- } ;
135-
13673function strArrayIsEqual ( a : string [ ] , b : string [ ] ) {
13774 // null check
13875 if ( a == null && b == null ) {
@@ -192,7 +129,6 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
192129 const confirmClose = useAtomValue ( env . getSettingsKeyAtom ( "tab:confirmclose" ) ) ?? false ;
193130 const hideAiButton = useAtomValue ( env . getSettingsKeyAtom ( "app:hideaibutton" ) ) ;
194131 const appUpdateStatus = useAtomValue ( env . atoms . updaterStatusAtom ) ;
195- const hasConfigErrors = useAtomValue ( env . atoms . hasConfigErrors ) ;
196132
197133 let prevDelta : number ;
198134 let prevDragDirection : string ;
@@ -330,7 +266,7 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
330266 } ;
331267 } , [ handleResizeTabs ] ) ;
332268
333- // update layout on changed tabIds, tabsLoaded, newTabId, hideAiButton, appUpdateStatus, hasConfigErrors, or zoomFactor
269+ // update layout on changed tabIds, tabsLoaded, newTabId, hideAiButton, appUpdateStatus, or zoomFactor
334270 useEffect ( ( ) => {
335271 // Check if all tabs are loaded
336272 const allLoaded = tabIds . length > 0 && tabIds . every ( ( id ) => tabsLoaded [ id ] ) ;
@@ -348,7 +284,6 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
348284 saveTabsPosition ,
349285 hideAiButton ,
350286 appUpdateStatus ,
351- hasConfigErrors ,
352287 zoomFactor ,
353288 showMenuBar ,
354289 ] ) ;
@@ -715,7 +650,6 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
715650 < div className = "flex-1" />
716651 < div ref = { rightContainerRef } className = "flex flex-row gap-1 items-end" >
717652 < UpdateStatusBanner />
718- < ConfigErrorIcon />
719653 < div
720654 className = "h-full shrink-0 z-window-drag"
721655 style = { { width : windowDragRightWidth , WebkitAppRegion : "drag" } as any }
@@ -725,4 +659,4 @@ const TabBar = memo(({ workspace }: TabBarProps) => {
725659 ) ;
726660} ) ;
727661
728- export { ConfigErrorIcon , ConfigErrorMessage , TabBar , WaveAIButton } ;
662+ export { TabBar , WaveAIButton } ;
0 commit comments