Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .changeset/37534-approvals-inbox-columns-wrap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@object-ui/console': patch
---

fix(console): the approvals inbox's pinned Approve / Reject column no longer covers the Submitted column, and record names read in full at common desktop widths

Clause-②: no
Metadata-protocol: none

In the approvals inbox's desktop table the Request, Record and Requester columns now wrap their text instead of holding it on one line. Before, a one-line request label and requester name set minimum widths that, with the fixed Status and Submitted widths and the pinned Approve / Reject buttons, were wider than a 928 px or 1102 px card: the table overflowed, the pinned column sat over the Submitted column at rest, and the record name was cut to a few words.

From a 928 px card up the table now fits, so the pinned column covers no other column; narrower, the table still scrolls sideways under the pinned column. A record name wraps to two lines and is clamped after that, with its full text in the hover tooltip as before. A requester's "You submitted this" badge moves under the name when the column is narrow. Nothing to migrate.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* Approvals Inbox — the Approve / Reject column is pinned right and a long
* record title truncates (objectui#12816).
* record title is clamped (objectui#12816).
*
* Measured at 1024 px (HotCRM, three account approvals titled like
* "ACC-000011 - Contoso Pharmaceuticals and Life Sciences Group"): the table
Expand All @@ -12,7 +12,8 @@
* past the card's right edge.
*
* - The Record cells are `max-w-0`: the title no longer sizes its column, so
* it truncates, its full text in `title`. The header keeps a floor.
* it wraps to two lines and is then clamped, its full text in `title`. The
* header keeps a floor.
* - The Approve / Reject cells are pinned right in the header and every row,
* with the shared seam shadow (`PINNED_RIGHT_SEAM_SHADOW_CLASSES`), inside
* the overflow box's `seam="pinned"` mode.
Expand Down Expand Up @@ -184,14 +185,16 @@ describe('Approvals Inbox — pinned Approve / Reject, truncating Record (object
}
});

it('truncates a 60-character record title instead of letting it size the column', async () => {
it('clamps a 60-character record title instead of letting it size the column', async () => {
const box = await renderAt718();
expect(LONG).toHaveLength(60);
const link = screen.getByRole('link', { name: LONG });
// The link is still the whole title, and carries it in full.
expect(link).toHaveAttribute('title', LONG);
expect(link).toHaveTextContent(LONG);
expect(link.querySelector('span')).toHaveClass('truncate');
// objectstack#37534: two lines, then clamped (the geometry is measured in
// `e2e/approvals-inbox-desktop-columns-37534.spec.ts`).
expect(link.querySelector('span')).toHaveClass('line-clamp-2');
// The cell takes the title's unbreakable width out of the table's column
// sizing, so the table does not widen for it; the header keeps a floor.
expect(link.closest('td')).toHaveClass('max-w-0');
Expand Down
34 changes: 23 additions & 11 deletions ui/apps/console/src/pages/system/ApprovalsInboxPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,13 @@ type Translate = (key: string, defaultValue: string, opts?: Record<string, unkno
*/

function RequestCell({ r, tr }: { r: ApprovalRequestRow; tr: Translate }) {
// The label and step wrap rather than truncate: a one-line label's
// unbreakable width would size this column and push the table past its card
// (see the column heads in the page body).
return (
<div className="min-w-0">
<div className="font-medium truncate">{processLabel(r)}</div>
<div className="text-xs text-muted-foreground truncate">
<div className="font-medium break-words">{processLabel(r)}</div>
<div className="text-xs text-muted-foreground break-words">
{stepLabel(r) || '—'}
{(r.round ?? 1) > 1 && (
<span className="ml-1.5 text-violet-600 dark:text-violet-400">
Expand Down Expand Up @@ -604,17 +607,17 @@ function RecordCell({ r, href, linkState, figureField, deadLabel, unresolvableLa
) : unresolvableLabel !== null ? (
<UnresolvableRecordReference label={unresolvableLabel} className="text-sm max-w-full" />
) : href === null ? (
<div className="text-sm truncate max-w-full" title={title}>{title}</div>
<div className="text-sm line-clamp-2 break-words max-w-full" title={title}>{title}</div>
) : (
<Link
to={href}
state={linkState}
onClick={(e) => e.stopPropagation()}
className="inline-flex items-center gap-1 text-sm hover:underline truncate max-w-full"
className="inline-flex items-start gap-1 text-sm hover:underline max-w-full"
title={title}
>
<span className="truncate">{title}</span>
<ExternalLink className="h-3 w-3 shrink-0 text-muted-foreground" />
<span className="line-clamp-2 break-words">{title}</span>
<ExternalLink className="h-3 w-3 mt-1 shrink-0 text-muted-foreground" />
</Link>
)}
<div className="text-xs text-muted-foreground truncate">
Expand Down Expand Up @@ -1676,6 +1679,14 @@ function ApprovalsQueue() {
widths so they never crowd — instead of the browser
spreading five auto columns evenly and leaving 审批事项
over-wide next to a cramped 状态. */}
{/* objectstack#37534 — the three text columns (Request,
Record, Requester) WRAP instead of holding one line, so
none of them sets a minimum width the card cannot give:
from a 928 px card up the table fits, and the pinned
Approve / Reject column covers no other column at rest.
Narrower, the table scrolls under the pin (#12708).
`e2e/approvals-inbox-desktop-columns-37534.spec.ts`
measures it in Chromium. */}
<TableHead className="w-[22%]">{tr('colRequest', 'Request')}</TableHead>
{/* objectui#12816 — the Record cells are `max-w-0` (below),
so this floor is the column's only minimum: enough to
Expand Down Expand Up @@ -1710,9 +1721,10 @@ function ApprovalsQueue() {
)}
<TableCell><RequestCell r={r} tr={tr} /></TableCell>
{/* objectui#12816 — `max-w-0` takes the record title's
unbreakable width out of the auto-layout table's
column sizing, so a long title truncates (full text
in its `title`) instead of widening the table. */}
width out of the auto-layout table's column sizing,
so a long title wraps to two lines and is then
clamped (full text in its `title`, objectstack#37534)
instead of widening the table. */}
<TableCell className="max-w-0">
<RecordCell
r={r}
Expand All @@ -1736,9 +1748,9 @@ function ApprovalsQueue() {
<span className="truncate italic">{tr('flowOrigin', 'Flow-initiated')}</span>
</div>
) : (
<div className="flex items-center gap-1.5 text-sm">
<div className="flex flex-wrap items-center gap-1.5 text-sm">
<UserIcon className="h-3.5 w-3.5 text-muted-foreground shrink-0" />
<span className="truncate" title={r.submitter_id || ''}>{submitterDisplay(r)}</span>
<span className="min-w-0 break-words" title={r.submitter_id || ''}>{submitterDisplay(r)}</span>
{tab !== 'submitted' && r.viewer?.is_submitter === true && (
<SelfSubmittedBadge label={tr('submittedByYou', 'You submitted this')} />
)}
Expand Down
Loading
Loading