Show notifications above floating terminal (#4320)
This commit is contained in:
@@ -510,6 +510,11 @@ function getPanelStyleBounds(element: unknown): FloatingTerminalPanelBounds {
|
||||
}
|
||||
}
|
||||
|
||||
function getPanelClassName(element: unknown): string {
|
||||
const panel = findByProp(element, 'data-floating-terminal-panel')
|
||||
return panel.props.className as string
|
||||
}
|
||||
|
||||
function getMockedLocalStorage(): {
|
||||
getItem: ReturnType<typeof vi.fn>
|
||||
setItem: ReturnType<typeof vi.fn>
|
||||
@@ -618,6 +623,12 @@ describe('FloatingTerminalPanel close behavior', () => {
|
||||
expect(getPanelStyleBounds(element)).toEqual(savedBounds)
|
||||
})
|
||||
|
||||
it('layers below root notification cards', async () => {
|
||||
const element = await renderPanel(true)
|
||||
|
||||
expect(getPanelClassName(element)).toContain('z-30')
|
||||
})
|
||||
|
||||
it('falls back to default bounds when persisted geometry is malformed', async () => {
|
||||
getMockedLocalStorage().getItem.mockImplementation((key: string) =>
|
||||
key === FLOATING_TERMINAL_PANEL_BOUNDS_STORAGE_KEY
|
||||
|
||||
@@ -1219,12 +1219,14 @@ export function FloatingTerminalPanel({
|
||||
}, [])
|
||||
|
||||
return (
|
||||
// Why: root notification cards use z-40; keep the floating workspace below
|
||||
// them so alerts are never hidden behind an open terminal panel.
|
||||
<div
|
||||
ref={setPanelNode}
|
||||
data-floating-terminal-panel
|
||||
aria-hidden={!open}
|
||||
tabIndex={-1}
|
||||
className={`fixed z-50 flex min-h-[280px] min-w-[420px] overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-[0_10px_24px_rgba(0,0,0,0.18)] outline-none ${open ? 'opacity-100' : 'invisible pointer-events-none opacity-0'}`}
|
||||
className={`fixed z-30 flex min-h-[280px] min-w-[420px] overflow-hidden rounded-lg border border-border bg-card text-card-foreground shadow-[0_10px_24px_rgba(0,0,0,0.18)] outline-none ${open ? 'opacity-100' : 'invisible pointer-events-none opacity-0'}`}
|
||||
style={{
|
||||
visibility: open ? 'visible' : 'hidden',
|
||||
left: bounds.left,
|
||||
|
||||
Reference in New Issue
Block a user