Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/playwright/ui-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ test('renders main wiki shell instead of a white screen', async ({ page }) => {
await expect(page.getByRole('heading', { name: 'GolemCore Brain' })).toBeVisible()
await expect(page.getByRole('banner').getByRole('button', { name: 'Search' })).toBeVisible()
await expect(page.getByTestId('sidebar')).toBeVisible()
await expect(page.getByRole('button', { name: 'Tree' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Tree' })).toBeVisible()

const bodyText = await page.locator('body').innerText()
expect(bodyText.trim().length).toBeGreaterThan(20)
Expand Down
13 changes: 11 additions & 2 deletions frontend/src/components/ModalCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

import * as Dialog from '@radix-ui/react-dialog'
import clsx from 'clsx'
import { X } from 'lucide-react'
import type { PropsWithChildren, ReactNode } from 'react'

Expand All @@ -26,6 +27,8 @@ interface ModalCardProps extends PropsWithChildren {
description?: string
onOpenChange: (open: boolean) => void
footer?: ReactNode
/** Widens the card for side-by-side content such as a conflict diff. */
wide?: boolean
}

export function ModalCard({
Expand All @@ -35,12 +38,18 @@ export function ModalCard({
onOpenChange,
children,
footer,
wide = false,
}: ModalCardProps) {
return (
<Dialog.Root open={open} onOpenChange={onOpenChange}>
<Dialog.Portal>
<Dialog.Overlay className="fixed inset-0 z-40 bg-slate-950/55 backdrop-blur-sm" />
<Dialog.Content className="fixed top-1/2 left-1/2 z-50 max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] max-w-xl -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-[28px] border border-surface-border bg-surface p-6 shadow-2xl outline-none">
<Dialog.Content
className={clsx(
'fixed top-1/2 left-1/2 z-50 max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-[28px] border border-surface-border bg-surface p-6 shadow-2xl outline-none',
wide ? 'max-w-5xl' : 'max-w-xl',
)}
>
<div className="mb-5 flex items-start justify-between gap-4">
<div>
<Dialog.Title className="text-xl font-semibold text-foreground">
Expand All @@ -52,7 +61,7 @@ export function ModalCard({
</Dialog.Description>
) : null}
</div>
<Dialog.Close aria-label="Close dialog" className="rounded-full border border-surface-border p-2 text-muted transition hover:bg-surface-alt hover:text-foreground">
<Dialog.Close aria-label="Close dialog" className="inline-flex min-h-11 min-w-11 shrink-0 items-center justify-center rounded-full border border-surface-border p-2 text-muted transition hover:bg-surface-alt hover:text-foreground md:min-h-0 md:min-w-0">
<X size={16} />
</Dialog.Close>
</div>
Expand Down
Loading
Loading