Merge pull request #1296 from warmbly/feat/store-ui-no-truncation

feat: store text wraps instead of truncating
This commit is contained in:
Matthew Meszaros
2026-11-20 13:45:03 +01:00
committed by GitHub
4 changed files with 15 additions and 12 deletions
@@ -155,12 +155,12 @@ export default function DomainSearch({
animate="show"
variants={{ hidden: {}, show: { transition: { staggerChildren: reduced ? 0 : 0.04, delayChildren: reduced ? 0 : 0.03 } } }}
// Hairline dividers come from the gap, so the rows read the same in one column or two.
className={cn("grid gap-px 2xl:grid-cols-2 rounded-xl border border-slate-200 overflow-hidden bg-slate-100 transition-opacity", settling && "opacity-70")}
className={cn("grid gap-px rounded-xl border border-slate-200 overflow-hidden bg-slate-100 transition-opacity", shown.length > 1 && "2xl:grid-cols-2", settling && "opacity-70")}
>
{shown.map((r) => (
<ResultRow key={r.domain} r={r} added={inOrder(r.domain)} onToggle={() => onToggle(r)} atCost={atCost} />
))}
{shown.length % 2 === 1 && <li aria-hidden="true" className="hidden 2xl:block bg-white" />}
{shown.length > 1 && shown.length % 2 === 1 && <li aria-hidden="true" className="hidden 2xl:block bg-white" />}
</motion.ul>
<div className="mt-2 flex flex-wrap items-start gap-x-4 gap-y-1.5">
{results && results.length > FIRST_RESULTS && !showAll && (
@@ -206,13 +206,13 @@ function ResultRow({ r, added, onToggle, atCost }: { r: DomainSearchResult; adde
<span className="font-semibold">{stem}</span>
<span className={cn("whitespace-nowrap", r.available ? "text-slate-500" : undefined)}>{tld}</span>
</div>
<div className="flex items-center gap-1.5 min-w-0 text-[11px] text-slate-500">
<div className="flex flex-wrap items-center gap-x-1.5 gap-y-0.5 min-w-0 text-[11px] text-slate-500">
{r.exact && (
<span className="shrink-0 h-4 px-1.5 rounded-full bg-sky-50 border border-sky-100 text-sky-700 text-[10px] font-medium inline-flex items-center">
Exact match
</span>
)}
<span className="truncate">
<span>
{r.available
? `${(r.years ?? 1) > 1 ? `First ${r.years} years, then ` : "Renews at "}${fmtYearly(r.renew_micros)}${atCost ? " · at cost" : ""}`
: (REASON[r.reason ?? ""] ?? "Unavailable")}
@@ -331,7 +331,7 @@ function Lines({ cart, prices, checkout, monthlyMicros }: { cart: Cart; prices:
>
<div className="py-2.5">
<div className="flex items-baseline justify-between gap-3">
<span className="min-w-0 truncate text-[12.5px] font-medium text-slate-900">{d.domain}</span>
<span className="min-w-0 [overflow-wrap:anywhere] text-[12.5px] font-medium text-slate-900">{d.domain}</span>
{d.kind === "owned" ? <span className="text-[11.5px] text-slate-400 shrink-0">Yours</span> : <Amount micros={domainAmount} pending={checkout.quoteLoading} />}
</div>
{d.kind === "new" && (
@@ -77,10 +77,10 @@ export default function PatternPicker({
initial={reduced ? { opacity: 0 } : { opacity: 0, scale: 0.85 }}
animate={{ opacity: 1, scale: 1 }}
exit={reduced ? { opacity: 0 } : { opacity: 0, scale: 0.85, transition: { duration: 0.1 } }}
className="h-6 pl-1 pr-2 rounded-md bg-slate-100/80 border border-slate-200/70 inline-flex items-center gap-1 max-w-full"
className="min-h-6 pl-1 pr-2 rounded-md bg-slate-100/80 border border-slate-200/70 inline-flex items-center gap-1 max-w-full"
>
<span className="size-4 rounded bg-white text-[9.5px] font-semibold text-slate-500 tabular-nums inline-flex items-center justify-center shrink-0">{i + 1}</span>
<span className="truncate text-[12px] font-medium text-slate-800">{patternExample(sample, p)}@</span>
<span className="text-[12px] font-medium text-slate-800 [overflow-wrap:anywhere]">{patternExample(sample, p)}@</span>
</motion.span>
))}
</AnimatePresence>
@@ -99,7 +99,7 @@ export default function PatternPicker({
exit={{ opacity: 0, y: placement === "top" ? 4 : -4 }}
transition={{ duration: 0.12 }}
className={cn(
"absolute left-0 z-30 w-[min(340px,calc(100vw-32px))] rounded-md border border-slate-200 bg-white shadow-[0_12px_32px_-8px_rgba(15,23,42,0.18)] overflow-hidden",
"absolute left-0 z-30 w-[min(380px,calc(100vw-32px))] rounded-md border border-slate-200 bg-white shadow-[0_12px_32px_-8px_rgba(15,23,42,0.18)] overflow-hidden",
placement === "top" ? "bottom-full mb-1" : "top-full mt-1",
)}
>
@@ -129,11 +129,14 @@ export default function PatternPicker({
e.preventDefault();
move(p, e.key === "ArrowUp" ? -1 : 1);
}}
className="flex-1 min-w-0 h-8 px-1.5 rounded flex items-center gap-2 text-left outline-none hover:bg-slate-100 focus-visible:bg-slate-100 transition-colors"
className="flex-1 min-w-0 min-h-8 py-1 px-1.5 rounded flex items-center gap-2 text-left outline-none hover:bg-slate-100 focus-visible:bg-slate-100 transition-colors"
>
<CheckSquare checked={on} tone="slate" />
<span className="min-w-0 truncate text-[12.5px] font-medium text-slate-800">{patternExample(sample, p)}@</span>
<span className="ml-auto pl-2 truncate text-[11px] text-slate-400">{on ? ordinal(at + 1) : PATTERN_NAMES[p]}</span>
{/* Nothing here truncates: the address is what the person is choosing, so a long one wraps. */}
<span className="min-w-0 flex-1 flex flex-col">
<span className="text-[12.5px] font-medium text-slate-800 [overflow-wrap:anywhere]">{patternExample(sample, p)}@</span>
<span className="text-[11px] text-slate-400 leading-snug">{on ? `${ordinal(at + 1)} · ${PATTERN_NAMES[p]}` : PATTERN_NAMES[p]}</span>
</span>
</button>
{on && value.length > 1 && (
<span className="flex items-center shrink-0">
+1 -1
View File
@@ -191,7 +191,7 @@ export default function Senders({
<div className="min-w-0">
<span className="flex items-baseline gap-1.5 mb-1 min-w-0">
<span className="text-[11px] text-slate-500 shrink-0">Addresses</span>
<span className="text-[11px] text-slate-400 truncate">Patterns turn each name into an address, used in this order</span>
<span className="text-[11px] text-slate-400 leading-snug">Patterns turn each name into an address, used in this order</span>
</span>
<PatternPicker
value={patterns}