Skip to content

Commit 05bcf21

Browse files
committed
Improve diff load dialog on small screens
Make dialog overflow-y-auto and max-h-svh Enable wrapping on some containers Adjust z-indices
1 parent e687589 commit 05bcf21

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

web/src/routes/diff/LoadDiffDialog.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,10 @@
390390
<Dialog.Trigger class="h-fit rounded-md btn-primary px-2 py-0.5" onclick={() => (dragActive = false)}>Load another diff</Dialog.Trigger>
391391
<Dialog.Portal>
392392
<Dialog.Overlay class="fixed inset-0 z-50 bg-black/50 dark:bg-white/20" />
393-
<Dialog.Content class="fixed top-1/2 left-1/2 z-50 w-192 max-w-[95%] -translate-x-1/2 -translate-y-1/2 rounded-md bg-neutral shadow-md">
394-
<header class="relative flex flex-row items-center justify-between rounded-t-md bg-neutral-2 p-4">
393+
<Dialog.Content
394+
class="fixed top-1/2 left-1/2 z-50 max-h-svh w-192 max-w-[95%] -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-md bg-neutral shadow-md"
395+
>
396+
<header class="sticky top-0 z-10 flex flex-row items-center justify-between rounded-t-md bg-neutral-2 p-4">
395397
<Dialog.Title class="text-xl font-semibold">Load a diff</Dialog.Title>
396398
<Dialog.Close title="Close dialog" class="flex size-6 items-center justify-center rounded-md btn-ghost text-primary">
397399
<span class="iconify octicon--x-16" aria-hidden="true"></span>
@@ -478,7 +480,7 @@
478480

479481
<section class="mb-2">
480482
<h4 class="mb-2 font-semibold">Compare Files</h4>
481-
<div class="flex flex-row items-center gap-1">
483+
<div class="flex flex-wrap items-center gap-1">
482484
<SingleFileSelect bind:file={fileA} placeholder="File A" />
483485
<span class="iconify size-4 shrink-0 octicon--arrow-right-16"></span>
484486
<SingleFileSelect bind:file={fileB} placeholder="File B" />
@@ -495,7 +497,7 @@
495497
it with the above button should be preferred.
496498
</InfoPopup>
497499
</div>
498-
<div class="flex items-center gap-1">
500+
<div class="flex flex-wrap items-center gap-1">
499501
<DirectorySelect bind:directory={dirA} placeholder="Directory A" />
500502
<span class="iconify size-4 shrink-0 octicon--arrow-right-16"></span>
501503
<DirectorySelect bind:directory={dirB} placeholder="Directory B" />
@@ -508,7 +510,7 @@
508510
<Popover.Trigger title="Edit filters" class="flex rounded-r-md btn-primary p-2 data-[state=open]:btn-primary-hover">
509511
<span class="iconify size-4 shrink-0 place-self-center octicon--filter-16" aria-hidden="true"></span>
510512
</Popover.Trigger>
511-
<Popover.Content side="top" class="overflow-hidden rounded-md border bg-neutral">
513+
<Popover.Content side="top" class="z-10 overflow-hidden rounded-md border bg-neutral">
512514
{@render blacklistPopoverContent()}
513515
</Popover.Content>
514516
</Popover.Root>

0 commit comments

Comments
 (0)