Skip to content

Commit 1d5f661

Browse files
committed
Bugfix: Align Size column icons flush with cell right edge
- Switch `.col-size` from `text-align: right` to flex with `justify-content: flex-end` and `gap: var(--spacing-xxs)` - Wrap the size-triad spans in a single `.size-text` span so whitespace text nodes Svelte emits between `{/each}` and the `{#if}` icon blocks stop stealing pixels from the cell (whitespace-only anonymous flex items are `display: none` per the flexbox spec) - Drop `margin-left` / `vertical-align` from `.size-stale` and `.size-mismatch`; flex `gap` and `align-items: center` now handle spacing
1 parent 00c7901 commit 1d5f661

1 file changed

Lines changed: 20 additions & 11 deletions

File tree

apps/desktop/src/lib/file-explorer/views/FullList.svelte

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -593,9 +593,11 @@
593593
>
594594
{#if file.isDirectory}
595595
{#if dirDisplaySize !== undefined}
596-
{#each formatSizeTriads(dirDisplaySize) as triad, i (i)}
597-
<span class={triad.tierClass}>{triad.value}</span>
598-
{/each}
596+
<span class="size-text"
597+
>{#each formatSizeTriads(dirDisplaySize) as triad, i (i)}<span
598+
class={triad.tierClass}>{triad.value}</span
599+
>{/each}</span
600+
>
599601
{#if indexing}
600602
<span class="size-stale icon-indicator" use:tooltip={'Updating index — size may change.'}
601603
><IconHourglass width="12" height="12" /></span
@@ -631,9 +633,11 @@
631633
<span class="size-dir">&lt;dir&gt;</span>
632634
{/if}
633635
{:else if fileDisplaySize !== undefined}
634-
{#each formatSizeTriads(fileDisplaySize) as triad, i (i)}
635-
<span class={triad.tierClass}>{triad.value}</span>
636-
{/each}
636+
<span class="size-text"
637+
>{#each formatSizeTriads(fileDisplaySize) as triad, i (i)}<span
638+
class={triad.tierClass}>{triad.value}</span
639+
>{/each}</span
640+
>
637641
{/if}
638642
</span>
639643
<span class="col-date">{formatDateTime(file.modifiedAt)}</span>
@@ -755,10 +759,19 @@
755759
}
756760
757761
.col-size {
758-
text-align: right;
762+
display: flex;
763+
justify-content: flex-end;
764+
align-items: center;
765+
gap: var(--spacing-xxs);
759766
font-size: var(--font-size-sm);
760767
}
761768
769+
/* Groups the number triads into one flex item so the right-edge alignment is
770+
predictable when the row also has an icon next to the number. */
771+
.size-text {
772+
display: inline;
773+
}
774+
762775
.size-dir {
763776
color: var(--color-text-secondary);
764777
}
@@ -771,16 +784,12 @@
771784
.size-stale {
772785
display: inline-flex;
773786
align-items: center;
774-
vertical-align: middle;
775-
margin-left: var(--spacing-xxs);
776787
cursor: help;
777788
}
778789
779790
.size-mismatch {
780791
display: inline-flex;
781792
align-items: center;
782-
vertical-align: middle;
783-
margin-left: var(--spacing-xxs);
784793
cursor: help;
785794
}
786795

0 commit comments

Comments
 (0)