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
18 changes: 18 additions & 0 deletions .changeset/35783-related-tab-arrangement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
'@object-ui/i18n': patch
'@object-ui/plugin-detail': patch
---

feat(record-page): a related list's tab moves left or right and hides, and 「更多」 restores the default order

Clause-②: no
Metadata-protocol: none

**Reader arrangement is back.** The related cards' ⠿ handle, ⌥↑ / ⌥↓ and 「隐藏」 left the page with objectstack#35595, and with them the reader's way to reorder or hide a related list. This note supersedes the "Reader arrangement leaves with the cards" bullet of that release's note: 「左移」, 「右移」 and 「隐藏」 now sit on each related tab's own menu, 「恢复默认顺序」 sits in 「更多」 (in a drawer and an embedded pane too), and an arrangement already stored keeps applying.

- **A related list's tab is its menu.** Open a list's tab and click it again (or press Enter, Space or ↓ on it): 「左移」 and 「右移」 move it one place among the related lists, and 「隐藏」 takes it off the row into 「更多」's hidden lists and returns to Overview. The open tab draws a ▾ to say so.
- **「更多」 restores the default.** While the order or the hidden set is not the default, 「更多」 ends with 「恢复默认顺序」: the default order with every list shown. It is in a drawer and an embedded pane too, which have no rail.
- **Fixed tabs.** Overview, Attachments, Approvals and Activity have no menu and never move.
- **One stored arrangement.** The tabs write the same per-reader, per-object arrangement the related cards wrote, so an order or hides already stored keep working, and the rail's 「已隐藏 N · 显示」 and 「恢复默认顺序」 still undo them.

`@object-ui/i18n` adds `detail.recordTabMoveBefore` / `detail.recordTabMoveAfter` (左移 / 右移) in every pack. `@object-ui/plugin-detail` removes the unused `RelatedCardStack` and `useRelatedArrangement` modules (not exported from the package). Nothing an app authors changes.
100 changes: 99 additions & 1 deletion docs/qa/platform-checklist/areas/records-forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -7297,6 +7297,104 @@
"ref": "#35597"
}
]
},
{
"id": "records-forms.related-tab-arrangement",
"title": "A reader moves a related list's tab left or right and hides it from the tab's own menu, and 「更多」's 「恢复默认顺序」 brings the default back — kept per reader and object, in a drawer too; 概览, 附件, 审批 and 动态 never move",
"since": "v18.7",
"status": "active",
"revision": 1,
"priority": "P2",
"surface": "browser",
"personas": [
"seeded admin (admin@objectos.ai / admin123), signed in through the form"
],
"fixtures": {
"app": "showcase",
"requires": [
"a fresh boot of the showcase: `pnpm dev -- --fresh -p PORT --seed-admin`",
"a showcase_account record whose synthesized page has at least three side related lists (the Northwind account: contacts, opportunities, invoices and the rest the showcase derives); the zh-CN console (语言 中文) so the menu reads 左移 / 右移 / 隐藏"
]
},
"steps": [
"open the Northwind account's full record page at 1440×900 and read the tab row's order",
"open the second related list's tab, click it again to open its menu, choose 左移; then open the menu again and choose 右移",
"open another related list's tab, open its menu and choose 隐藏; open 「更多」 and read its hidden lists",
"reload the page and read the tab row and 「更多」",
"open 「更多」 and choose 恢复默认顺序; read the tab row",
"open the 概览, 附件, 审批 (while a request exists) and 动态 tabs in turn and click each again",
"open the same account in the record drawer, hide one list there from its tab's menu, then choose 恢复默认顺序 from the drawer's 「更多」"
],
"acceptance": [
{
"clause": "左移 and 右移 move the open list's tab one place among the related lists, and the menu's way out at either end is disabled",
"oracle": "dom",
"verify": "after 左移 the tab stands one place earlier in the row's role=tab order, after 右移 back; on the first list's tab 左移 is aria-disabled, on the last 右移",
"evidence": "the tab row read before and after each move"
},
{
"clause": "隐藏 takes the open list off the row into 「更多」's hidden lists and returns the page to 概览",
"oracle": "dom",
"verify": "the hidden list has no role=tab on the row; 「更多」 lists it under 已隐藏 (data-record-tab-hidden); 概览 is aria-selected",
"evidence": "the 「更多」 screenshot"
},
{
"clause": "the arrangement is the reader's, kept per object across a reload, the same store the related cards used (#27055)",
"oracle": "dom",
"verify": "after the reload the moved order and the hidden list stand as they were left",
"evidence": "the tab row after the reload"
},
{
"clause": "「更多」's 恢复默认顺序 restores the default order and shows every hidden list; in the default arrangement the entry is absent",
"oracle": "dom",
"verify": "after 恢复默认顺序 the row reads the order of steps[0] with no list hidden, and 「更多」 (if drawn at all) holds no 恢复默认顺序",
"evidence": "the tab row after the reset"
},
{
"clause": "概览, 附件, 审批 and 动态 are fixed: open, a second click opens no menu",
"oracle": "dom",
"verify": "none of the four tabs carries aria-haspopup, and no [data-record-tab-arrange-menu] opens",
"evidence": "one screenshot per tab"
},
{
"clause": "the drawer, which has no rail, moves, hides and resets the same way from its tab row",
"oracle": "dom",
"verify": "the drawer's 「更多」 holds 恢复默认顺序 after the hide, and choosing it shows the list again",
"evidence": "the drawer screenshot"
},
{
"clause": "the pins pass at the run subject sha",
"oracle": "test",
"verify": "run ui/packages/plugin-detail/src/__tests__/RecordPageColumns.readerArrangement-35595.test.tsx and ui/packages/plugin-detail/src/synth/__tests__/relatedArrangement-27055.test.ts from ui/ with vitest, and ui/e2e/record-tabs-rail-35595.spec.ts with Playwright (Chromium); each reports ≥1 test and 0 failed",
"evidence": "the vitest and Playwright summary lines, with the subject sha"
}
],
"negative": [
"a menu on 概览, 附件, 审批 or 动态 is a FAIL: those tabs never move or hide",
"an arrangement that is gone after a reload is a FAIL: it is kept per reader and object",
"a drawer with a hidden list and no way to show it again is a FAIL"
],
"traps": [
"hydration-race"
],
"automated": {
"kind": "unit",
"ref": "ui/packages/plugin-detail/src/__tests__/RecordPageColumns.readerArrangement-35595.test.tsx (move, hide, reset, the drawer, the fixed tabs), ui/packages/plugin-detail/src/synth/__tests__/relatedArrangement-27055.test.ts (the merge rules), ui/e2e/record-tabs-rail-35595.spec.ts (move, hide and reset with real pointer events in Chromium); no live spec drives the stored preference across a reload"
},
"source": [
"ui/packages/plugin-detail/src/RecordTabRow.tsx#RecordTabRow",
"ui/packages/plugin-detail/src/RecordPageColumns.tsx#RecordPageColumns",
"ui/packages/plugin-detail/src/synth/relatedArrangement.ts#editRelatedArrangement",
"#35783"
],
"history": [
{
"revision": 1,
"date": "2026-11-20",
"change": "initial — reader arrangement moved from the related cards to the tabs (#35783, after #35595 retired the cards), read from source on the PR branch; no live run made",
"ref": "#35783"
}
]
}
]
}
}
58 changes: 58 additions & 0 deletions ui/e2e/record-tabs-rail-35595.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import { uiRoot } from '../scripts/ui-root.mjs';
* strip; CONTROL, back on 概览 both are drawn again.
* - A rail card's title opens its tab; CONTROL, the 概览 tab returns.
* - A card measures radius 8, a 13 px title with a grey count, 26 px rows.
* - objectstack#35783: an open list's tab is its menu — 「左移」 / 「右移」
* move it, 「隐藏」 sends it to 「更多」 — and 「更多」's 「恢复默认顺序」
* brings the default back. Order only: no width is read.
*
* ⚠️ A Playwright spec and not a vitest test: jsdom lays nothing out, so a
* width read there is 0 and the row's fold — which reads the row's own width
Expand Down Expand Up @@ -589,3 +592,58 @@ test.describe('the record page\'s tabs and 概览 rail, zh-CN (objectstack#35595
await expect(page.locator('[data-record-tab="approvals"]')).toHaveAttribute('aria-selected', 'true');
});
});

test.describe('a related tab\'s menu moves and hides it, and 「更多」 restores the default (objectstack#35783)', () => {
test.skip(({ browserName }) => browserName !== 'chromium', 'one engine is enough for an interaction pin');

test.beforeAll(async () => {
test.setTimeout(240_000);
if (!bundle) bundle = await bundlePage();
});

/** The related lists' tabs on the row, in order. */
const listTabs = (page: Page) =>
page.evaluate((all) => {
const lists = new Set(all.slice(1, 9));
return [...document.querySelectorAll('[data-record-tab-row] [role="tab"]')]
.map((el) => el.getAttribute('data-record-tab') ?? '')
.filter((id) => lists.has(id));
}, ALL_TABS);
/** Open a list's tab, then its menu (a second click), and choose an entry. */
async function arrange(page: Page, id: string, entry: string) {
const tab = page.locator(`[role="tab"][data-record-tab="${id}"]`);
if ((await tab.getAttribute('aria-selected')) !== 'true') await tab.click();
await expect(tab).toHaveAttribute('aria-selected', 'true');
await tab.click();
await page.getByRole('menuitem', { name: entry }).click();
}

test('左移 / 右移 move the open list, 隐藏 sends it to 「更多」, 恢复默认顺序 brings the default back', async ({ page }, testInfo) => {
test.setTimeout(120_000);
const lists = ALL_TABS.slice(1, 9);
await mount(page, { name: 'arrange1184', viewport: 1440, frame: PAGE_1440 });
expect(await listTabs(page)).toEqual(lists);
await arrange(page, 'contact.account_id', '右移');
const moved = await listTabs(page);
expect(moved.slice(0, 2)).toEqual(['opportunity.account_id', 'contact.account_id']);
await arrange(page, 'contact.account_id', '左移');
expect(await listTabs(page)).toEqual(lists);
// CONTROL: 概览 opens no menu.
await page.locator('[role="tab"][data-record-tab="overview"]').click();
await page.locator('[role="tab"][data-record-tab="overview"]').click();
await expect(page.locator('[data-record-tab-arrange-menu]')).toHaveCount(0);
await arrange(page, 'quote.account_id', '右移');
await arrange(page, 'opportunity.account_id', '隐藏');
await expect(page.locator('[role="tab"][data-record-tab="overview"]')).toHaveAttribute('aria-selected', 'true');
const arranged = await listTabs(page);
report(testInfo, 'arranged', arranged);
expect(arranged).not.toContain('opportunity.account_id');
expect(arranged.indexOf('invoice.account_id')).toBeLessThan(arranged.indexOf('quote.account_id'));
await page.locator('[data-record-tab-more]').click();
await expect(page.locator('[data-record-tab-hidden][data-record-tab-menu-item="opportunity.account_id"]')).toHaveCount(1);
await page.getByRole('menuitem', { name: '恢复默认顺序' }).click();
await expect.poll(() => listTabs(page)).toEqual(lists);
// CONTROL: the default arrangement offers nothing to restore, and the row that fits draws no 「更多」.
await expect(page.locator('[data-record-tab-more]')).toHaveCount(0);
});
});
3 changes: 3 additions & 0 deletions ui/packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1706,6 +1706,9 @@ const ar = {
relatedShowHidden: "إظهار",
recordTabs: "علامات تبويب السجل",
recordTabOverview: "نظرة عامة",
// objectstack#35783 — before / after in the row; an RTL row runs right to left, so before is to the right.
recordTabMoveBefore: "نقل إلى اليمين",
recordTabMoveAfter: "نقل إلى اليسار",
recordTabsMore: "علامات تبويب أخرى: {{count}}",
recordTabsMore_zero: "علامات تبويب أخرى: {{count}}",
recordTabsMore_one: "علامات تبويب أخرى: {{count}}",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,8 @@ const de = {
relatedShowHidden: "Anzeigen",
recordTabs: "Datensatz-Tabs",
recordTabOverview: "Übersicht",
recordTabMoveBefore: "Nach links verschieben",
recordTabMoveAfter: "Nach rechts verschieben",
recordTabsMore: "{{count}} weitere Tabs",
recordTabsMore_one: "{{count}} weiterer Tab",
recordTabsMore_other: "{{count}} weitere Tabs",
Expand Down
3 changes: 3 additions & 0 deletions ui/packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,9 @@ const en = {
relatedShowHidden: 'Show',
recordTabs: 'Record tabs',
recordTabOverview: 'Overview',
// objectstack#35783 — a related tab's menu: one place before / after it in the row.
recordTabMoveBefore: 'Move left',
recordTabMoveAfter: 'Move right',
recordTabsMore: '{{count}} more tabs',
recordTabsMore_one: '{{count}} more tab',
recordTabsMore_other: '{{count}} more tabs',
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,8 @@ const es = {
relatedShowHidden: "Mostrar",
recordTabs: "Pestañas del registro",
recordTabOverview: "Resumen",
recordTabMoveBefore: "Mover a la izquierda",
recordTabMoveAfter: "Mover a la derecha",
recordTabsMore: "{{count}} pestañas más",
recordTabsMore_one: "{{count}} pestaña más",
recordTabsMore_many: "{{count}} pestañas más",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,8 @@ const fr = {
relatedShowHidden: "Afficher",
recordTabs: "Onglets de l'enregistrement",
recordTabOverview: "Aperçu",
recordTabMoveBefore: "Déplacer à gauche",
recordTabMoveAfter: "Déplacer à droite",
recordTabsMore: "{{count}} onglets de plus",
recordTabsMore_one: "{{count}} onglet de plus",
recordTabsMore_many: "{{count}} onglets de plus",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,8 @@ const ja = {
relatedShowHidden: "表示",
recordTabs: "レコードのタブ",
recordTabOverview: "概要",
recordTabMoveBefore: "左へ移動",
recordTabMoveAfter: "右へ移動",
recordTabsMore: "他 {{count}} 個のタブ",
recordTabsMore_one: "他 {{count}} 個のタブ",
recordTabsMore_other: "他 {{count}} 個のタブ",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,8 @@ const ko = {
relatedShowHidden: "표시",
recordTabs: "레코드 탭",
recordTabOverview: "개요",
recordTabMoveBefore: "왼쪽으로 이동",
recordTabMoveAfter: "오른쪽으로 이동",
recordTabsMore: "탭 {{count}}개 더",
recordTabsMore_one: "탭 {{count}}개 더",
recordTabsMore_other: "탭 {{count}}개 더",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1562,6 +1562,8 @@ const pt = {
relatedShowHidden: "Mostrar",
recordTabs: "Abas do registro",
recordTabOverview: "Visão geral",
recordTabMoveBefore: "Mover para a esquerda",
recordTabMoveAfter: "Mover para a direita",
recordTabsMore: "{{count}} abas a mais",
recordTabsMore_one: "{{count}} aba a mais",
recordTabsMore_many: "{{count}} abas a mais",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1426,6 +1426,8 @@ const ru = {
relatedShowHidden: "Показать",
recordTabs: "Вкладки записи",
recordTabOverview: "Обзор",
recordTabMoveBefore: "Переместить влево",
recordTabMoveAfter: "Переместить вправо",
recordTabsMore: "Ещё вкладок: {{count}}",
recordTabsMore_one: "Ещё вкладок: {{count}}",
recordTabsMore_few: "Ещё вкладок: {{count}}",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/zh-Hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,8 @@ const zh = {
relatedShowHidden: '显示',
recordTabs: '记录页签',
recordTabOverview: '概览',
recordTabMoveBefore: '左移',
recordTabMoveAfter: '右移',
recordTabsMore: '另外 {{count}} 个页签',
recordTabsMore_one: '另外 {{count}} 个页签',
recordTabsMore_other: '另外 {{count}} 个页签',
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,8 @@ const zhHant = {
relatedShowHidden: '顯示',
recordTabs: '記錄頁籤',
recordTabOverview: '概覽',
recordTabMoveBefore: '左移',
recordTabMoveAfter: '右移',
recordTabsMore: '另外 {{count}} 個頁籤',
recordTabsMore_one: '另外 {{count}} 個頁籤',
recordTabsMore_other: '另外 {{count}} 個頁籤',
Expand Down
Loading
Loading