Skip to content

Commit 78358da

Browse files
committed
fix(athan): bulletproof truncation for long custom-reciter names
The previous fix added min-w-0 + truncate on the inner div/span pair, which is the textbook recipe — but only works if every flex parent above also allows shrinking. The Card, the Label, and the layout's left-rail aside all had no min-w-0 / no overflow-x constraint, so the unbreakable filename string could push them all wider than the intended w-90 column. Belt-and-suspenders fix: * AthanPlayer Card: add `min-w-0 overflow-hidden` so the card can't grow past its parent regardless of contents. * Custom reciter Label: add `min-w-0 overflow-hidden` for the same reason at row level. * LayoutSplit + LayoutSplitArc asides (both rails): add `min-w-0 overflow-x-hidden` so the column stays exactly w-90/w-80 even if a child somehow tries to escape. The inner div + truncate + title attributes from the prior commit are unchanged. Together this is bulletproof: there's no flex ancestor between the truncate span and the column boundary that lacks shrink permission, and the column itself clips horizontal overflow as a final safety net.
1 parent 3dc284f commit 78358da

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

client/src/components/athan/AthanPlayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function AthanPlayer({ settings }: { settings: AppSettings }) {
5454
};
5555

5656
return (
57-
<Card className="flex flex-col gap-4 p-5">
57+
<Card className="flex min-w-0 flex-col gap-4 overflow-hidden p-5">
5858
<div className="text-xs uppercase tracking-[0.18em] text-muted-foreground">
5959
{t('athan.title')}
6060
</div>
@@ -86,7 +86,7 @@ export function AthanPlayer({ settings }: { settings: AppSettings }) {
8686
<Label
8787
key={id}
8888
htmlFor={`reciter-${id}`}
89-
className="flex cursor-pointer items-center gap-3 rounded-md border border-primary/30 bg-primary/5 p-3 hover:bg-primary/10"
89+
className="flex min-w-0 cursor-pointer items-center gap-3 overflow-hidden rounded-md border border-primary/30 bg-primary/5 p-3 hover:bg-primary/10"
9090
>
9191
<RadioGroupItem value={id} id={`reciter-${id}`} />
9292
{/* min-w-0 lets the flex child actually shrink so `truncate`

client/src/components/layouts/LayoutSplit.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function LayoutSplit({
2828
<main className="flex flex-1 overflow-hidden">
2929
{/* Left rail — clock/date + Athan player (the "what's about to play"
3030
channel sits next to the time so the eye stays in one column). */}
31-
<aside className="hidden w-90 shrink-0 overflow-y-auto border-r bg-card/30 p-4 md:block">
31+
<aside className="hidden w-90 min-w-0 shrink-0 overflow-x-hidden overflow-y-auto border-r bg-card/30 p-4 md:block">
3232
<div className="flex flex-col gap-3">
3333
<HijriCard tz={tz} />
3434
<div data-tour="athan-player">
@@ -121,7 +121,7 @@ export function LayoutSplit({
121121
{/* Right rail — Live radio (passive listening). Was on the left
122122
before, but the Athan player belongs next to the next-prayer
123123
countdown; radio is the secondary feature and lives here. */}
124-
<aside className="hidden w-80 shrink-0 overflow-y-auto border-l bg-card/30 p-4 lg:block">
124+
<aside className="hidden w-80 min-w-0 shrink-0 overflow-x-hidden overflow-y-auto border-l bg-card/30 p-4 lg:block">
125125
<div className="flex flex-col gap-3">
126126
<RadioPlayer settings={settings} />
127127
</div>

client/src/components/layouts/LayoutSplitArc.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function LayoutSplitArc({
3333
<main className="flex flex-1 overflow-hidden">
3434
{/* Same rail composition as LayoutSplit — clock + Athan on the left,
3535
Radio on the right. Variant C only differs in the centre. */}
36-
<aside className="hidden w-90 shrink-0 overflow-y-auto border-r bg-card/30 p-4 md:block">
36+
<aside className="hidden w-90 min-w-0 shrink-0 overflow-x-hidden overflow-y-auto border-r bg-card/30 p-4 md:block">
3737
<div className="flex flex-col gap-3">
3838
<HijriCard tz={tz} />
3939
<AthanPlayer settings={settings} />
@@ -93,7 +93,7 @@ export function LayoutSplitArc({
9393
</div>
9494
</section>
9595

96-
<aside className="hidden w-80 shrink-0 overflow-y-auto border-l bg-card/30 p-4 lg:block">
96+
<aside className="hidden w-80 min-w-0 shrink-0 overflow-x-hidden overflow-y-auto border-l bg-card/30 p-4 lg:block">
9797
<div className="flex flex-col gap-3">
9898
<RadioPlayer settings={settings} />
9999
</div>

0 commit comments

Comments
 (0)