Skip to content

Commit 1208cc8

Browse files
feat(app-shell): an authored record page is drawn on the desktop full page only; a phone and the side drawer draw the standard page (#36150) (#36174)
<!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuKobRqmoXkrWkHE4z9tvY3k)_ repo:objectstack#1 · os-sales · session_01L6bhgVHYk1S4MD4WibYGKk Fixes #36150 Clause-②: no Metadata-protocol: semantic Skills-docs: follow-up #36179 — skills/objectstack-ui/rules/record-page.md rules 4 and 5 (the `record_more` advice); skills edits ride a domain:skills PR ## 维护者速读 - 手写的记录页(`kind: 'full'`)现在只在电脑整页上生效。手机整页、电脑右侧抽屉(以及分栏预览、界面页预览)一律画平台标准页:字段一列、每张子表一个页签、动态在最后。抽屉里「整页打开」打开的仍是手写页。 - 按您的两条裁决:审批请求页和用户页三处都保留自己的页;页面区块里的动作(`record_section`)标准页不画,演示应用任务的「重算工时」加了 `record_more`,手机和抽屉里在「⋯」里能找到;队列成员、审计日志「同一记录的变更」、发票的打印按钮只在电脑整页有(后续卡由席位立)。 - 不变:插槽页(HotCRM 线索、工单的告警,项目的甘特图)三处照旧;网址点名的页面(打印页等)照旧;电脑整页一点不变。 - HotCRM 主干已经没有手写整页(hotcrm#2671),所以 HotCRM 三处都没有变化,作对照;手写页的三处效果用演示应用的项目页拍。 ## What changes - **One reader of where an authored page applies**, `authoredRecordPageApplies` in the new `ui/packages/app-shell/src/views/recordPageSurface.ts`: true on the desktop full page, false on a phone (`usePhoneViewport`) and in every embedded view. Two exceptions are the host's, named there and nowhere else: a page named in the URL (`…/record/:id/page/:pageName`, which only the full-page route reads, objectui#12715), and `OBJECTS_KEEPING_AUTHORED_PAGE` = `sys_approval_request`, `sys_user` (maintainer rulings 7066490078). There is no author switch. - **`RecordDetailView`**: `usePhoneViewport()` moves up to where the page is assigned, and `assignedPage` is `null` where the authored page does not apply, so the view takes the synthesized standard page there. Inside the view everything downstream (columns, phone header, comments, related lists) keys off `assignedPage`. Slotted pages never populate `assignedPage` and keep their slots everywhere. - **The record route's object scope** (`console/appObjectScope.ts`, L2 M1): `declaredRecordPage` reads the same `authoredRecordPageApplies`, so on a phone the record route takes the synthesized page's arm (the objects pointing at the record's, from the bundle or the registry) instead of only the objects the authored page binds; the standard page's child tabs are then all there. `AppContent` and `useAppObjectScopePrefetch` hand it `usePhoneViewport()`, so the scope follows the width across 768 as the view does. A page named in the URL and the two kept platform pages still read their page's objects. - **Showcase**: `showcase_recalc_estimate` declares `['record_section', 'record_more']` (ruling 7066506909). The authored Task Detail header lists its action ids and leaves it out, so the full page still draws it once, in the section bar; the standard page reaches it under ⋯. `record-action-location-hosts.test.ts` now holds: the authored header lists the record_header / record_more set less the section bar's actions; no action is both a section action and an inline header one; every section action is reachable under ⋯ on the standard page. - **Docs**: `content/docs/ui/pages.mdx` gains "Where an authored page applies" (a window narrower than 768 px counts as the phone; an interface page's preview is embedded). - **Not in this PR** (L2 S1, seat): the spec describes of `kind`, `isDefault`, `apps` and the `slots.tabs` remedy → #36180 (schema face); `skills/objectstack-ui/rules/record-page.md` rules 4 and 5 and the `record_more` advice → #36179 (domain:skills). - **Changeset**: `@object-ui/app-shell` minor, both declaration lines. ## Why Card #36150 (child of epic #35590; maintainer 2026-11-22 「自定义记录页在手机和右侧预览里不生效、统一用标准页」). The card's item 5 list (page-only things, and what each becomes off the full page) was posted on the card before the build; the two questions it raised were ruled (7066490078, 7066506909). ### Item 5, and how each was handled | Page | Page-only | Off the desktop full page now | |---|---|---| | showcase project | Tasks inline-edit grid tab, three sections, own highlights, footer discussion | standard page: Tasks as the master-detail child tab, ungrouped fields, the object's own highlights, discussion in 动态 (the comment panel once #36114 lands) | | showcase task | review banner, Recalculate Estimate (section bar), three sections, path | banner gone; Recalculate under ⋯ (`record_more` added); stage menu in the header | | showcase settings | two sections | ungrouped | | showcase invoice (default print page) | letterhead, print line items, Print button | standard page, no Print button (full page only, ruled) | | `sys_approval_request` | `record:approval_decision` | **kept on every surface** (ruled) | | `sys_user` | Security tab, effective access, AI assistants, verify banner, picker | **kept on every surface** until #35897 (ruled) | | `sys_organization` | three related tabs with set columns | the three stay; the other lookups to the organization also become tabs until #35897 | | `sys_queue` | Members list paired by text value | full page only (ruled; follow-up card by the seat) | | `sys_audit_log` | "Changes to the same record" list, five sections | list full page only (ruled; same follow-up); ungrouped | | HotCRM main | no authored full page since hotcrm#2671 | no change on any surface | ## Side effects reviewers should know - **Seventeen `RecordDetailView.*` test files mounted the drawer (`embedded`) only as a harness for an authored page** (`feedGrant-12082`, `feedCommentEditDelete-12268`, `reactionRecords-12078`, `authoredActivityThreading-12249`, `reactionWriteFailure-10899`, `withheldMentions-28218`, `discussionFallbackPipeline-8983`, `discussionExplicitComposition-7298`, `commentWriteFailure-10899`, `reactionsCommentRowsOnly-11035`, `reactionKeepIds-11019`, `feedRecordScope`, `topInset-35745`, `oneProvenanceFooter-12307`, `appendInset-27520`, `replyCountOnRead-12144`, `feedLoading`). They now mount the full page, with a one-line note where `embedded` was; no assertion changed. One case changed meaning: `harness` › recordPagePlacesNoComponent-32478 "the record drawer explains it the same way" now pins that the drawer draws the standard page and no explanation, since the authored page does not apply there. - **#36114** (desktop comment panel) is merged; `main` is merged into this branch. Its pin "no icon on a hand-written page" (`commentsPanel-36075.test.tsx`) now mounts the full page, where an authored page keeps its discussion and shows no icon; a new case beside it pins the opposite on the drawer: an authored-page object's drawer draws the standard page and offers the panel (L1-c item 1). - The phone reading is the window width (`usePhoneViewport`, below 768): a desktop window narrowed below 768 also takes the standard page. ## Verification - New `AppContent.authoredPagePhoneScope-36150.test.tsx` (6), through the real `AppContent` and `MetadataProvider`, the view a double printing the objects it is handed: desktop reads the authored page's objects, a child it does not bind left out (CONTROL); a phone reads every object pointing at the record's, that child included; the width crossing 768 on an open record moves the scope; a media-query change that leaves the window wide (what printing fires) keeps the authored page's scope (L2 N4); on a phone a page named in the URL and the `sys_user` page still read their own objects. **Red before**: with the scope handed `phone = false`, 2 of 6 fail (phone, width crossing). - New `RecordDetailView.authoredPageDesktopOnly-36150.test.tsx` (19, one added for N4: the authored page survives a print-style media-query change), through the real `RecordDetailView`: an authored page draws on the desktop full page; the standard page with its tab strip on the phone (375) and the drawer, the authored block gone; on the drawer the object's `record_more` action is in ⋯. CONTROL: no authored page, the standard page on all three. Exceptions on the phone and the drawer: a slotted page keeps its slot; `sys_approval_request` and `sys_user` keep their page; a page named in the URL draws on the phone. **Red before**: with the reader returning `true`, 4 of 18 fail (the unit pin, phone, drawer, ⋯). - Local: every `app-shell` `RecordDetailView.*`, `recordDrawer*`, `ObjectView*` and `console/__tests__/AppContent*` file, plus every other `ui/` test file naming `RecordDetailView`, `recordDrawer` or `RecordPageDrawerHost`: 319 files, 3,003 tests, all pass. `examples/app-showcase` `record-action-location-hosts.test.ts` 14/14; `objectstack validate` passes. ESLint on every changed file: 0 errors. `overlap-check.mjs`: clean against main and the 4 open PRs that share a file (#36136, #36129, #36114, #35923). `type-check` for app-shell did not run locally (the ui packages' declarations are not built in this container); CI is the reading. - Browser, showcase on this branch (server 18.6.0, console from this branch's `ui/` on Vite), zh-CN, light and dark, shots in the project evidence folder `build-seat1/36150/`: | Surface | Showcase project | Showcase task | |---|---|---| | Desktop full page, 1280 | authored: tabs 详情 / 任务 / 相关 2 / 附件, footer 讨论 | authored: path, review banner slot, 重算工时 in the section bar, once | | Drawer from the list, 1280 | standard: 概览 / 字段动物园 1 / 成员 1 / 任务 2 / 客户简报 / 附件 / 动态 | standard: 概览 / 动态; ⋯ holds 打开文档, **重算工时**, 重算所选 … 整页打开 | | Phone, 390 | standard: 概览 / 字段动物园 1 / 成员 1 / 任务 2 / 更多 3, fields one column, bottom bar | standard; ⋯ holds 记录工时, 归档, **重算工时** … | - HotCRM main (`1468877`, on 18.6.0) as the no-change control, lead: the standard page with its tabs on all three surfaces (it is a slotted page), its record actions in the header / ⋯ (转化线索, 安排跟进, 记录通话 …). ## 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 (ESLint on the changed files, 0 errors). - [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 (the 维护者速读 block is the maintainer's summary, in the maintainer's language). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. Branch name is the harness-assigned `claude/project-thread-0slbpo`. --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgVHYk1S4MD4WibYGKk)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgVHYk1S4MD4WibYGKk <!-- signed: repo:objectstack#1 · os-sales · session_01L6bhgVHYk1S4MD4WibYGKk --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1705ec9 commit 1208cc8

30 files changed

Lines changed: 863 additions & 47 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@object-ui/app-shell': minor
3+
---
4+
5+
feat(app-shell): an authored record page is drawn on the desktop full page only; a phone and the side drawer draw the standard page
6+
7+
Clause-②: no
8+
Metadata-protocol: semantic
9+
Skills-docs: follow-up #36179 — skills/objectstack-ui/rules/record-page.md rules 4 and 5 (the `record_more` advice); skills edits ride a domain:skills PR
10+
11+
What a `kind: 'full'` record page means changes: it is drawn on the desktop full page only. On a phone, and in every embedded record view (the side drawer a list opens, the split pane, an interface page's preview), the record draws the platform's standard page for its object, whether or not the object has an authored page. **Open full page** from the drawer still lands on the authored page.
12+
13+
The standard page keeps what the object declares: field groups and order, field permissions and visibility, the `record_header` / `record_more` actions, one tab per child table, the stage and the approval state. The authored page's layout does not apply there, nor anything that lives only on it: its tabs and sections, page-only related lists and blocks, banners, and `record_section` actions, which the standard page does not draw. To keep such an action reachable on a phone and in the drawer, add `record_more` to its `locations` (and leave it out of the authored header's `actions` list, so the full page still draws it once). There is no setting that keeps an authored page on the phone or in the drawer.
14+
15+
Unchanged: a slotted page (the standard page with slots filled) applies everywhere; a page named in the URL (`…/record/:id/page/:pageName`, print pages included) is drawn wherever that route renders; the platform's approval request (`sys_approval_request`) and user (`sys_user`) pages keep their own page on every surface.
16+
17+
Nothing to migrate: no metadata key changes, and the desktop full page draws exactly as before.

‎content/docs/ui/pages.mdx‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,28 @@ const accountDetailPage = {
258258
Use a slotted page to change one or two parts of an otherwise standard record page, and a
259259
`full` page for a record page that looks nothing like the default.
260260

261+
### Where an authored page applies
262+
263+
A `kind: 'full'` record page is drawn on the **desktop full page** only. On a phone (any window
264+
narrower than 768 px, a narrowed desktop window included), and in every embedded record view (the
265+
side drawer or split pane a list opens a record in, and an interface page's preview), the record
266+
takes the platform's standard page for its object, whether or not the object has an authored page; **Open full page** from the
267+
drawer lands on the authored one. There is no setting that keeps an authored page on the phone
268+
or in the drawer.
269+
270+
What carries over is what the object declares: its field groups and their order, field
271+
permissions and visibility, the actions placed at `record_header` and `record_more`, one tab per
272+
child table, the stage and the approval state. What does not is the page's own layout and
273+
anything that lives only on it: its tabs and sections, a related list or block placed only on
274+
the page, a banner, and `record_section` actions, which the standard page does not draw. To keep
275+
such an action reachable off the full page, add `record_more` to its `locations`, and leave it
276+
out of the page header's `actions` list so the full page still draws it once.
277+
278+
A slotted page is the standard page with its slots filled, so its slots apply on every surface.
279+
A page named in the URL (`…/record/:id/page/:pageName`, print pages and other named routes) is
280+
drawn wherever that route renders. The platform's approval request and user pages keep their
281+
own page on every surface.
282+
261283
### The discussion panel is composed, never appended
262284

263285
A record page shows a discussion panel if and only if the page composes a

‎examples/app-showcase/src/ui/actions/index.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,15 @@ export const RecalcEstimateAction = defineAction({
189189
execution: 'perRecord',
190190
// Names the task (see MarkDoneAction's note on the hole and its fallback).
191191
successMessage: "Estimate recalculated for {{ record.title | default:'the task' }}.",
192-
// `record_section` only: the Task Detail page's `record:quick_actions` bar
193-
// names it, and the engine location-filters even explicitly-named actions.
194-
// Not `record_more` too, so the page draws it once, in that bar, and not
195-
// again under the header's ⋯ overflow.
196-
locations: ['record_section'],
192+
// `record_section`: the Task Detail page's `record:quick_actions` bar names
193+
// it, and the engine location-filters even explicitly-named actions. And
194+
// `record_more` (objectstack#36150): the authored page is drawn on the
195+
// desktop full page only, and on a phone or in the side drawer the task
196+
// takes the standard page, which draws no `record_section` action — the
197+
// ⋯ overflow is where the action is found there. The authored header lists
198+
// its action ids and leaves this one out, so the full page still draws it
199+
// once, in the bar.
200+
locations: ['record_section', 'record_more'],
197201
// The endpoint is record-scoped and rejects a body without an id. On a
198202
// record surface the page supplies it; invoked from a LIST ROW (see the
199203
// `legacy_row_actions` view) nothing else can, so name the body key the

‎examples/app-showcase/src/ui/pages/task-detail.page.ts‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import { definePage } from '@objectstack/spec/ui';
1919
* • `record:highlights` + `record:details` — the standard compact + section
2020
* layout.
2121
* `kind: 'full'` — this page fully owns the record layout, as the Project
22-
* page does for its own tab strip.
22+
* page does for its own tab strip. It is drawn on the desktop full page only
23+
* (objectstack#36150): on a phone and in the side drawer a task opens on the
24+
* standard page, without the review banner or the section bar.
2325
*/
2426
export const TaskDetailPage = definePage({
2527
name: 'showcase_task_detail',
@@ -47,8 +49,11 @@ export const TaskDetailPage = definePage({
4749
// `record_header` actions render as inline buttons, and an action
4850
// declaring `record_more` without `record_header` always goes under
4951
// the ⋯ overflow. The list is the object's whole `record_header` /
50-
// `record_more` set, which is what the synthesized header would carry;
51-
// `test/record-action-location-hosts.test.ts` holds the two equal.
52+
// `record_more` set, which is what the synthesized header would carry,
53+
// less the actions the section bar below draws (they declare
54+
// `record_more` only for the standard page a phone or the side drawer
55+
// shows, objectstack#36150); `test/record-action-location-hosts.test.ts`
56+
// holds the two equal.
5257
// The host still appends its own Edit / Share / Delete after these.
5358
// No `title`: the header derives it from the record.
5459
{

‎examples/app-showcase/test/record-action-location-hosts.test.ts‎

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,16 @@ describe('showcase_task record action locations have a stock host (#22030)', ()
102102
expect(result.data?.actions).toEqual(ids);
103103
});
104104

105-
it('lists the task\'s whole record_header / record_more set — what the synthesized header carries', () => {
105+
it('lists the task\'s whole record_header / record_more set — what the synthesized header carries — less the actions its section bar draws', () => {
106106
expect(ids.every((id) => typeof id === 'string')).toBe(true);
107107
expect(new Set(ids).size, 'no id is listed twice').toBe(ids.length);
108+
// An action placed at record_section AND record_more is drawn on this
109+
// page by the quick-actions bar; `record_more` is its place on the
110+
// standard page a phone or the drawer draws (objectstack#36150), so the
111+
// authored header leaves it out (see the record_section block below).
108112
const headerSet = taskActions
109113
.filter((a) => declares('record_header')(a) || declares('record_more')(a))
114+
.filter((a) => !declares('record_section')(a))
110115
.map((a) => a.name as string);
111116
expect([...ids].sort()).toEqual([...headerSet].sort());
112117
});
@@ -183,13 +188,22 @@ describe('showcase_task record action locations have a stock host (#22030)', ()
183188
expect(names.length).toBeGreaterThan(0);
184189
expect(headerIds.length).toBeGreaterThan(0);
185190
expect(names.filter((n) => headerIds.includes(n))).toEqual([]);
186-
// And by declaration: no task action is placed both in the header's
187-
// locations and in the bar's, so a synthesized page cannot double it either.
188-
const doubled = taskActions
191+
// By declaration: no task action is placed both in the bar's location and
192+
// INLINE in a header, so neither page draws one twice in view.
193+
const inlineToo = taskActions
189194
.filter(declares('record_section'))
190-
.filter((a) => declares('record_header')(a) || declares('record_more')(a))
195+
.filter(declares('record_header'))
191196
.map((a) => a.name);
192-
expect(doubled).toEqual([]);
197+
expect(inlineToo).toEqual([]);
198+
});
199+
200+
it('reaches every record_section action on the standard page too, under the ⋯ overflow (objectstack#36150)', () => {
201+
// A phone and the side drawer draw the standard page, which has no
202+
// section bar: an action the bar hosts is found there through its
203+
// `record_more` location, which the synthesized header reads.
204+
const sectionSet = taskActions.filter(declares('record_section'));
205+
expect(sectionSet.length).toBeGreaterThan(0);
206+
expect(sectionSet.filter((a) => !declares('record_more')(a)).map((a) => a.name)).toEqual([]);
193207
});
194208
});
195209

‎ui/packages/app-shell/src/console/AppContent.tsx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,11 @@ export function AppContent({ extraRoutes, extraRoutesNoApp }: AppContentProps =
486486
// app whose served item carries its package; the whole registry everywhere
487487
// else, as before (that module says why). A page route reads the objects
488488
// its page binds (objectui#12980), resolved as `PageView` resolves the page,
489-
// and a record route those of its declared record page (objectui#13046).
489+
// and a record route those of its declared record page (objectui#13046),
490+
// on the desktop only: on a phone the view draws the standard page, whose
491+
// related lists read every object that points at the record's
492+
// (objectstack#36150), so the scope follows the width as the view does.
493+
const phoneViewport = usePhoneViewport();
490494
const {
491495
candidate: scopeCandidate,
492496
scope: objectScope,
@@ -546,6 +550,7 @@ export function AppContent({ extraRoutes, extraRoutesNoApp }: AppContentProps =
546550
const appName = typeof activeApp?.name === 'string' ? activeApp.name : undefined;
547551
return bundledReads && appName ? bundledReads.objectsReferencing(appName, objectName) : BUNDLE_MISS;
548552
},
553+
phoneViewport,
549554
);
550555
// Until the app list has loaded, a scope candidate does not know its package
551556
// yet, and reads nothing (the splash is up).

0 commit comments

Comments
 (0)