Skip to content

Commit 0d0a088

Browse files
feat(plugin-detail): the default record page shows Activity last — right column, stack, tab row and strip (#34643)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} --> _Requested by **Yibo Wang** · [project thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBLW6dHPW6sSheA32XPKZzPV)_ repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX Fixes #34590 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:没有手写记录页的对象,默认记录页把「动态」放到最后——宽屏右栏是 相关 → 附件 → 审批 → 动态;窄屏单列是 详情 → 相关 → 附件 → 审批 → 动态;顶部页签行是 概览 → 各关联 → 动态;合成的页签条(Studio 新建记录页的初始内容)也是 详情 → 相关 → 审批 → 动态。 - 为什么改:维护者 2026-11-17 原话「我们同事反馈动态不常用,是否建议移动到子表最后」「「动态」在最后」,并在 6937542160 裁决「同意」:第 2 项(对象级开关)不做,窄屏动态页签也移到最后。 - 风险与回滚:只改默认页的排列顺序,不改任何元数据、键名和 `?tab=` 取值;手写记录页不受影响。回滚即 revert 本 PR。 - 先看:`ui/packages/plugin-detail/src/RecordPageColumns.tsx`(右栏顺序与页签行,含"首批计数未回时动态页签暂不上行"一段)、`synth/buildDefaultPageSchema.ts`(页签条顺序)、`__tests__/RecordPageColumns.test.tsx` 末尾新增的 #34590 用例。 - 两分钟验证:`pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/RecordPageColumns.test.tsx`,预期 18 个用例全绿;或在控制台打开任一无手写页的记录,右栏最下方是「动态」。 - 需要你做的:无,席位落地。 ## What changes On the synthesized default record page (no hand-written page), the Activity stream (动态) now comes last on every surface that draws it: - **Right column** (two-column and wide tiers): related panels in the reader's arrangement, then attachments, then approvals, then the 动态 panel. Any related-stack foot line (hidden count, restore default order) stays with the related panels, above 动态. - **Single-column stack** (below 760 px, a phone, the split pane): details, related panels, attachments, approvals, 动态 at the very bottom of the page. - **Tab row**: 概览, the related panels' tabs, then 动态. Because 动态 now sits after the panel tabs, it waits off the row together with them while their first count set is out (unless it is the active tab), so no tab moves when the counts land; the row itself is drawn from the first paint (概览 alone meanwhile), so the page below it does not shift. This keeps the existing no-move rule of #28469 Target 2. - **Synthesized `page:tabs` strip** (`buildDefaultTabs` / `buildDefaultPageSchema`, also what Studio seeds a new record page with): Details, Related, Approvals, then the Activity stream. Tab `value`s are unchanged, so `?tab=` links keep working. Hand-written record pages keep their author's order. No metadata key is added (item 2 of the card was dropped by the maintainer's ruling, comment 6937542160). **Supersession.** #27524 Targets 5 and 8 (maintainer rulings of 2026-10-29: 动态 the first panel of the right column, and second in the tab row) are superseded for the right column, the stack, the tab row and the strip by the maintainer's 2026-11-17 words 「我们同事反馈动态不常用,是否建议移动到子表最后」「「动态」在最后」 and the ruling recorded in 6937542160 (「同意」). Every changed assertion that pinned those targets cites this. **Surface extension (area o3-A).** The claim's surface was extended by the area for assertion-only edits to tests outside it that pinned the old order: `ui/packages/app-shell/src/views/RecordDetailView.recordPageTiers-26678.test.tsx`, `ui/packages/app-shell/src/views/RecordDetailView.panelToggles-27052.test.tsx`, `examples/app-showcase/e2e/detail-shapes.spec.ts`. No source file outside the original surface changed. Claim amendment 6939020563 then added, comment and doc text only: `content/docs/ui/pages.mdx` (the synthesized-default section now states the new right-column and tab-row order), and the comments in `ui/packages/plugin-detail/src/RecordTabRow.tsx`, `ui/packages/app-shell/src/views/RecordDetailView.tsx` and `ui/packages/app-shell/src/views/RecordDetailView.recordOpenWaves-13010.test.tsx`. ## Why Members open the related records much more often than the stream; the maintainer asked for 动态 to move after the child tables (quoted above). ## Tests New pins (a top-level `describe` in `RecordPageColumns.test.tsx`, the component's existing harness file, per the shared-harness rule in AGENTS.md, rather than a new per-card file): wide, two-column and stack, each with attachments on or off (`enable.files`) and approvals on or off (12 cases), plus a reader-rearranged stack (foot line, then 动态 last) and a page with the stream off. Assertions updated as this card's intended behaviour change, each citing #34590: - `plugin-detail/src/__tests__/RecordPageColumns.test.tsx` (3 right-column order pins, 1 first-child pin) - `plugin-detail/src/__tests__/RecordPageColumns.switches-27052.test.tsx` (2) - `plugin-detail/src/__tests__/RecordPageColumns.tabRow-27524.test.tsx` (3 tab-row order pins) - `plugin-detail/src/__tests__/RecordTabRow.recordsFirst-28469.test.tsx` (6: final order, plus the pending row that is now 概览 alone) - `plugin-detail/src/synth/__tests__/buildDefaultPageSchema.test.ts` (every strip-order pin, in 9 tests), `buildDefaultPageSchema.strictPayload.test.ts` (2), `buildDefaultPageSchema.bodyTables-27055.test.ts` (2), `recordPageColumns.switches-27052.test.ts` (1) - `plugin-detail/src/__tests__/RecordTimelinePanel-27524.test.tsx` (docblock only) - `app-shell/src/views/RecordDetailView.recordPageTiers-26678.test.tsx` (4), `RecordDetailView.panelToggles-27052.test.tsx` (1), `examples/app-showcase/e2e/detail-shapes.spec.ts` (1) ## Acceptance notes - On a narrow row with many panels, 动态 can now fall into the 「+N ▾」 dropdown (it used to be guaranteed a slot as the second tab). That follows from "动态 last" under the row's existing fit rule. - The `RecordTabRow` component tests in `RecordTabRow.recordsFirst-28469.test.tsx` (the first describe) feed the component a fixed tab list with 动态 second; they pin the width rule, not the page's order, and were left as they are. ## Verification Code-round runs below are on `338d995bed` (a merge of `origin/main` 082f9c2 on top of the work); the fix round on `ea778cb7b8` changes docs and comments only (last block). <details><summary>Changed test files on the final head 338d995</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 (the 11 changed ui test files) Test Files 11 passed (11) Tests 175 passed (175) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Whole plugin-detail package (tree 73b01d7; the main merge after it touched no plugin-detail file)</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 packages/plugin-detail/ Test Files 380 passed | 1 skipped (381) Tests 3428 passed | 18 skipped (3446) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>app-shell record page and synthesizer consumers (tree 73b01d7)</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/RecordDetailView packages/app-shell/src/views/recordDetailSections packages/app-shell/src/utils/__tests__/pageSchemaIntrospect.test.ts packages/app-shell/src/views/metadata-admin/anchors.page-seed.test.ts packages/app-shell/src/views/metadata-admin/inspectors/ObjectFieldInspector.relatedList-27054.test.tsx packages/app-shell/src/views/metadata-admin/previews/PagePreview apps/console/src/__tests__/record-block-record-reach.test.tsx packages/components/src/__tests__/page-tabs-builtin-label-i18n-4645.test.tsx packages/types/src/__tests__/record-panels-arms-12363.test.ts Test Files 110 passed (110) Tests 855 passed (855) os-verify-lock: VERDICT command-exit 0 ``` </details> <details><summary>Typecheck (338d995)</summary> ``` pnpm --filter @object-ui/plugin-detail run type-check (tsc --noEmit && tsc -p tsconfig.test.json) os-verify-lock: VERDICT command-exit 0 ``` app-shell type-check not run locally (its two changed files change string literals and one `firstElementChild` to `lastElementChild`); declared to CI `Type Check UI`. </details> <details><summary>Ablations (one per behaviour changed; implementation committed first, restore by blob hash)</summary> 1. Right-column order put back to 动态-first (`node scripts/ablation-replace.mjs`, anchor 1 to 0, blob e4a52d3 to a57dfc19a1d9): `RecordPageColumns.test.tsx` went `Tests 16 failed | 2 passed (18)` (every order pin red; the two pages with no 动态 panel stay green). Restored: blob after restore e4a52d3, `git diff HEAD` empty. 2. The held 动态 tab disabled (`timelineHeld` forced false; blob e4a52d3 to afbd72794764): `RecordTabRow.recordsFirst-28469.test.tsx` went `Tests 2 failed | 5 passed (7)` (the no-move prefix pin and the pending-row pin). Restored: blob after restore e4a52d3, `git diff HEAD` empty. </details> <details><summary>Derived gate families (338d995)</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 56 families; 55 ran with exit 0 (including `pnpm --dir ui exec vitest run scripts/`: Test Files 171 passed | 2 skipped). NOT MEASURED: `pnpm check:dual-build-cjs-loads`, reason: exit 3 PREREQUISITE NOT MET (reads built `dist/` of packages this diff does not build; CI builds them). `--ran` reconciliation: "56 derived famil(ies) accounted for — 55 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". Overlap check at every push: `VERDICT clean exit 0`. </details> <details><summary>Fix round (L1-a REWORK 6939009202) on head ea778cb — docs and comments only</summary> ``` pnpm --dir ui exec vitest run --maxWorkers=2 (RecordTabRow-27524, RecordTabRow.recordsFirst-28469, RecordPageColumns.tabRow-27524, RecordDetailView.recordOpenWaves-13010, RecordDetailView.recordPageTiers-26678, RecordDetailView.panelToggles-27052) Test Files 6 passed (6) Tests 64 passed (64) os-verify-lock: VERDICT command-exit 0 ``` `dispatch-gates --commands` on ea778cb derives 87 families (31 new, from `content/docs`); `--ran`: "87 derived famil(ies) accounted for — 85 run, 2 NOT-MEASURED". New doc families all exit 0, among them `pnpm --filter @objectstack/spec run check:docs` ("248 generated files in sync"), `check:doc-authoring`, `check:doc-anchors`, `check:docs-transcript-drift`, `check:doc-security-posture`. NOT MEASURED, both exit 3 PREREQUISITE NOT MET (unbuilt `dist/` of packages this diff does not touch): `check:skill-examples` (client-react) and `check:dual-build-cjs-loads`. Overlap check before the push: `VERDICT clean exit 0`. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. (lint is CI's) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: n/a. - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (Chinese only in quoted rulings and the maintainer quick-read). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01WGufzg2evNa1V3zxrQq3KX <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzg2evNa1V3zxrQq3KX --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 13c62a6 commit 0d0a088

20 files changed

Lines changed: 295 additions & 123 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/plugin-detail': patch
3+
---
4+
5+
feat(plugin-detail): the default record page shows Activity last — after the related panels, attachments and approvals
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On a record page nobody wrote by hand, the Activity stream used to come first in the right column, right after the details on a narrow screen, and second in the tab row. Members open the related records far more often than the stream, so the stream now comes last everywhere the default page draws it:
11+
12+
- wide and two-column layouts: the right column reads related panels, then attachments, then approvals, then Activity;
13+
- one-column layout (a phone, the split pane): details, related panels, attachments, approvals, then Activity at the very bottom;
14+
- the tab row: Overview, the related panels, then Activity. While the panels' first counts are still loading, the Activity tab waits off the row with them, so no tab moves when they arrive;
15+
- the synthesized `page:tabs` strip (`buildDefaultTabs`, `buildDefaultPageSchema`, and what Studio seeds a new record page with): Details, Related, Approvals, then the Activity stream.
16+
17+
A hand-written record page keeps the order its author wrote. Nothing an author writes changes: every tab keeps its `value` (`details`, `related`, `approvals`, `timeline`), so `?tab=` links still open the same tab. Code that splices a custom tab into `buildDefaultTabs(...).items` by position should find its place by `value`, since the Activity stream's index moved from second to last.

‎content/docs/ui/pages.mdx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ replacement.
181181

182182
A record page needs no authoring. With no page assigned, the Console synthesizes one from
183183
the object: a header, the highlights strip, the record's **details**, and a right column of
184-
panels: **动态** (Activity) first, then the related lists, **Approvals** when the record has
185-
approval requests, and the attachments of an object with `enable: { files: true }`. A
184+
panels: the related lists, then the attachments of an object with `enable: { files: true }`,
185+
then **Approvals** when the record has approval requests, and **动态** (Activity) last. On a
186+
narrow screen the same panels follow the details in one column, so **动态** ends the page. A
186187
relationship whose child field declares `relatedList: 'primary'` is part of the record's body:
187188
its list is a full-width table in the details, after the first field section, with no panel of
188189
its own. **动态** is one stream: the discussion, the activity and, with
@@ -191,7 +192,7 @@ Its panel shows a one-line composer and the newest entries, and its header opens
191192
stream (`?related=timeline`), filtered by All / Activity / Discussion / Changes. A related
192193
panel's header opens that list's whole table the same way (`?related=<object>.<field>`).
193194
Each of those faces is also a tab: a row of tabs closes the record header, **Overview** first,
194-
then **动态**, then one tab per related panel in the reader's order, each with its count. The
195+
then one tab per related panel in the reader's order, then **动态** last, each with its count. The
195196
row shows as many tabs as its width fits and folds the rest into a **+N** menu; the open tab
196197
is always on the row, and **Overview** or Esc returns to the page.
197198
Moving a child table into the record's body is therefore a one-word change on the

‎examples/app-showcase/e2e/detail-shapes.spec.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso'
197197
// `relatedList: 'primary'` (CORE relationships), so each is a body table in
198198
// the details, with its rows read at open; the rest of Contoso's lists
199199
// (Contacts and the Field Zoo lookups) are panels of the right column,
200-
// after its first panel, 动态 (objectstack#27524, Target 5).
200+
// before its last panel, 动态 (objectstack#34590).
201201
const details = page.locator('[data-record-column="details"]');
202202
const invoicesTable = details
203203
.getByRole('table')
@@ -208,7 +208,8 @@ test('ungrouped + related-heavy: flat details and the related panels on Contoso'
208208
await expect(invoicesTable.getByRole('cell', { name: 'INV-1002', exact: true })).toBeVisible();
209209
await expect(projectsTable.getByRole('cell', { name: 'Data Platform', exact: true })).toBeVisible();
210210
const rightColumn = page.locator('[data-record-column="right"]');
211-
await expect(rightColumn.locator(':scope > *').first()).toHaveAttribute('data-record-timeline-panel', '');
211+
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
212+
await expect(rightColumn.locator(':scope > *').last()).toHaveAttribute('data-record-timeline-panel', '');
212213
await expect(rightColumn.getByRole('region', { name: /^(Invoices|Projects)$/ })).toHaveCount(0);
213214

214215
// Ungrouped shape: the details body is flat — no fieldGroup section cards.

‎ui/packages/app-shell/src/views/RecordDetailView.panelToggles-27052.test.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,13 @@ describe('RecordDetailView — the right-column switch ⊟ (objectstack#27052, o
274274
it.each([
275275
['an object that is not worked', PRODUCT],
276276
['an object that is only another object\'s `master_detail` parent', PRICE_BOOK],
277-
])('%s opens with the right column too, 动态 first', async (_name, object) => {
277+
])('%s opens with the right column too, 动态 last (objectstack#34590)', async (_name, object) => {
278278
const { container } = renderPage({ object });
279279
await screen.findByRole('group', { name: 'Panels' }, { timeout: 5000 });
280280
expect(shown(container)).toBe('details right');
281281
expect(rightColumnSwitch().getAttribute('aria-pressed')).toBe('true');
282-
expect(container.querySelector('[data-record-column="right"]')?.firstElementChild?.hasAttribute('data-record-timeline-panel')).toBe(true);
282+
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
283+
expect(container.querySelector('[data-record-column="right"]')?.lastElementChild?.hasAttribute('data-record-timeline-panel')).toBe(true);
283284
});
284285

285286
it('⌘⇧, flips ⊟; with a text field focused it does nothing; ⌘⇧. is not the page\'s any more', async () => {

‎ui/packages/app-shell/src/views/RecordDetailView.recordOpenWaves-13010.test.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,8 @@ describe('the timeline, comments, attachments and user list wait for their panel
692692

693693
// The synthesized page has no discussion footer any more (#27055), and no
694694
// tab strip at any width since objectstack#27524: its one stream is the 动态
695-
// panel, the first panel of the right column — on screen at open in every
696-
// tier, so the feed is read at open, like an authored page opened on its
695+
// panel, the last panel of the right column (objectstack#34590) — drawn at
696+
// open in every tier, so the feed is read at open, like an authored page opened on its
697697
// Activity tab. A page with tabs still waits for its tab (above).
698698
// objectstack#28470 — asked with the page, not beside it; the mention list
699699
// waits for the composer's focus.

‎ui/packages/app-shell/src/views/RecordDetailView.recordPageTiers-26678.test.tsx‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,25 +265,27 @@ const expectTabRowOnly = async (active = 'overview') => {
265265
expect(lists).toHaveLength(1);
266266
expect(lists[0].closest('[data-record-tab-row]')).not.toBeNull();
267267
const tabs = Array.from(lists[0].querySelectorAll('[role="tab"]'));
268+
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
268269
expect(tabs.map((tab) => tab.getAttribute('data-record-tab'))).toEqual([
269270
'overview',
270-
'timeline',
271271
'showcase_task.project',
272272
'showcase_note.project',
273+
'timeline',
273274
]);
274275
expect(lists[0].querySelector('[aria-selected="true"]')?.getAttribute('data-record-tab')).toBe(active);
275276
};
276277

277278
describe('RecordDetailView — one record page, laid out by its width (objectstack#26678, objectstack#27524)', () => {
278-
it('1440 px: details beside the right column at 380 px, the details grid at three columns; 动态 leads; History is read at open', async () => {
279+
it('1440 px: details beside the right column at 380 px, the details grid at three columns; 动态 last (objectstack#34590); History is read at open', async () => {
279280
const { container } = renderPage({ width: 1440 });
280281
await screen.findAllByText('Tasks', undefined, { timeout: 5000 });
281282
expect(tierOf(container)).toBe('wide');
282283
expect(shown(container)).toBe('details right');
283284
expect(columnsGrid(container)).toContain('23.75rem');
284285
expect(detailsGrid(container)).toContain('@lg:grid-cols-3');
285286
await expectTabRowOnly();
286-
expect(rightPanels(container)).toEqual(['timeline', 'showcase_task.project', 'showcase_note.project']);
287+
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
288+
expect(rightPanels(container)).toEqual(['showcase_task.project', 'showcase_note.project', 'timeline']);
287289
// No resident timeline column and no rail: the two columns are all.
288290
expect(column(container, 'timeline')).toBeNull();
289291
expect(column(container, 'related')).toBeNull();
@@ -307,7 +309,8 @@ describe('RecordDetailView — one record page, laid out by its width (objectsta
307309
expect(detailsGrid(container)).toContain('@sm:grid-cols-2');
308310
expect(detailsGrid(container)).not.toContain('@lg:grid-cols-3');
309311
// The same panels as the wide tier — no rail to open first.
310-
expect(rightPanels(container)).toEqual(['timeline', 'showcase_task.project', 'showcase_note.project']);
312+
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
313+
expect(rightPanels(container)).toEqual(['showcase_task.project', 'showcase_note.project', 'timeline']);
311314
expect(screen.queryByTestId('record-related-rail-toggle')).toBeNull();
312315
await expectTabRowOnly();
313316
});
@@ -326,7 +329,8 @@ describe('RecordDetailView — one record page, laid out by its width (objectsta
326329
const details = column(container, 'details')!;
327330
const right = column(container, 'right')!;
328331
expect(details.compareDocumentPosition(right) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
329-
expect(rightPanels(container)).toEqual(['timeline', 'showcase_task.project', 'showcase_note.project']);
332+
// objectstack#34590, ruling 6937542160 — 动态 last (supersedes objectstack#27524 Targets 5 and 8's 动态-first).
333+
expect(rightPanels(container)).toEqual(['showcase_task.project', 'showcase_note.project', 'timeline']);
330334
await waitFor(() => expect(auditReads()).toBeGreaterThan(0));
331335
// objectstack#27058 — on a phone the stack ends where the bottom action
332336
// bar starts: the header's actions are drawn there, after the body, and

‎ui/packages/app-shell/src/views/RecordDetailView.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5001,9 +5001,10 @@ export function RecordDetailView({ dataSource, objects, onEdit, objectNameOverri
50015001
const drawnHighlightFields = drawnHighlightFieldsOf(renderedPage);
50025002

50035003
// objectstack#26678 / objectstack#27524 — the page as its tier lays it out:
5004-
// the record header, then the details and the right column (动态, then the
5005-
// related panels), read off `renderedPage` itself so they hold exactly the
5006-
// blocks the tab strip would (pruning included). `null` for an authored
5004+
// the record header, then the details and the right column (the related
5005+
// panels, then 动态 last — objectstack#34590), read off `renderedPage`
5006+
// itself so they hold exactly the blocks the tab strip would (pruning
5007+
// included). `null` for an authored
50075008
// page and for a page whose strip the partition cannot read, which is drawn
50085009
// as written, tabs and all.
50095010
const pageColumns = pageColumnsEligible ? buildDefaultPageColumns(renderedPage) : null;

‎ui/packages/plugin-detail/src/RecordPageColumns.tsx‎

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ const COLUMN_STACK = 'flex min-w-0 flex-col gap-4 [&>*:has(>[hidden]:only-child)
224224
/**
225225
* The synthesized default record page, laid out by the width it has
226226
* (objectstack#26678; one rule since objectstack#27524, Target 6): one record
227-
* header, then the details and the right column — the 动态 panel first, then
228-
* the related panels in the reader's arrangement.
227+
* header, then the details and the right column — the related panels in the
228+
* reader's arrangement (attachments and approvals close them), then the 动态
229+
* panel, last (objectstack#34590, which supersedes objectstack#27524 Targets
230+
* 5 and 8's 动态-first for the right column, the stack and the tab row).
229231
*
230232
* - `two-column` / `wide`: details | the right column (320 / 380 px). The
231233
* wide tier lets a details section take three field columns (two
@@ -350,18 +352,17 @@ export const RecordPageColumns: React.FC<RecordPageColumnsProps> = ({
350352
}
351353
}
352354

353-
// ── The tab row (Target 8): 概览, 动态, the panels in the reader's order ──
355+
// ── The tab row (Target 8): 概览, the panels in the reader's order, 动态 ──
354356
// The panels with records first and the empty ones in the dropdown
355-
// (objectstack#28469), as the right column folds its empty panels.
357+
// (objectstack#28469), as the right column folds its empty panels. 动态 is
358+
// the row's last tab, as it is the right column's last panel
359+
// (objectstack#34590, superseding objectstack#27524 Target 8's 动态-second).
356360
const panelTab = (id: RelatedCardId): RecordTab => ({
357361
id,
358362
label: relatedNodeTitle(panelNodes.get(id)),
359363
count: countOf(id),
360364
});
361365
const tabs: RecordTab[] = [{ id: RECORD_TAB_OVERVIEW, label: t('detail.recordTabOverview', { defaultValue: 'Overview' }) }];
362-
if (hasTimeline) {
363-
tabs.push({ id: RECORD_PAGE_TIMELINE_PANEL, label: t('detail.timeline', { defaultValue: 'Activity' }), count: streamCount });
364-
}
365366
// While the panels' first count set is still out (the right column draws its
366367
// count skeletons meanwhile) their tabs wait off the row, so a tab that turns
367368
// out empty never draws on the row and then leaves it: the tabs appear once,
@@ -372,13 +373,26 @@ export const RecordPageColumns: React.FC<RecordPageColumnsProps> = ({
372373
);
373374
tabs.push(...panelTabs.withRecords);
374375
if (openBodyTable) tabs.push(openBodyTable);
376+
// 动态 comes after the panels' tabs, so it too waits off the row while their
377+
// first set is out (every panel still pending): drawn at once, it would move
378+
// when they land in front of it — the move the rule above keeps out
379+
// (objectstack#28469, Target 2). Drawn when it is the active tab.
380+
const firstPanelSetOut =
381+
resolved.order.length > 0 && resolved.order.every((id) => counts.stateOf(id).kind === 'pending');
382+
const timelineHeld = hasTimeline && firstPanelSetOut && activeTab !== RECORD_PAGE_TIMELINE_PANEL;
383+
if (hasTimeline && !timelineHeld) {
384+
tabs.push({ id: RECORD_PAGE_TIMELINE_PANEL, label: t('detail.timeline', { defaultValue: 'Activity' }), count: streamCount });
385+
}
375386
const hiddenTabs = resolved.hidden.map(panelTab);
376387
const selectTab = (id: string) => {
377388
if (id === RECORD_TAB_OVERVIEW) onCloseEnlargedRelated?.();
378389
else onEnlargeRelated?.(id);
379390
};
391+
// A held 动态 tab still counts toward drawing the row, so the row is there
392+
// from the first paint (概览 alone while the set is out) and the page below
393+
// it does not shift when the tabs land.
380394
const tabRow =
381-
onEnlargeRelated && tabs.length + panelTabs.empty.length + hiddenTabs.length > 1 ? (
395+
onEnlargeRelated && tabs.length + (timelineHeld ? 1 : 0) + panelTabs.empty.length + hiddenTabs.length > 1 ? (
382396
<RecordTabRow
383397
tabs={tabs}
384398
emptyTabs={panelTabs.empty}
@@ -402,16 +416,8 @@ export const RecordPageColumns: React.FC<RecordPageColumnsProps> = ({
402416
data-record-column="right"
403417
aria-label={t('detail.relatedColumn', { defaultValue: 'Right column' })}
404418
>
405-
{hasTimeline && (
406-
<RecordTimelinePanel
407-
nodes={columns.timeline}
408-
entries={wide ? RECORD_TIMELINE_PANEL_MAX_ENTRIES : 3}
409-
onViewAll={onEnlargeRelated ? viewAllTimeline : undefined}
410-
count={streamCount}
411-
onCount={reportTimelineCount}
412-
/>
413-
)}
414-
{/* The related panels, in the reader's arrangement (objectstack#27055). */}
419+
{/* The related panels, in the reader's arrangement (objectstack#27055),
420+
then the 动态 panel, last (objectstack#34590: 「「动态」在最后」). */}
415421
<RelatedListCompactContext.Provider value>
416422
<RelatedCardStack
417423
nodes={columns.related}
@@ -422,6 +428,15 @@ export const RecordPageColumns: React.FC<RecordPageColumnsProps> = ({
422428
counts={counts}
423429
/>
424430
</RelatedListCompactContext.Provider>
431+
{hasTimeline && (
432+
<RecordTimelinePanel
433+
nodes={columns.timeline}
434+
entries={wide ? RECORD_TIMELINE_PANEL_MAX_ENTRIES : 3}
435+
onViewAll={onEnlargeRelated ? viewAllTimeline : undefined}
436+
count={streamCount}
437+
onCount={reportTimelineCount}
438+
/>
439+
)}
425440
</aside>
426441
) : null;
427442
// A face with neither the 动态 panel nor its tab drawn — another tab open,

‎ui/packages/plugin-detail/src/RecordTabRow.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ const TAB_CLASS =
8383
/**
8484
* The record page's tab row (objectstack#27524, Target 8): at the bottom
8585
* edge of the record header, on every face — 「概览」, then one tab per panel
86-
* (动态 first, then the related panels in the reader's arrangement), each with
87-
* its count. A tab is its panel's whole face (Target 9): choosing it draws
86+
* (the related panels in the reader's arrangement, then 动态 last,
87+
* objectstack#34590), each with its count. A tab is its panel's whole face (Target 9): choosing it draws
8888
* that face below the row, and 「概览」 returns to the page.
8989
*
9090
* How many tabs the row shows is computed from its own width, measured on

‎ui/packages/plugin-detail/src/__tests__/RecordPageColumns.switches-27052.test.tsx‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
/**
1010
* objectstack#27052 → objectstack#27524, Target 4 — `RecordPageColumns` with
1111
* the reader's ONE switch, ⊟ (the right column). The timeline switch, its
12-
* folded 「动态」 card and the related rail retired: 动态 is the right column's
13-
* first panel, so ⊟ takes the 动态 panel and the related panels out
14-
* together, and the details take the row. The stack has no right column, so
12+
* folded 「动态」 card and the related rail retired: 动态 is a panel of the right
13+
* column (its last since objectstack#34590), so ⊟ takes the 动态 panel and the
14+
* related panels out together, and the details take the row. The stack has no right column, so
1515
* the switch does not reach it. The blocks are stubbed (each node draws its
1616
* type), so what is measured is where each node lands.
1717
*/
@@ -52,11 +52,12 @@ const shown = (container: HTMLElement) =>
5252
afterEach(() => cleanup());
5353

5454
describe('RecordPageColumns — the right-column switch ⊟ (objectstack#27052, objectstack#27524)', () => {
55-
it('absent or on: details | right column, 动态 first', () => {
55+
it('absent or on: details | right column, 动态 last (objectstack#34590)', () => {
5656
for (const rightColumn of [undefined, true]) {
5757
const { container, unmount } = render(<RecordPageColumns tier="wide" columns={columns} rightColumn={rightColumn} />);
5858
expect(shown(container)).toBe('details right');
59-
expect(nodesIn(column(container, 'right'))).toEqual(['record:activity', 'record:related_list', 'record:related_list']);
59+
// objectstack#34590 — 动态 last (supersedes objectstack#27524 Targets 5 and 8 for the column).
60+
expect(nodesIn(column(container, 'right'))).toEqual(['record:related_list', 'record:related_list', 'record:activity']);
6061
unmount();
6162
}
6263
});
@@ -79,6 +80,7 @@ describe('RecordPageColumns — the right-column switch ⊟ (objectstack#27052,
7980
it('the stack does not read it: its panels follow the details whatever the switch says', () => {
8081
const { container } = render(<RecordPageColumns tier="stack" columns={columns} rightColumn={false} />);
8182
expect(shown(container)).toBe('details');
82-
expect(nodesIn(column(container, 'right'))).toEqual(['record:activity', 'record:related_list', 'record:related_list']);
83+
// objectstack#34590 — the stack ends with 动态 (supersedes objectstack#27524 Targets 5 and 8 for the stack).
84+
expect(nodesIn(column(container, 'right'))).toEqual(['record:related_list', 'record:related_list', 'record:activity']);
8385
});
8486
});

0 commit comments

Comments
 (0)