From 02aa27dc48e6bb8743605fa85db9c993ebe23d1f Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Sun, 31 May 2026 13:25:33 +0300 Subject: [PATCH] refactor(comparison): drop no-op displayChar mapping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The space→non-breaking-space swap guarded against a lone space collapsing to zero width, but the line container now uses white-space: pre (inherited by Character), so spaces keep their width. The derived had been reduced to a space→space identity; render `char` directly. --- src/widgets/ComparisonView/ui/Character/Character.svelte | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/widgets/ComparisonView/ui/Character/Character.svelte b/src/widgets/ComparisonView/ui/Character/Character.svelte index 175a5f2..9ae91a6 100644 --- a/src/widgets/ComparisonView/ui/Character/Character.svelte +++ b/src/widgets/ComparisonView/ui/Character/Character.svelte @@ -34,7 +34,6 @@ const fontB = $derived(comparisonStore.fontB); let slot = $state<0 | 1>(0); let slotFonts = $state<[string, string]>(['', '']); -const displayChar = $derived(char === ' ' ? ' ' : char); const targetFont = $derived(isPast ? fontA?.name ?? '' : fontB?.name ?? ''); $effect(() => { @@ -63,7 +62,7 @@ $effect(() => { style:position={slot === s ? 'relative' : 'absolute'} aria-hidden={slot !== s ? true : undefined} > - {displayChar} + {char} {/each}