diff --git a/.changeset/34614-narrow-drawer-time.md b/.changeset/34614-narrow-drawer-time.md new file mode 100644 index 00000000000..d5bb94504b4 --- /dev/null +++ b/.changeset/34614-narrow-drawer-time.md @@ -0,0 +1,10 @@ +--- +'@object-ui/plugin-detail': patch +--- + +fix(ui): in a narrow record drawer a relative time stays on one line + +Clause-②: no +Metadata-protocol: none + +The record page's meta line ("Updated by NAME · 2d ago") and the activity timeline's entry, folded-run and reply headers now keep the relative time, with its leading dot where it has one, as one piece that never breaks. Their rows wrap between pieces instead, so in a narrow drawer the whole time moves to the next line rather than breaking word by word ("2 / days / ago", "3" over "天前"). Wide layouts are unchanged: when the row fits, nothing wraps. diff --git a/ui/e2e/narrow-drawer-time-34614.spec.ts b/ui/e2e/narrow-drawer-time-34614.spec.ts new file mode 100644 index 00000000000..9a22b04d8e6 --- /dev/null +++ b/ui/e2e/narrow-drawer-time-34614.spec.ts @@ -0,0 +1,237 @@ +import { test, expect, type Page } from '@playwright/test'; +import { compile } from 'tailwindcss'; +import { readFileSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import path from 'node:path'; +import { uiRoot } from '../scripts/ui-root.mjs'; + +/** + * GEOMETRY pin for a record page in a narrow drawer (objectstack#34614): a + * relative time never breaks word by word, and a key-field badge is never cut + * to a letter. + * + * Measured on the real record page in a 380 px drawer before the fix: the meta + * line's "Updated by NAME · 2 days ago" drew its time on two or three lines, + * and an activity entry's header drew "3 days ago" as "3 days" over "ago", + * because each time was a shrinkable piece of a row that could not wrap. Now + * the time (with its dot on the meta line) is one `whitespace-nowrap` piece and + * the row wraps between pieces, so the whole time moves to the next line. + * Badges were measured whole or ellipsised with their label as the title; the + * badge cases below hold that. + * + * A Playwright spec and not a vitest test for the reason + * `record-header-title-width.spec.ts` gives: jsdom has no layout engine, so a + * width read there is 0 and an assertion on it is vacuous. The class-shape + * half is pinned beside the components in `narrowDrawerTime-34614.test.tsx`. + * + * REAL, read out of the sources at run time: the meta row, entry, time unit + * and `