@@ -121,10 +121,11 @@ export function Titlebar(props: { update?: TitlebarUpdate }) {
121121 const hasProjects = createMemo ( ( ) => layout . projects . list ( ) . length > 0 )
122122 const nav = createMemo ( ( ) => ( useV2Titlebar ( ) ? settings . general . showNavigation ( ) : true ) )
123123 const updateState = createMemo < TitlebarUpdatePillState > ( ( ) => {
124+ const installing = props . update ?. installing ( ) ?? false
124125 const version = props . update ?. version ( )
125126 return {
126- visible : version !== undefined ,
127- installing : props . update ?. installing ( ) ?? false ,
127+ visible : version !== undefined || installing ,
128+ installing,
128129 label : "Update" ,
129130 ariaLabel : language . t ( "toast.update.action.installRestart" ) ,
130131 title : version ? `Update ${ version } ` : undefined ,
@@ -219,9 +220,9 @@ export function Titlebar(props: { update?: TitlebarUpdate }) {
219220 return (
220221 < header
221222 classList = { {
222- "shrink-0 relative overflow-hidden flex flex-row" : true ,
223- "h-9 bg-v2-background-bg-deep" : useV2Titlebar ( ) ,
224- "h-10 bg-background-base" : ! useV2Titlebar ( ) ,
223+ "shrink-0 relative flex flex-row" : true ,
224+ "h-9 bg-v2-background-bg-deep overflow-visible " : useV2Titlebar ( ) ,
225+ "h-10 bg-background-base overflow-hidden " : ! useV2Titlebar ( ) ,
225226 } }
226227 style = { {
227228 "min-height" : minHeight ( ) ,
@@ -705,27 +706,39 @@ type TitlebarV2RightState = {
705706
706707function TitlebarV2Right ( props : { state : TitlebarV2RightState } ) {
707708 return (
708- < div class = "flex shrink-0 items-center justify-end gap-0" >
709- < TitlebarUpdatePill state = { props . state . update } />
709+ < div class = "relative z-20 flex shrink-0 items-center justify-end gap-0 overflow-visible " >
710+ < TitlebarUpdateIconButton state = { props . state . update } />
710711 < div id = "opencode-titlebar-right" class = "flex shrink-0 items-center justify-end gap-0" />
711712 </ div >
712713 )
713714}
714715
715- function TitlebarUpdatePill ( props : { state : TitlebarUpdatePillState } ) {
716+ function TitlebarUpdateIconButton ( props : { state : TitlebarUpdatePillState } ) {
716717 return (
717- < Show when = { props . state . visible } >
718+ < div class = "relative isolate mr-3 size-5 shrink-0" >
718719 < button
719720 type = "button"
720- class = "h-5 shrink-0 rounded-[27px] bg-[var(-- v2-background-bg-layer-03)] px-2.5 text-[11px] font-[530] leading-4 tracking-[0.05px] text-[ var(--v2-text-text-base)] disabled:opacity-60"
721+ class = "group absolute right-0 top-0 z-10 flex h-5 w-5 items-center justify-end overflow-hidden rounded-full bg-v2-icon-icon-accent/20 text- v2-icon-icon-accent transition-[width,background-color] duration-150 ease-out hover:z-30 hover:w-[68px] hover:bg-[color-mix(in_srgb,var(--v2-icon-icon-accent)_20%,var(--v2-background-bg-deep))] focus-visible:z-30 focus-visible:w-[68px] focus-visible:bg-[color-mix(in_srgb, var(--v2-icon-icon-accent)_20%,var(--v2-background-bg-deep))] focus-visible:outline-none disabled:opacity-60 motion-reduce:transition-none "
721722 onClick = { props . state . onInstall }
722723 disabled = { props . state . installing }
724+ aria-busy = { props . state . installing }
723725 aria-label = { props . state . ariaLabel }
724- title = { props . state . title }
725726 >
726- { props . state . label }
727+ < span class = "shrink-0 ml-[8px] mr-px text-[11px] text-v2-text-text-accent [font-weight:530] opacity-0 translate-x-2 motion-safe:transition-all duration-150 ease-out group-hover:opacity-100 group-hover:translate-x-0 group-focus-visible:opacity-100 group-focus-visible:translate-x-0 motion-reduce:translate-x-0" >
728+ Update
729+ </ span >
730+ < span class = "flex size-5 shrink-0 items-center justify-center" >
731+ < Show
732+ when = { ! props . state . installing }
733+ fallback = { < span data-slot = "titlebar-update-loader" aria-hidden = "true" /> }
734+ >
735+ < svg width = "14" height = "14" viewBox = "0 0 14 14" fill = "none" aria-hidden = "true" >
736+ < path d = "M7 11V3M3.5 7.63128L7 11L10.5 7.63128" stroke = "currentColor" />
737+ </ svg >
738+ </ Show >
739+ </ span >
727740 </ button >
728- </ Show >
741+ </ div >
729742 )
730743}
731744
0 commit comments