diff --git a/client/src/components/Collab/CollabLinks.tsx b/client/src/components/Collab/CollabLinks.tsx index be716b693..f8fd2056e 100644 --- a/client/src/components/Collab/CollabLinks.tsx +++ b/client/src/components/Collab/CollabLinks.tsx @@ -219,13 +219,13 @@ export default function CollabLinks({ tripId }: { tripId: number }) { )} - {/* Content: one chip per link, flowing like tags (see .collab-link-chip). The chip - is the link, with the host beside the title; the actions unfold from its tail. */} -
+ {/* Content: one chip per link, two to a row (see .collab-link-chip). The chip is + the link, with the host beside the title; the actions sit in its tail. */} +
{links.length === 0 ? ( ) : ( -
+
{links.map(link => (
diff --git a/client/src/index.css b/client/src/index.css index 5540f4909..6187b76e3 100644 --- a/client/src/index.css +++ b/client/src/index.css @@ -1375,16 +1375,27 @@ img[alt="TREK"] { justify-content: center; } -/* Shared links in the Collab tab: one chip per link, flowing like tags. The chip is - the link; edit, pin and delete sit quietly in its tail and come forward on hover - or keyboard focus. They keep their width throughout: unfolding them reflowed the - row under the pointer, and a chip that grows as you reach for it is a chip you - cannot catch. */ +/* Shared links in the Collab tab: one chip per link, two to a row across the full + width, one to a row where the panel is narrow. The chip is the link; edit, pin and + delete sit quietly in its tail and come forward on hover or keyboard focus. They + keep their width throughout: unfolding them reflowed the row under the pointer, + and a chip that grows as you reach for it is a chip you cannot catch. */ +.collab-link-grid { + container-type: inline-size; +} +.collab-link-grid__cells { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 8px; +} +@container (max-width: 420px) { + .collab-link-grid__cells { grid-template-columns: minmax(0, 1fr); } +} .collab-link-chip { - display: inline-flex; + display: flex; align-items: center; gap: 6px; - max-width: 100%; + min-width: 0; padding: 5px 8px 5px 5px; border-radius: 999px; background: var(--bg-secondary); @@ -1405,6 +1416,7 @@ img[alt="TREK"] { display: flex; align-items: center; gap: 7px; + flex: 1 1 auto; min-width: 0; color: var(--text-primary); text-decoration: none; @@ -1423,7 +1435,7 @@ img[alt="TREK"] { color: var(--text-faint); } .collab-link-chip__icon img { width: 16px; height: 16px; object-fit: contain; } -.collab-link-chip__text { display: flex; align-items: baseline; gap: 6px; min-width: 0; } +.collab-link-chip__text { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 auto; } .collab-link-chip__title { font-size: calc(12.5px * var(--fs-scale-body, 1)); font-weight: 600; @@ -1431,7 +1443,8 @@ img[alt="TREK"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - max-width: 200px; + flex: 0 1 auto; + min-width: 0; } .collab-link-chip__host { font-size: calc(10.5px * var(--fs-scale-caption, 1)); @@ -1439,7 +1452,9 @@ img[alt="TREK"] { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - max-width: 120px; + flex: 0 1 auto; + min-width: 0; + max-width: 45%; } .collab-link-chip__open { flex: 0 0 auto; @@ -1452,8 +1467,9 @@ img[alt="TREK"] { .collab-link-chip__actions { display: flex; align-items: center; + flex: 0 0 auto; gap: 1px; - margin-left: 2px; + margin-left: auto; opacity: 0.45; transition: opacity 0.15s ease; }