Skip to content

fix(workspace): a project's Needs you row stays inside its card (#3994) - #3997

Merged
vybe merged 2 commits into
devfrom
fix/3994-needs-you-row-overflow
Oct 29, 2026
Merged

vybe merged 2 commits into
devfrom
fix/3994-needs-you-row-overflow

Conversation

@dolho

@dolho dolho commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

On a Workspace project's Overview, a row in the Needs you card drew its relative time (just now) past the card's right border.

Cause: in ProjectNeedsYou.vue the row's agent name, kind label and time were all shrink-0. In the narrow right column their total width exceeded the card, and truncate never engaged because nothing was allowed to shrink — despite the comment saying "the rest truncates".

Fix: the time keeps its width; the kind label (min-w-0 truncate) gives way first, then the agent name (min-w-0 shrink-[0.25], still capped at 60%).

Verification

  • Checked in the running Workspace at 1100, 1280 (dark) and 1440 px: the time sits inside the border, the label truncates (NEEDS A…), the agent name keeps most of its width.
  • Layout isn't measurable in the jsdom unit harness, so there is no new unit test; existing Needs you specs and the raw-colour ratchet pass (43 tests).

Found while testing abilityai/trinity-enterprise#980 (#3996), shipped separately to keep that PR's scope.

Fixes #3994

🤖 Generated with Claude Code

The row's agent name, kind label and time were all shrink-0, so in the
narrow right column their total width exceeded the card and the time was
drawn past its border; `truncate` never engaged because nothing could shrink.
The time keeps its width; the kind label gives way first, then the agent name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dolho dolho added the ui PR touches the frontend UI — triggers Playwright e2e tests label Oct 27, 2026

@AndriiPasternak31 AndriiPasternak31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 7a641d4170d456ff789edee19f221de2063be842.

Thanks for catching this. The scenario in the issue is fixed: compliance-steward / Needs approval / just now stays inside the row at every side-column width I tried. Before this change the time ran 48–101px past the row's border. Two of the issue's acceptance criteria still fail, though, and both come down to how line 72 is built. Requesting changes for that.

How I checked. I mounted ProjectNeedsYou inside BaseCard (as ProjectNeedsYouCard does) at fixed card widths in Chromium, in light and dark, and measured each span's box against the row's bordered box. Widths: 213, 237/239, 260, 270, 280, 299, 309px. That is the range the Overview's side column covers at lg. I worked it out from ProjectPage.vue's max-w-5xl sm:px-8 + lg:grid-cols-3 gap-4 with the default 18rem sidebar and no rail open: about 213px at a 1024px viewport, about 239px at 1100, about 299px at 1280, and 309px from about 1312 up. I took that mapping from the classes and did not confirm it in the running Workspace. An open rail or a wider sidebar makes the column narrower still. Layout is the same in both themes. The text colours are unchanged (meta text is gray-500 in light, gray-400 in dark).

Also run at this head: the full frontend unit suite (411 files / 6443 tests) passes, as do the raw-colour, loading-gate and source-text ratchets. The diff adds no palette classes.

Blocking

1. A long agent name still pushes the time past the row's border. src/frontend/src/components/portal/projects/ProjectNeedsYou.vue:72

When the name is wider than 60% of the row, max-w-[60%] clamps it, and Chromium holds it at that cap. It never shrinks below 60%, so shrink-[0.25] does nothing for exactly the names that need it. The kind label drops to 0px, and the line is still 60% + time + gaps wide. Measured with customer-onboarding-compliance-steward:

card width 3 hours ago 45 minutes ago
213px 12px past the row border 34px past
239px 2px past 23px past (about 7px beyond the card itself)
270px fits 11px past
299px fits fits (0.7px spare)

So at a 1024–1280px viewport, an ask from an agent with a long name, raised in the last hour, overflows the same way the issue reports. That fails AC 1: "never exceeds its card at any width … the time always stays fully visible".

2. Both spans shrink at the same time, not "kind label first, then the agent name". ProjectNeedsYou.vue:72-73, and the comment at 68-71 that promises this order.

Flex shrinking is proportional: every shrinkable item gives up space at once, weighted by flex-shrink × its own width. With shrink-[0.25] on the name and 1 on the label, the name starts truncating at the first pixel of overflow, while the label still has room.

  • 309px card (widest column, ≥1312px viewport): compliance-steward renders at 121 of 135px (compliance-ste…), and NEEDS A… still has 63px. Your 1440px check shows the same thing ("the agent name keeps most of its width").
  • 213px card: scout truncates (35 of 37px) while QUESTION still has 53px.

The AC asks for this order explicitly, and the Inbox row's own comment (PortalInboxList.vue:75-77, "a long title left the agent at 1–7 characters") is why it matters.

One shape that does give the order, which I measured: leave the name at the default shrink (min-w-0 max-w-[60%] truncate) and give the label a zero basis capped at its content (min-w-0 flex-[1_1_0%] max-w-max truncate). The label then takes only leftover space. The name shrinks only after the label is gone. The time keeps ml-auto, so the row looks the same when everything fits. Results across 213–309px:

  • compliance-steward is shown in full at 299 and 309 while the label truncates.
  • scout is shown in full at 213.
  • Both long-name rows above stay inside the border at every width.

Any shape that meets the AC is fine.

3. A pending row with a sync badge still overflows. ProjectNeedsYou.vue:76-81

BaseBadge is whitespace-nowrap and has no min-w-0, so it never shrinks. Once the name and label have given up what they can, the time is pushed out.

  • Waiting (the aging badge, which is on exactly the asks that have sat in Needs you a while): 57 / 37 / 14px past the row border at 213 / 239 / 270px. It fits from about 299px.
  • Changed by the agent / Closed by the agent / Gone from the agent (about 156px): 47–119px past at every width from 213 to 309px. The alternative in finding 2 does not fix this either. It still overflows below about 280px.

This was already the case before the change, and the issue's Cause section names only the three spans. But AC 1 says "at any width", and this is the same row. Either handle the badge here (let it shrink and truncate, since it already has a title, or move it off the first line), or narrow AC 1 on #3994 and file the badge case as its own issue. Both are fine with me. As written, the AC isn't met.

Non-blocking

4. The kind can disappear with no ellipsis and no way to recover it. ProjectNeedsYou.vue:73

With min-w-0 the label can reach 0px. That happens at 213–270px for any name over 60%: Needs approval vs Question is simply gone, with no …. Neither truncating span has a title, so neither the kind nor the full agent name is available on hover. The DOM still has the full text for screen readers. A :title on both spans would cover sighted users. The name losing its hover text predates this PR, but this change is what makes the kind vanish.

5. No regression test. jsdom can't measure layout, but the e2e suite already pins this class of defect by measuring boxes across a list of widths (e2e/dashboard-stats-overflow.spec.js, #1830). A spec that renders this card at the lg widths with a long agent name and a long relative time, and asserts the time's right edge stays inside the row, would have caught finding 1. Not blocking on its own, but it is the only thing that keeps this fixed.

Scope

One file, only the row's first line. Nothing outside #3994.

rest truncates. The time never shrinks; the kind label gives way
first, then the agent name (#3994 — all three were shrink-0, so
in the narrow column the row overflowed its card). -->
<span class="min-w-0 shrink-[0.25] max-w-[60%] text-sm font-medium truncate text-gray-900 dark:text-gray-100">{{ row.agent_name }}</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking (findings 1 and 2 in the review). When the name is wider than 60%, max-w-[60%] clamps it, and it is held at that cap. It never shrinks below it, so with customer-onboarding-compliance-steward the time still runs 12–34px past the row border at 213–239px card widths. Separately, shrink-[0.25] makes the name shrink at the same time as the label, not after it: at a 309px card compliance-steward is already compliance-ste… while the label has 63px left. Measured alternative that gives the AC's order: min-w-0 max-w-[60%] truncate here, and min-w-0 flex-[1_1_0%] max-w-max truncate on the label.

first, then the agent name (#3994 — all three were shrink-0, so
in the narrow column the row overflowed its card). -->
<span class="min-w-0 shrink-[0.25] max-w-[60%] text-sm font-medium truncate text-gray-900 dark:text-gray-100">{{ row.agent_name }}</span>
<span class="min-w-0 truncate text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">{{ kindLabel(row.kind) }}</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (finding 4). With min-w-0 this can reach 0px: at 213–270px with a long agent name, the kind is gone entirely, with no ellipsis. Consider :title here and on the agent name so the truncated text can be recovered on hover.

<span class="min-w-0 truncate text-xs uppercase tracking-wide text-gray-500 dark:text-gray-400">{{ kindLabel(row.kind) }}</span>
<!-- #2915 / ent#610 B5: the Workspace's coarse sync badge, only
while pending — the same rule as the ask card's header. -->
<BaseBadge

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking under AC 1's "at any width" (finding 3). BaseBadge is whitespace-nowrap with no min-w-0, so it never shrinks. With Waiting the time is 14–57px past the row border at 213–270px. With Changed by the agent it overflows at every side-column width. This predates the PR. Fixing it here or narrowing #3994's AC with a follow-up are both fine.

#3994)

Review follow-up on #3997.

- The agent name drops shrink-[0.25] (it was held at its 60% cap and never
  shrank below it), and the kind label takes a zero basis capped at its
  content (flex-[1_1_0%] max-w-max). The label now gives way first and the
  name truncates only once the label is gone, as the AC orders.
- The sync badge moves to the wrapping action line, as on the Inbox row:
  "Changed by the agent" (~156px) is wider than the first line leaves in
  the side column. It can shrink and truncates there, keeping its title.
- Agent name and kind label carry :title so truncated text is recoverable.
- e2e/project-needs-you-overflow.spec.js measures every row against its
  border at card widths 213-309px in both themes (data via page.route).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dolho

dolho commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the measurements, @AndriiPasternak31. All five are addressed in 179006b.

How I checked. I mounted ProjectNeedsYou inside BaseCard in Chromium at fixed card widths of 213, 239, 270, 299 and 309px, in light and dark. Each case used 45 minutes ago. Numbers are px; a negative value means inside. The layout is the same in both themes, so each row below covers both.

1. A long name pushes the time out: fixed. I removed shrink-[0.25] and used your shape: min-w-0 max-w-[60%] truncate on the name, min-w-0 flex-[1_1_0%] max-w-max truncate on the label. With customer-onboarding-compliance-steward, the time's right edge sits 12px inside the row border at every width, which is exactly the row's px-3 padding. The name is 46 / 72 / 103 / 132 / 142px wide (of 286px).

2. Truncation order: fixed by the same change. The label now takes only leftover space.

card compliance-steward name / label scout name / label
213 46/135 · 0/105 36/36 (full) · 10/63
239 72/135 · 0/105 36/36 · 36/63
270 103/135 · 0/105 36/36 · 63/63
299 132/135 · 0/105 36/36 · 63/63
309 135/135 (full) · 7/105 36/36 · 63/63

In my Chromium, compliance-steward is 3px short of full width at 299 and shown in full from 309. You saw it in full at 299 too; the difference is probably fonts. In every case, the name truncates only once the label is at 0.

3. Badge overflows: fixed in this PR. The badge moved off the first line, onto the wrapping action line next to Answer / Open in Inbox. That is where the Inbox row puts its badges. Even a 156px badge can't share the first line with the name and the time in the side column. The badge is now min-w-0 max-w-full and its label is a truncate span, so it shrinks if the card is narrower than the badge itself. The full reason is still on its title. BaseBadge itself is unchanged.

  • Waiting: 73px wide, with 80 to 176px to spare at 213 to 309.
  • Changed by the agent: 153 to 154px, fitting exactly at 213 (it clips its last character there) and with 25 to 95px to spare from 239 up. At 180px it truncates to 120px and stays inside.
  • The time stays 12px inside the border in every badge case.

4. Hover text: done. The agent name and the kind label both get a :title. The unit test checks for both.

5. Regression test: added as e2e/project-needs-you-overflow.spec.js, modelled on #1830.

  • It serves the project, the asks and the roster's projects_available through page.route, so it needs no fixture project, entitlement or portal email.
  • It sets the card to each of the five widths, in both themes, and asserts three things for five rows (long name; long name + Waiting; long name + Changed by the agent; compliance-steward; scout): no element passes the row border, the time is never clipped, and the name is never truncated while the label still has width.
  • It's tagged @interactive, like the spec it's modelled on, and skips if the project page doesn't render.
  • Locally (Vite dev server on this branch, proxied to a running stack) it passes in both themes. Against the previous head, 7a641d4, it fails with 20 findings, including e2e-a @ 213px runs 33.8px past its border (your 34px), e2e-c 157 to 195px past, and e2e-e @ 213px — the agent name truncates while the kind label still has 16px.

I also added a jsdom unit test in projectNeedsYou.mount.spec.js. It pins the structure: three spans on the first line, the badge on the action line, and the titles present.

Tests. npm run test:unit: 6443 of 6444 pass. The raw-colour and loading-gate ratchets are green, and the change adds no palette classes. The one failure is mobileAdminQueueWalk3302.spec.js, which hits a 5s timeout when the whole suite runs on a loaded machine and passes on its own (4/4). It's outside this change.

🤖 Generated with Claude Code

@AndriiPasternak31 AndriiPasternak31 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at 179006b1836b16a24356edd89c6092b3fc77444b.

Thanks for the follow-up. The three blocking findings are fixed, and I measured each one on this head. Approving. Two small things are left under Non-blocking; neither holds this up.

How I checked. Same method as last time. I mounted ProjectNeedsYou inside BaseCard at fixed card widths in headless Chromium, in light and dark, and measured every element's visible box against the row's bordered box. I also mounted 7a641d417 next to it to check that the method still gives my old numbers. It does: the long name ran 33.7 / 23.3 / 10.9px past the border at 213 / 239 / 270. I swept 160, 170, 180, 200, 213, 239, 260, 270, 280, 299, 309, 343, 500, 700 and 900px with your five rows plus six more:

  • Answer not delivered
  • a 61-character name with a 200-character unbroken title
  • an unknown raw kind
  • a date older than a week (10/16/2026) with Waiting
  • just now
  • Gone from the agent

Both themes give identical geometry. Also run at this head: the full frontend unit suite (411 files / 6444 tests, including mobileAdminQueueWalk3302), the raw-colour, loading-gate and source-text ratchets, and check:tokens. All pass, and the branch merges cleanly into current dev. I listed the new e2e spec, but I did not run it, because it needs a live stack.

Fixed

1. Long name. ProjectNeedsYou.vue:74-77. With customer-onboarding-compliance-steward / 45 minutes ago, the time ends exactly on the content edge, 12px inside the border, at 213, 239, 270, 299 and 309. Nothing in any row crosses its border from 155px up.

2. Order. ProjectNeedsYou.vue:78-81. Your table matches mine: compliance-steward 46 / 72 / 103 / 132 / 135px with the kind at 0 until 309, and scout in full at every width. In 330 measured rows the name never truncates below its cap while the kind still has width. Where the name is truncated with a kind sliver beside it, it is at its 60% cap (for example compliance-steward / just now at 239–280). That is the intended shape.

3. Badge. ProjectNeedsYou.vue:93-106. On the action line, every badge stays inside the border at every width. Changed by the agent is in full from 239. At 213 it truncates to Changed by the ag… (three characters, not one), and the title still has the full text.

5. Regression test. The e2e sweep plus the structural unit test (projectNeedsYou.mount.spec.js:110, passes). I couldn't run the e2e sweep here. One note for later: worstPastBorder uses raw descendant edges, so a long unbroken title would trip it falsely (it gave me 1273px). The titles in it now are short, so it's correct as written.

Non-blocking

4. The kind's title can't be hovered when the kind is hidden. ProjectNeedsYou.vue:80. With a long name, the kind is 0px wide at every side-column width (213–309). At 239 its box is width: 0, and Playwright reports it not visible and can't hover it. So the case this was meant to cover, Needs approval vs Question gone from the row, still has no hover. The name's title works. One option is to put the kind in the name's title (customer-onboarding-compliance-steward · Needs approval), since that is the box that is always there.

6. A cut letter instead of an ellipsis. When the kind is left with 6–9px, the … doesn't fit and half a Q or N shows. This happens with scout at 213, with compliance-steward / just now at 239 (the issue's own case), and with a long name at a 343px phone card. 7a641d417 does it too, so this commit didn't introduce it. Fine to leave, or handle it together with 4.

The floor, for the record. Below about 167px card width the name is 0px. Below about 155px, 45 minutes ago crosses the border (4.9px past at 150). That takes a sidebar dragged to about 450px at a 1024px viewport. Any row whose time never shrinks has a floor like this, and I'm not asking for a change.

Scope

Same file, plus the e2e and unit specs. BaseBadge is unchanged. Nothing outside #3994.

@vybe
vybe merged commit d776fd7 into dev Oct 29, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui PR touches the frontend UI — triggers Playwright e2e tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants