Skip to content

Commit 0591372

Browse files
fix: prevent long urls in cast embeds from overflowing (#525)
1 parent 28dcd4f commit 0591372

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

.changeset/hungry-actors-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@frames.js/debugger": patch
3+
---
4+
5+
fix(debugger): prevent long urls in cast embeds from overflowing

packages/debugger/app/components/cast-composer.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const CastComposer = React.forwardRef<
7777
{state.embeds.length > 0 ? (
7878
<ul className="flex flex-col gap-2">
7979
{state.embeds.slice(0, 2).map((embed, index) => (
80-
<li key={`${embed}-${index}`}>
80+
<li key={`${embed}-${index}`} className="flex flex-grow">
8181
<CastEmbedPreview
8282
farcasterFrameConfig={farcasterFrameConfig}
8383
onRemove={() => {
@@ -234,20 +234,24 @@ function CastEmbedPreview({
234234
allowPartialFrame
235235
onError={handleFrameError}
236236
/>
237-
<span className="ml-auto truncate text-sm text-slate-400">{url}</span>
237+
<WithTooltip tooltip={url}>
238+
<span className="ml-auto truncate text-sm text-slate-400 max-w-full">
239+
{url}
240+
</span>
241+
</WithTooltip>
238242
</div>
239243
);
240244
}
241245

242246
return (
243-
<span className="flex gap-2 w-full items-center">
244-
<div className="flex flex-grow items-center gap-4 bg-slate-100 p-2 rounded">
245-
<div className="bg-slate-200 rounded p-4">
246-
<GlobeIcon className="flex-shrink-0" />
247-
</div>
248-
<span className="truncate text-sm text-slate-800 flex-grow">{url}</span>
249-
<div className="flex gap-2 text-slate-300">{buttons}</div>
247+
<div className="flex gap-2 w-full max-w-full items-center bg-slate-100 p-2 rounded">
248+
<div className="bg-slate-200 rounded p-4">
249+
<GlobeIcon className="flex-shrink-0" />
250250
</div>
251-
</span>
251+
<WithTooltip tooltip={url}>
252+
<span className="truncate text-sm text-slate-800 flex-grow">{url}</span>
253+
</WithTooltip>
254+
<div className="flex gap-2 text-slate-300">{buttons}</div>
255+
</div>
252256
);
253257
}

0 commit comments

Comments
 (0)