Commit e83d2fe1 authored by Aryan Noshirvnai's avatar Aryan Noshirvnai

Fix RTL layout: sidebar and search icons weren't mirroring to the right

Layout.tsx's desktop sidebar used physical left-0/border-r/ml-64 positioning, which flexbox's automatic RTL mirroring doesn't touch (fixed/absolute offsets and margins are direction-agnostic, unlike flex child ordering). Added rtl: variants so the sidebar, its border, and the main content's clearing margin all flip to the right under dir="rtl". Same fix for the search-icon-in-input pattern on Home.tsx and Library.tsx.
Co-Authored-By: 's avatarClaude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
parent a3d23388
Pipeline #1277 failed with stages
......@@ -90,7 +90,7 @@ export function Layout({ title, children }: { title: string; children: ReactNode
<div className="min-h-screen bg-background text-on-background">
{/* Desktop: 256px fixed sidebar, full nav list (there's room, unlike the mobile tab bar) */}
<aside
className="fixed inset-y-0 left-0 z-10 hidden w-64 flex-col border-r border-outline-variant bg-surface-container-low sm:flex"
className="fixed inset-y-0 left-0 z-10 hidden w-64 flex-col border-r border-outline-variant bg-surface-container-low rtl:left-auto rtl:right-0 rtl:border-r-0 rtl:border-l sm:flex"
style={{ paddingTop: 'env(safe-area-inset-top)' }}
>
<Link to="/home" className="flex items-center gap-2 px-6 py-6 text-lg font-bold tracking-tight text-primary">
......@@ -160,7 +160,7 @@ export function Layout({ title, children }: { title: string; children: ReactNode
</header>
<main
className={`px-4 py-6 transition-[padding] duration-300 ease-out motion-reduce:transition-none sm:ml-64 sm:px-8 sm:py-8 ${currentSong ? 'pb-40 sm:pb-24' : 'pb-24 sm:pb-8'}`}
className={`px-4 py-6 transition-[padding] duration-300 ease-out motion-reduce:transition-none sm:ml-64 sm:px-8 sm:py-8 sm:rtl:ml-0 sm:rtl:mr-64 ${currentSong ? 'pb-40 sm:pb-24' : 'pb-24 sm:pb-8'}`}
>
<div className="mx-auto max-w-2xl sm:max-w-3xl animate-page-enter">
<h1 className="mb-6 text-xl font-semibold tracking-tight sm:text-2xl">{title}</h1>
......
......@@ -79,12 +79,12 @@ export function Home() {
return (
<Layout title={t('title')}>
<div className="relative mb-6">
<Search size={16} strokeWidth={2} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-on-surface-variant" />
<Search size={16} strokeWidth={2} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-on-surface-variant rtl:left-auto rtl:right-3" />
<Input
placeholder={t('search.placeholder')}
value={query}
onChange={(e) => setQuery(e.target.value)}
className="pl-9"
className="pl-9 rtl:pl-3 rtl:pr-9"
aria-label={t('search.placeholder')}
/>
</div>
......
......@@ -214,12 +214,12 @@ export function Library() {
return (
<Layout title={t('title')}>
<div className="relative mb-6">
<Search size={16} strokeWidth={2} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-on-surface-variant" />
<Search size={16} strokeWidth={2} className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-on-surface-variant rtl:left-auto rtl:right-3" />
<Input
placeholder={t('search.placeholder')}
value={query}
onChange={(e) => setQuery(e.target.value)}
className="pl-9"
className="pl-9 rtl:pl-3 rtl:pr-9"
/>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment