Skip to content

Commit 1f47d2f

Browse files
committed
Add more button titles and made image fade slider sticky
1 parent 1d2cce1 commit 1f47d2f

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

web/src/lib/components/diff/ImageDiff.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
</div>
151151
<AddedOrRemovedImageLabel mode="add" dims={dims.b} />
152152
</div>
153-
<div class="mt-4 flex w-full max-w-[280px] items-center rounded-lg bg-neutral p-2.5 shadow-sm">
153+
<div class="sticky bottom-4 mt-4 flex w-full max-w-[280px] items-center rounded-lg bg-neutral p-2.5 shadow-sm">
154154
<Slider.Root type="single" thumbPositioning="exact" bind:value={fadePercent} class="relative flex w-full touch-none items-center select-none">
155155
<span class="relative h-0.5 w-full grow cursor-pointer overflow-hidden rounded-full bg-em-disabled">
156156
<Slider.Range class="absolute h-full bg-primary" />
@@ -160,7 +160,7 @@
160160
</div>
161161
{/snippet}
162162

163-
<div class="flex flex-col items-center justify-center bg-neutral-2 p-4">
163+
<div class="relative flex flex-col items-center justify-center bg-neutral-2 p-4">
164164
{@render modeSelector()}
165165
{#await imageDimensions}
166166
<Spinner />

web/src/routes/diff/FileHeader.svelte

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,15 @@
3737
{:else}
3838
<span class="flex max-w-full flex-wrap items-center gap-0.5 overflow-hidden break-all">
3939
{value.fromFile}
40-
<span class="iconify inline-block text-primary octicon--arrow-right-16"></span>
40+
<span class="iconify inline-block text-primary octicon--arrow-right-16" aria-label="renamed to"></span>
4141
{value.toFile}
4242
</span>
4343
{/if}
4444
{/snippet}
4545

4646
{#snippet collapseToggle()}
4747
<button
48+
title={viewer.collapsed[index] ? "Expand file" : "Collapse file"}
4849
type="button"
4950
class="flex size-6 items-center justify-center rounded-md btn-ghost p-0.5 text-primary"
5051
onclick={(e) => {
@@ -53,20 +54,21 @@
5354
}}
5455
>
5556
{#if viewer.collapsed[index]}
56-
<span aria-label="expand file" class="iconify size-4 shrink-0 text-primary octicon--chevron-right-16"></span>
57+
<span aria-label="expand file" class="iconify size-4 shrink-0 text-primary octicon--chevron-right-16" aria-hidden="true"></span>
5758
{:else}
58-
<span aria-label="collapse file" class="iconify size-4 shrink-0 text-primary octicon--chevron-down-16"></span>
59+
<span aria-label="collapse file" class="iconify size-4 shrink-0 text-primary octicon--chevron-down-16" aria-hidden="true"></span>
5960
{/if}
6061
</button>
6162
{/snippet}
6263

63-
{#snippet popover()}
64+
{#snippet actionsPopover()}
6465
<Popover.Root bind:open={popoverOpen}>
6566
<Popover.Trigger
67+
title="Actions"
6668
class="flex size-6 items-center justify-center rounded-md btn-ghost p-0.5 data-[state=open]:btn-ghost-visible"
6769
onclick={(e) => e.stopPropagation()}
6870
>
69-
<span class="iconify size-4 bg-primary octicon--kebab-horizontal-16"></span>
71+
<span class="iconify size-4 bg-primary octicon--kebab-horizontal-16" aria-hidden="true"></span>
7072
</Popover.Trigger>
7173
<Popover.Portal>
7274
<Popover.Content class="flex flex-col overflow-hidden rounded-sm border bg-neutral text-sm shadow-sm select-none" sideOffset={4}>
@@ -107,7 +109,7 @@
107109
{#if viewer.patchHeaderDiffOnly[index]}
108110
<span class="rounded-sm bg-neutral-3 px-1.5">Patch-header-only diff</span>
109111
{/if}
110-
{@render popover()}
112+
{@render actionsPopover()}
111113
{#if !viewer.patchHeaderDiffOnly[index] || !globalOptions.omitPatchHeaderOnlyHunks || isImage}
112114
{@render collapseToggle()}
113115
{/if}

0 commit comments

Comments
 (0)