@@ -14,7 +14,8 @@ import { createPortal } from 'react-dom';
1414import { TerminalPane } from './TerminalPane' ;
1515import { Baseboard } from './Baseboard' ;
1616import { tv } from 'tailwind-variants' ;
17- import { BellIcon , BellSlashIcon , SplitHorizontalIcon , SplitVerticalIcon , ArrowsOutIcon , ArrowsInIcon , ArrowLineDownIcon , XIcon , CursorClickIcon , ProhibitIcon } from '@phosphor-icons/react' ;
17+ import { PopupButtonRow , popupButton } from './design' ;
18+ import { BellIcon , BellSlashIcon , SplitHorizontalIcon , SplitVerticalIcon , ArrowsOutIcon , ArrowsInIcon , ArrowLineDownIcon , XIcon , CursorClickIcon , SelectionSlashIcon } from '@phosphor-icons/react' ;
1819import {
1920 DEFAULT_MOUSE_SELECTION_STATE ,
2021 extendSelectionToToken ,
@@ -229,6 +230,7 @@ function MouseOverrideBanner({
229230 onCancel : ( ) => void ;
230231} ) {
231232 const [ pos , setPos ] = useState < { x : number ; y : number } | null > ( null ) ;
233+ const [ flashed , setFlashed ] = useState < 'sticky' | 'cancel' | null > ( null ) ;
232234
233235 useLayoutEffect ( ( ) => {
234236 const update = ( ) => {
@@ -244,27 +246,36 @@ function MouseOverrideBanner({
244246 } ;
245247 } , [ anchor ] ) ;
246248
249+ useEffect ( ( ) => {
250+ if ( ! flashed ) return ;
251+ const id = window . setTimeout ( ( ) => {
252+ if ( flashed === 'sticky' ) onMakePermanent ( ) ;
253+ else onCancel ( ) ;
254+ } , 260 ) ;
255+ return ( ) => window . clearTimeout ( id ) ;
256+ } , [ flashed , onMakePermanent , onCancel ] ) ;
257+
247258 if ( ! pos ) return null ;
248259
249260 return createPortal (
250- < div
251- className = "z-[9999] flex items-center gap-2 rounded border border-border bg-surface-raised px-2 py-1 text-xs text-foreground shadow-md "
261+ < PopupButtonRow
262+ className = "z-[9999]"
252263 style = { clampOverlayPosition ( { left : pos . x , top : pos . y , width : 340 , height : 32 } ) }
253264 onMouseDown = { ( e ) => e . stopPropagation ( ) }
254265 role = "status"
255266 >
256- < span > Temporary mouse override until mouse-up.</ span >
267+ < span className = "px-1.5 py-0.5" > Temporary mouse override until mouse-up.</ span >
257268 < button
258269 type = "button"
259- className = "m-0 rounded px-1.5 py-0.5 text-xs text-muted hover:bg-foreground/10 hover:text-foreground"
260- onClick = { onMakePermanent }
270+ className = { popupButton ( { tone : 'muted' , flashed : flashed === 'sticky' } ) }
271+ onClick = { ( ) => ! flashed && setFlashed ( 'sticky' ) }
261272 > Make sticky</ button >
262273 < button
263274 type = "button"
264- className = "m-0 rounded px-1.5 py-0.5 text-xs text-muted hover:bg-foreground/10 hover:text-foreground"
265- onClick = { onCancel }
275+ className = { popupButton ( { tone : 'muted' , flashed : flashed === 'cancel' } ) }
276+ onClick = { ( ) => ! flashed && setFlashed ( 'cancel' ) }
266277 > Cancel</ button >
267- </ div > ,
278+ </ PopupButtonRow > ,
268279 document . body ,
269280 ) ;
270281}
@@ -773,9 +784,10 @@ export function TerminalPaneHeader({ api }: IDockviewPanelHeaderProps) {
773784 tooltip = { mouseIconTooltip }
774785 >
775786 < span className = "relative flex items-center justify-center" >
776- < CursorClickIcon size = { 14 } />
777- { inOverride && (
778- < ProhibitIcon size = { 14 } weight = "bold" className = "absolute inset-0 text-accent" />
787+ { inOverride ? (
788+ < SelectionSlashIcon size = { 14 } />
789+ ) : (
790+ < CursorClickIcon size = { 14 } />
779791 ) }
780792 </ span >
781793 </ HeaderActionButton >
0 commit comments