fix(web): stop long tokens and button rows overflowing on mobile
Server Deploy / deploy (push) Successful in 1m40s

Three root causes behind five reported overflows:

- Td below sm is a flex row, and a flex item's default min-width:auto is
  its min-content width. A fingerprint or target URL is one unbreakable
  token, so the value could not shrink and spilled out of the card. The
  value now sits in a min-w-0 break-words wrapper that is display:contents
  above sm, leaving the desktop table untouched. Fixes /keys, /monitors
  and the installed-keys table on /servers/[id] in one place.

- The ESO read URL and the secrets group endpoint are unbreakable tokens
  in prose with the default overflow-wrap:normal. Both paragraphs now
  break-words.

- Three page headers (servers/[id], keys/[id], monitors/[id]) held an
  unwrapped button row. They stack below sm and the clusters wrap. These
  used items-start, which is why the earlier responsive sweep — matching
  items-center — skipped all three; only one was reported.

Verified: tsc clean, next build clean, and the compiled stylesheet confirms
max-sm:min-w-0 / max-sm:break-words land in the below-640px query and
sm:contents in the above-640px one.
This commit is contained in:
mrhid6
2026-07-27 23:28:53 +01:00
parent 14a11886ae
commit 5e326335af
6 changed files with 34 additions and 18 deletions
+14 -2
View File
@@ -106,11 +106,23 @@ export function Td({ className, label, children, ...props }: TdProps) {
{...props}
>
{label && (
<span className="hidden font-mono text-[0.68rem] uppercase leading-5 tracking-[0.13em] text-text-secondary max-sm:inline">
<span className="hidden shrink-0 font-mono text-[0.68rem] uppercase leading-5 tracking-[0.13em] text-text-secondary max-sm:inline">
{label}
</span>
)}
{children}
{/*
* Below sm the cell is a flex row, and a flex item's default
* min-width:auto resolves to its min-content width. A fingerprint or a
* target URL is a single unbreakable token, so min-content was the whole
* string: the value refused to shrink and spilled out of the card.
* min-w-0 lets it shrink, break-words gives the token somewhere to break.
*
* Above sm the wrapper is display:contents, so the desktop table renders
* exactly as it did before. Every other class here is max-sm: scoped on
* purpose — display:contents generates no box, but inherited properties
* (overflow-wrap among them) would still reach the children.
*/}
<span className="max-sm:min-w-0 max-sm:break-words sm:contents">{children}</span>
</td>
);
}