fix(ui): various RTL issues (#774)

This commit is contained in:
Mees Frensel
2026-09-03 08:57:01 -04:00
committed by GitHub
parent fa8955a232
commit 6a5dc00a0a
7 changed files with 36 additions and 13 deletions
@@ -22,7 +22,16 @@
toastManager,
type NavbarProps,
} from '@immich/ui';
import { mdiCodeBraces, mdiCompass, mdiCompassOutline, mdiMenu, mdiNote, mdiNoteOutline } from '@mdi/js';
import {
mdiAlignHorizontalLeft,
mdiAlignHorizontalRight,
mdiCodeBraces,
mdiCompass,
mdiCompassOutline,
mdiMenu,
mdiNote,
mdiNoteOutline,
} from '@mdi/js';
import { MediaQuery } from 'svelte/reactivity';
let { children } = $props();
@@ -42,6 +51,12 @@
commandPaletteManager.setTranslations({
command_palette_prompt_default: 'Quickly find components, links, and commands',
});
let dirIsLtr = $state(true);
$effect(() => {
document.dir = dirIsLtr ? 'ltr' : 'rtl';
});
</script>
<AppShell>
@@ -64,6 +79,14 @@
</ControlBarHeader>
<ControlBarOverflow>
<CommandPaletteButton />
<IconButton
shape="round"
variant="ghost"
size="medium"
aria-label="Switch between LTR and RTL text direction"
icon={dirIsLtr ? mdiAlignHorizontalLeft : mdiAlignHorizontalRight}
onclick={() => (dirIsLtr = !dirIsLtr)}
/>
<ThemeSwitcher size="medium" />
</ControlBarOverflow>
</ControlBar>
@@ -34,7 +34,7 @@ This is ~~strike-through~~
This is `code`
#### Headers can also container `code`
#### Headers can also contain `code`
### Link
@@ -55,7 +55,7 @@
<Card class="relative">
<div class="text-sm">
{#if canCopy}
<span class="absolute top-2 right-2 {zIndex.CodeBlockCopyButton} cursor-pointer">
<span class="absolute top-2 inset-e-2 {zIndex.CodeBlockCopyButton} cursor-pointer">
<IconButton
icon={copied ? mdiCheckCircle : mdiContentCopy}
size="small"
@@ -31,7 +31,7 @@
variants: {
padding: {
base: 'px-4',
icon: 'pl-4',
icon: 'ps-4',
},
},
});
@@ -14,7 +14,7 @@
<TooltipProvider>
<div
class={cleanClass(
isEmpty ? 'hidden' : 'absolute top-0 right-0 flex flex-col items-end justify-end gap-2 p-4',
isEmpty ? 'hidden' : 'absolute top-0 inset-e-0 flex flex-col items-end justify-end gap-2 p-4',
zIndex.ToastPanel,
className,
)}
+4 -4
View File
@@ -104,12 +104,12 @@
giant: 'h-12',
},
leadingPadding: {
base: 'pl-4',
icon: 'pl-0',
base: 'ps-4',
icon: 'ps-0',
},
trailingPadding: {
base: 'pr-4',
icon: 'pr-0',
base: 'pe-4',
icon: 'pe-0',
},
roundedSize: styleVariants.inputRoundedSize,
},
+4 -4
View File
@@ -125,12 +125,12 @@ export const inputStyles = tv({
variants: {
textSize: styleVariants.textSize,
leadingPadding: {
base: 'pl-4',
icon: 'pl-0',
base: 'ps-4',
icon: 'ps-0',
},
trailingPadding: {
base: 'pr-4',
icon: 'pr-0',
base: 'pe-4',
icon: 'pe-0',
},
roundedSize: {
tiny: 'rounded-lg',