Skip to content

fix(ui): in a narrow record drawer a relative time stays on one line - #34732

Merged
objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/issue-34614-narrow-badge-time
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 12 commits into
mainfrom
claude/issue-34614-narrow-badge-time

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX

Fixes #34614

Clause-②: no
Metadata-protocol: none

Refs #34696: the card's "badge cut to one letter" symptom moved there. Measured, it is record:path's desktop stage row in a narrow drawer. That card is in development by another dev in this area and touches record-path.tsx only.

维护者速读

  • 改了什么:窄记录抽屉里的相对时间不再逐词换行。元信息行的「· 3 天前」、动态条目、折叠条目和回复的时间都成了不可拆开的一段;行在各段之间换行,放不下时整段时间移到下一行。
  • 为什么改:在 380px 抽屉里实测,元信息行的 "2 days ago" 拆成两三行,动态条目的「3 天前」拆成「3」和「天前」。卡片的另一半(徽标被截成一个字母)经实测不成立:选项徽标本来就在自身内部加省略号并带 title,所以没有改代码,只加了一个 e2e 对照钉住它。真正被截成一个字母的是阶段条(record:path)的桌面行,已转到 窄记录抽屉:阶段路径按视口而不是容器切换,桌面行在 380px 抽屉里把阶段名截成一个字母 #34696。
  • 风险与回滚:只改了三个渲染文件的 class 与一层包裹,没有元数据、spec、新 i18n key 或导出改动。宽屏下行能放下就不换行,外观不变(900px 对照的块高度前后一致)。回滚即 revert 本 PR。
  • 先看:ui/packages/plugin-detail/src/RecordMetaFooter.tsx(MetaEntry 的 data-record-meta-when 一段)、ui/packages/plugin-detail/src/RecordActivityTimeline.tsx(条目头 data-feed-when 和系统行 data-stream-when)、ui/e2e/narrow-drawer-time-34614.spec.ts。
  • 两分钟验证:pnpm --dir ui run test:e2e --project=chromium e2e/narrow-drawer-time-34614.spec.ts,预期 6 passed(380/400px 时间各占一行,900px 对照,徽标完整或带省略号和 title)。
  • 需要你做的:无,席位落地。

What changes

  1. Meta line (RecordMetaFooter.tsx, MetaEntry). The dot and the time element now sit inside one inline-flex … whitespace-nowrap unit (data-record-meta-when), and the entry becomes flex-wrap (data-record-meta-entry). In a narrow drawer the entry wraps between label, user and that unit, so "· 2d ago" moves to the next line whole. Before, the time was a shrinkable item of a row that could not wrap, so it broke word by word. An entry without an actor carries the unit without a dot.
  2. Activity timeline (RecordActivityTimeline.tsx). The entry header and the folded-run header become flex flex-wrap items-center gap-x-2 gap-y-0.5, and their time span is whitespace-nowrap (data-feed-when). On the stream face, the compact system line keeps "· time" as one nowrap unit (data-stream-when) after a separate break space, so its text reads byte-for-byte as before.
  3. Replies (ThreadedReplies.tsx). The reply header gets the same treatment as the entry it replies to.

Badges: nothing to change (the card's item 2 was falsified by measurement). The select / status / multiselect badge already truncates inside itself: SelectCellRenderer's Badge is max-w-full min-w-0 around an inner truncate span, with the label as its title. In a 380px drawer, on the real record page in Chromium (default page and a hand-written page), 「方案报价」-length labels were whole, and long labels ended in an ellipsis with the title. No badge was cut silently at 375 / 380 / 400 / 900px. The new e2e badge control pins this. HeaderHighlight.tsx is not in the diff. The one-letter cut that does happen in a narrow drawer is record:path's desktop row, which is viewport-keyed: seven stages read "P… ✓… Pro… Ne…". It moved to #34696.

Why

The card measured a 380–400px record drawer. The time lines broke per word there: "2 / days / ago" on the meta line, and "3" over "天前" in an entry header.

Tests

  • ui/packages/plugin-detail/src/__tests__/narrowDrawerTime-34614.test.tsx (new, 7 cases, class shape: jsdom has no layout). The meta unit is nowrap and holds the dot and the time; the entry is flex-wrap; the no-actor entry has no dot; the entry, folded and reply headers are flex-wrap with a nowrap time; the system line keeps the break space outside its unit, with unchanged text.
  • ui/e2e/narrow-drawer-time-34614.spec.ts (new, 6 cases, Chromium geometry, in the pattern of record-path-phone-row.spec.ts). It reads the real class strings out of RecordMetaFooter.tsx, RecordActivityTimeline.tsx, HeaderHighlight.tsx (default-page grid cell), ui/badge.tsx and the select badge in @object-ui/fields, and every extraction throws on drift. It compiles real Tailwind for exactly those classes. The cases: at 380 and at 400px, the meta times are one line each and the long entry's time moved down whole; at 380 and at 400px, the entry time is one line and moved to a line of its own; a 900px control keeps both on one line; a badge control shows 「方案报价」 whole and a long label ellipsised, with its title and inside its cell.

Ablations (each fix committed first, mutated through scripts/ablation-replace.mjs, restored to the HEAD blob with an empty git diff HEAD):

  • whitespace-nowrap dropped from the meta unit → caught by the jsdom pin, NOT by the e2e spec. narrowDrawerTime-34614.test.tsx went 2 failed / 5 passed ("draws the dot and the time inside one unbreakable unit", and the no-actor control). The e2e spec stayed green (6 passed): the unit (about 70px) is a flex item of the now flex-wrap entry, so it moves to a fresh line whole either way. nowrap only matters when the unit alone is wider than a line.
  • flex-wrap dropped from the meta entry → the e2e spec goes red: 2 failed / 4 passed, both meta cases (380, 400), "Expected: at least 51.5, Received: 28". The time stayed on its label's row.
  • flex-wrap dropped from the activity entry header → the e2e spec goes red: 2 failed / 4 passed, both entry cases (380, 400).

Acceptance notes

  • Claim surface amendment 6941237713 (area o3-A) covers the new ui/e2e/ spec and names RecordActivityTimeline.tsx and ThreadedReplies.tsx.
  • Same shape, not changed (outside the drawer's 动态 timeline): RecordComments.tsx's header (a legacy DetailView surface) has its time in a non-wrapping flex row. ActivityTimeline.tsx puts its time on its own line, and HistoryTimeline's header is already flex-wrap, so neither breaks per word.
  • ui AGENTS.md ✨ Set up Copilot instructions #2 asks for README / content/docs/frontend/ updates. No page there describes the meta line or the timeline header layout, so none was edited.

Verification

All on head acf4cd7347 (origin/main 77b42a1ed0 merged) unless noted. Logs are folded.

Package tests and type check (plugin-detail)
pnpm exec turbo run build --filter='@object-ui/plugin-detail^...' --concurrency=2
pnpm --filter @object-ui/plugin-detail test
 Test Files  383 passed | 1 skipped (384)
      Tests  3447 passed | 18 skipped (3465)
pnpm --filter @object-ui/plugin-detail type-check   (tsc --noEmit && tsc -p tsconfig.test.json)
os-verify-lock: VERDICT command-exit 0
Chromium geometry spec and the e2e type check
pnpm --dir ui run test:e2e --project=chromium --reporter=list e2e/narrow-drawer-time-34614.spec.ts
  6 passed
pnpm --dir ui run type-check:e2e
os-verify-lock: VERDICT command-exit 0

Locally a static stub answered :4173/console/ for the config's reuseExistingServer, because the spec uses page.setContent and never loads the Console. CI serves the built Console as usual.

Reproduction readings (one-off, not committed)

The real components' DOM was laid out in Chromium with real Tailwind, plus the real RecordDetailView mounted with a stub data source in a 380px drawer.

  • Before: the meta time "2 days ago" took 3 lines at 375px and 2 lines at 380px; the entry header time took 2 lines at 380px (en / de / zh) and at 400px (en / de).
  • After: every time took 1 line in every scenario (24 / 24).
  • 900px control: block heights are identical before and after (meta 29px, timeline 199px).
  • Badges in a 380px drawer: 「方案报价」 / 「无需审批」 / 「老客户增购」 / 「客户推荐」 were whole (69–81px wide); long labels were ellipsised (95–110px) with the title.
Derived gate families (dispatch-gates --commands, 38 families, on acf4cd7)

Every command in the derived list exited 0 on the final head, including the changeset gates, check:nul-bytes, check:cross-package-test-inputs, check:test-source-alias, check:published-files, check:type-check-coverage, check:type-check-debt, and pnpm --dir ui exec vitest run scripts/ (Test Files 171 passed | 2 skipped, Tests 5077 passed | 2 skipped). Reconciliation: Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.

ui check:new-line-citations: 0 new citation(s). eslint on the touched files: 0 errors (5 pre-existing no-explicit-any warnings in RecordMetaFooter.tsx). overlap-check: VERDICT clean exit 0. Full lint farm: CI.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the touched files: 0 errors; full lint farm: CI)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX

The meta line's "· time" and the activity entries' time are one
unbreakable piece, and their rows wrap between pieces, so in a narrow
drawer the time moves to the next line instead of breaking per word.

Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-authored-by: Claude <noreply@anthropic.com>
…o a render is stable for the same record

Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-authored-by: Claude <noreply@anthropic.com>
…-34614-narrow-badge-time

Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-authored-by: Claude <noreply@anthropic.com>
Measured in Chromium with the classes read out of the sources: the meta
line's time unit and the activity entry's time stay on one line at 380
and 400px, a 900px control keeps each on one line, and a key-field
badge shows whole or ends in an ellipsis with its label as the title.

Claude-Session: https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

席位核对 · L1 (seat 3, L1-a) · 2026-11-17T09:19Z

L1: ACCEPT
Head-sha: acf4cd7
Card: #34614 · claim 6939422862 · surface amendment 6941237713 · os-dev reports 6941211681, 6941369014, 6943535707 (final, this head)

The time half of the card is built in all four places where the time broke, inside the amended surface. The badge half was measured, found not to reproduce, and is pinned by an e2e control instead of a code change. The one-letter cut the dev did find has its own card (#34696, Refs). No must-fix and no should-fix.

Must-fix

None.

Should-fix

None.

Readings that hold

Item Reading
PR shape Draft, base main, Fixes #34614, with Refs #34696 and no other closing verb. No ! and no (narrowing), so no dogfood battery is owed.
Scope 6 files: RecordMetaFooter.tsx (+10/−3), RecordActivityTimeline.tsx (+14/−6), ThreadedReplies.tsx (+4/−2), the new narrowDrawerTime-34614.test.tsx, the new ui/e2e/narrow-drawer-time-34614.spec.ts and the changeset. The claim names RecordMetaFooter.tsx and "the timeline entry's time element in ui/packages/plugin-detail/src/**". Amendment 6941237713 names RecordActivityTimeline.tsx and ThreadedReplies.tsx explicitly and adds the ui/e2e/ spec. HeaderHighlight.tsx is claimed but not touched, which matches the badge finding.
Merge head acf4cd73 has parents 2ead419b and main 77b42a1e (which carries #34684, the series base). git show --remerge-diff acf4cd73 is empty. git diff origin/main...acf4cd73 is the same 6 files, +414/−11, so none of #34595's files ride along.
Meta line MetaEntry becomes inline-flex flex-wrap items-center gap-x-1.5. The dot and the time element sit in one inline-flex … whitespace-nowrap unit (data-record-meta-when). An entry with no actor draws the unit with no dot, as before.
Timeline The entry header and the folded-run header become flex flex-wrap items-center gap-x-2 gap-y-0.5, and their time span is whitespace-nowrap. The compact system line now draws ' ' and then a nowrap '· ' + time. Its text reads " · time", the same as the old ' · ' + time, and the jsdom test pins that it is byte-identical. The reply header in ThreadedReplies.tsx gets the same flex-wrap and nowrap time.
Badge half SelectCellRenderer's Badge is max-w-full min-w-0 around an inner truncate span with the label as title, so a long label ends in an ellipsis inside its own cell. The e2e badge case reads those classes out of ui/badge.tsx, @object-ui/fields and the HeaderHighlight.tsx grid cell at run time. It pins 「方案报价」 whole and a long label ellipsised, with its title, inside the cell, at 380px. That meets card acceptance 1 as written.
Clause-② / Metadata-protocol no / none in the claim, the amendment, the PR body and the changeset. No export, no key and no locale string. The data-* hooks are DOM test hooks, not API.
Changeset patch on @object-ui/plugin-detail, the only published package whose src moved. "Wide layouts are unchanged: when the row fits, nothing wraps" matches the 900px control.
Tests Real commands with output: plugin-detail 384 files / 3465 tests and type-check on this head, the e2e spec (6 passed) and type-check:e2e. The new jsdom file has 7 class-shape pins. The new e2e spec has 6 Chromium geometry cases (380 and 400px for the meta line and the entry header, a 900px control, and the badge case). Each extraction throws if it matches the wrong string. Three ablations, each restored to the HEAD blob. Dropping flex-wrap from the meta entry turns the e2e spec red (2 of 6). Dropping it from the activity header also turns it red (2 of 6). Dropping whitespace-nowrap from the meta unit turns only the jsdom pin red (2 of 7), and the PR declares why: a ~70px unit in a wrapping row moves whole either way. 38/38 derived gates. No existing test is edited.
UI strings None added.
Docs I searched content/docs, skills and the plugin-detail README for the meta line's and the timeline header's layout. The README's meta-line paragraph is about which fields it names, not how it wraps. Nothing is made false.
Acceptance 1: the badge is whole or ellipsised with a title (pinned at 380px). 2: "3 days ago" / 「3 天前」 do not break per word (pinned at 380 and 400px; measured before and after in en, de and zh). 3: wide layouts are unchanged (pinned at 900px; block heights match before and after). Card item 4's measured regression test is the e2e spec.
Tier check-governed-merges --pr 34732: NOT governed, 425 lines. Tier S, lands through o3-A.
CI on this head 55 check-runs: 42 success, 13 skipped, none failed or pending. That includes Test UI 16/16 shards plus the aggregate, Build & E2E UI (which runs the new spec), Live E2E UI, Type Check UI, Lint UI, every Type Check and Lint family, Check Changeset, PR-body guards and Governed Surface Queue Guard. Test Core and Build Core are skipped by the path filter.

Notes

  1. Fixes #34614 with the one-letter cut moved. The card's title symptom ("badge cut to one letter") is real in a narrow drawer, but it comes from record:path's desktop stage row, not from a key-field badge. It is carried by 窄记录抽屉:阶段路径按视口而不是容器切换,桌面行在 380px 抽屉里把阶段名截成一个字母 #34696, which o3-A has claimed and is building. The card's acceptance 1 names the badge, and the badge holds, so closing 窄记录抽屉:关键字段里的徽标被截成一个字母,相对时间逐词换行 #34614 on this PR is consistent. Whoever reads 窄记录抽屉:关键字段里的徽标被截成一个字母,相对时间逐词换行 #34614 after it closes should be pointed at 窄记录抽屉:阶段路径按视口而不是容器切换,桌面行在 380px 抽屉里把阶段名截成一个字母 #34696; the PR body's Refs line does that.
  2. Same shape, left alone. RecordComments.tsx's header (the legacy DetailView surface) has its time in a flex row that does not wrap. It is not drawn by the record page this card measured, so it is outside the card. The report records it as a carrier-less note.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX

Landing · 2026-11-17T09:20Z · area o3-A

Probe Reading
check-governed-merges.mjs --pr 34732 NOT governed · 425 changed lines (+414/−11) ≤ 3000 · Tier S
L1 + checks on head acf4cd7347d2a92645d534cfc7be073512f0c067 L1-a ACCEPT 6943916228 on this head · 55 check-runs: 42 success, 13 skipped, 0 failing · mergeable_state clean · main 4 first-parent commits ahead of the PR's base (below the K ≥ 15 merge rule); this PR touches no locale or skills budget input

State: pr_ready + automerge_enable now; #34614 closes on merge via Fixes (badge half measured and pinned, no code change); the record:path one-letter cut is #34696 (Refs).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 09:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit d83a275 Nov 17, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34614-narrow-badge-time branch November 17, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

窄记录抽屉:关键字段里的徽标被截成一个字母,相对时间逐词换行

2 participants