File tree Expand file tree Collapse file tree 5 files changed +32
-6
lines changed Expand file tree Collapse file tree 5 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ function initGlobalAtoms(initOpts: GlobalInitOptions) {
140
140
return connStatuses ;
141
141
} ) ;
142
142
const flashErrorsAtom = atom < FlashErrorType [ ] > ( [ ] ) ;
143
+ const reinitVersion = atom ( 0 ) ;
143
144
atoms = {
144
145
// initialized in wave.ts (will not be null inside of application)
145
146
clientId : clientIdAtom ,
@@ -159,6 +160,7 @@ function initGlobalAtoms(initOpts: GlobalInitOptions) {
159
160
modalOpen,
160
161
allConnStatus : allConnStatusAtom ,
161
162
flashErrors : flashErrorsAtom ,
163
+ reinitVersion,
162
164
} ;
163
165
}
164
166
Original file line number Diff line number Diff line change 49
49
font-size : 11px ;
50
50
font-weight : 500 ;
51
51
text-shadow : 0px 0px 4px rgba (0 , 0 , 0 , 0.25 );
52
+ overflow : hidden ;
53
+ width : calc (100% - 10px );
54
+ text-overflow : ellipsis ;
55
+ text-align : center ;
52
56
53
57
& .focused {
54
58
outline : none ;
76
80
77
81
& :hover .close {
78
82
visibility : visible ;
83
+ backdrop-filter : blur (3px );
84
+
85
+ & :hover {
86
+ color : var (--main-text-color );
87
+ // background-color: var(--highlight-bg-color);
88
+ }
79
89
}
80
90
}
81
91
Original file line number Diff line number Diff line change @@ -96,11 +96,6 @@ const ConfigErrorIcon = ({ buttonRef }: { buttonRef: React.RefObject<HTMLElement
96
96
Config Error
97
97
</ Button >
98
98
) ;
99
- return (
100
- < div className = "config-error" ref = { buttonRef as React . RefObject < HTMLDivElement > } >
101
- < i className = "fa fa-solid fa-exclamation-triangle" />
102
- </ div >
103
- ) ;
104
99
} ;
105
100
106
101
const TabBar = React . memo ( ( { workspace } : TabBarProps ) => {
@@ -254,6 +249,13 @@ const TabBar = React.memo(({ workspace }: TabBarProps) => {
254
249
debounce ( 100 , ( ) => saveTabsPosition ( ) ) ( ) ;
255
250
} , [ tabIds , newTabId , isFullScreen ] ) ;
256
251
252
+ const reinitVersion = useAtomValue ( atoms . reinitVersion ) ;
253
+ useEffect ( ( ) => {
254
+ if ( reinitVersion > 0 ) {
255
+ setSizeAndPosition ( ) ;
256
+ }
257
+ } , [ reinitVersion ] ) ;
258
+
257
259
useEffect ( ( ) => {
258
260
window . addEventListener ( "resize" , ( ) => handleResizeTabs ( ) ) ;
259
261
return ( ) => {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ declare global {
24
24
modalOpen : jotai . PrimitiveAtom < boolean > ;
25
25
allConnStatus : jotai . Atom < ConnStatus [ ] > ;
26
26
flashErrors : jotai . PrimitiveAtom < FlashErrorType [ ] > ;
27
+ reinitVersion : jotai . PrimitiveAtom < number > ;
27
28
} ;
28
29
29
30
type WritableWaveObjectAtom < T extends WaveObj > = jotai . WritableAtom < T , [ value : T ] , void > ;
Original file line number Diff line number Diff line change @@ -85,11 +85,22 @@ async function reinitWave() {
85
85
getApi ( ) . sendLog ( "Reinit Wave" ) ;
86
86
const client = await WOS . reloadWaveObject < Client > ( WOS . makeORef ( "client" , savedInitOpts . clientId ) ) ;
87
87
const waveWindow = await WOS . reloadWaveObject < WaveWindow > ( WOS . makeORef ( "window" , savedInitOpts . windowId ) ) ;
88
- await WOS . reloadWaveObject < Workspace > ( WOS . makeORef ( "workspace" , waveWindow . workspaceid ) ) ;
88
+ const ws = await WOS . reloadWaveObject < Workspace > ( WOS . makeORef ( "workspace" , waveWindow . workspaceid ) ) ;
89
89
const initialTab = await WOS . reloadWaveObject < Tab > ( WOS . makeORef ( "tab" , savedInitOpts . tabId ) ) ;
90
90
await WOS . reloadWaveObject < LayoutState > ( WOS . makeORef ( "layout" , initialTab . layoutstate ) ) ;
91
+ reloadAllWorkspaceTabs ( ws ) ;
91
92
document . title = `Wave Terminal - ${ initialTab . name } ` ; // TODO update with tab name change
92
93
getApi ( ) . setWindowInitStatus ( "wave-ready" ) ;
94
+ globalStore . set ( atoms . reinitVersion , globalStore . get ( atoms . reinitVersion ) + 1 ) ;
95
+ }
96
+
97
+ function reloadAllWorkspaceTabs ( ws : Workspace ) {
98
+ if ( ws == null || ws . tabids == null ) {
99
+ return ;
100
+ }
101
+ ws . tabids . forEach ( ( tabid ) => {
102
+ WOS . reloadWaveObject < Tab > ( WOS . makeORef ( "tab" , tabid ) ) ;
103
+ } ) ;
93
104
}
94
105
95
106
function loadAllWorkspaceTabs ( ws : Workspace ) {
You can’t perform that action at this time.
0 commit comments