@@ -105,15 +105,30 @@ const Badge = styled(Box)<{ $badgeColors: { primary: string, secondary: string }
105105 .instance-name {
106106 font-size: 1.6rem;
107107 display: inline-flex;
108+ gap: 0;
108109 align-items: center;
109110 vertical-align: middle;
110- text-overflow: ellipsis;
111111 overflow: hidden;
112- white-space: nowrap;
113112 flex-shrink: 1;
114- min-width: 0;
115113 margin-left: 0.3rem;
116114
115+ &-text {
116+ text-overflow: ellipsis;
117+ overflow: hidden;
118+ white-space: nowrap;
119+ flex-shrink: 1;
120+ min-width: 0;
121+ color: inherit;
122+ }
123+
124+ &-type {
125+ text-overflow: ellipsis;
126+ overflow: hidden;
127+ white-space: nowrap;
128+ flex-shrink: 0;
129+ color: inherit;
130+ }
131+
117132 &.placeholder {
118133 color: ${ ( { theme } ) => theme . color . orange } ;
119134 }
@@ -165,6 +180,7 @@ const EnterpriseBadge = styled.span`
165180
166181const Separator = styled . span < { $color : string } > `
167182 display: inline-block;
183+ flex-shrink: 0;
168184 width: 0.15rem;
169185 margin: 0 1rem;
170186 height: 1.8rem;
@@ -389,18 +405,20 @@ export const Toolbar = () => {
389405 } catch ( e ) {
390406 console . error ( e )
391407 setSaveError ( `Failed to save instance settings: ${ e instanceof Error ? e . message : e } ` )
392- } finally {
393- await refreshSettingsAndPreferences ( )
408+ const { preferences : newPreferences } = await refreshSettingsAndPreferences ( )
409+ setPreviewValues ( newPreferences )
394410 }
395411 }
396412
397413 const handleToggle = useCallback ( ( active : boolean ) => {
398- setSettingsPopperActive ( active )
399- setPreviewValues ( active ? preferences : null )
400- if ( ! active ) {
401- setSaveError ( null )
402- }
403- } , [ preferences ] )
414+ refreshSettingsAndPreferences ( ) . then ( ( { preferences : newPreferences } ) => {
415+ setSettingsPopperActive ( active )
416+ if ( ! active ) {
417+ setSaveError ( null )
418+ }
419+ setPreviewValues ( active ? newPreferences : null )
420+ } )
421+ } , [ ] )
404422
405423 return (
406424 < Root >
@@ -431,11 +449,11 @@ export const Toolbar = () => {
431449 ) }
432450 </ Box >
433451 { shownValues ?. instance_name
434- ? < Text data-hook = "topbar-instance-name" className = "instance-name" >
435- { instanceTypeReadable }
452+ ? < Box data-hook = "topbar-instance-name" className = "instance-name" >
453+ < Text className = "instance-name-type" > { instanceTypeReadable } </ Text >
436454 < Separator $color = { badgeColors . secondary } />
437- { shownValues ?. instance_name }
438- </ Text >
455+ < Text className = "instance-name-text" > { shownValues ?. instance_name } </ Text >
456+ </ Box >
439457 : < Text data-hook = "topbar-instance-name" className = "instance-name placeholder" > Instance name is not set</ Text >
440458 }
441459 { canEditInstanceName && (
0 commit comments