diff --git a/src/app/(dashboard)/layout.tsx b/src/app/(dashboard)/layout.tsx index fbd1459ac..2f586137d 100644 --- a/src/app/(dashboard)/layout.tsx +++ b/src/app/(dashboard)/layout.tsx @@ -11,7 +11,8 @@ export default function Layout({
-
+ {/* isolate keeps in-page stacking (logs tab) from covering sidebar flyouts */} +
{children}
diff --git a/src/components/logs-viewer/LogsDrawer.test.tsx b/src/components/logs-viewer/LogsDrawer.test.tsx new file mode 100644 index 000000000..15a21ff24 --- /dev/null +++ b/src/components/logs-viewer/LogsDrawer.test.tsx @@ -0,0 +1,37 @@ +import { cleanup, render, screen, waitFor } from '@testing-library/react'; +import { afterEach, describe, expect, it, vi } from 'vitest'; +import { LogsDrawer } from './LogsDrawer'; + +vi.mock('next/navigation', () => ({ + usePathname: () => '/settings/general', +})); + +vi.mock('@/lib/observability/lokiAvailability.actions', () => ({ + getLokiAvailability: vi.fn(async () => ({ state: 'unreachable' })), +})); + +vi.mock('@/lib/loki/requests', () => ({ + getLogsLevels: vi.fn(async () => []), + getLogsQueryRange: vi.fn(async () => []), + getModules: vi.fn(async () => []), +})); + +afterEach(() => { + cleanup(); +}); + +describe('LogsDrawer', () => { + it('keeps the closed-tab trigger below overlay z-index', async () => { + render( +
+ +
+ ); + + const trigger = await waitFor(() => + screen.getByRole('button', { name: /logs/i }) + ); + expect(trigger.className).toMatch(/\bz-20\b/); + expect(trigger.className).not.toMatch(/\bz-40\b/); + }); +}); diff --git a/src/components/logs-viewer/LogsDrawer.tsx b/src/components/logs-viewer/LogsDrawer.tsx index f119f1b8b..b2072dd27 100644 --- a/src/components/logs-viewer/LogsDrawer.tsx +++ b/src/components/logs-viewer/LogsDrawer.tsx @@ -126,7 +126,7 @@ export function LogsDrawer() {