Skip to content

Commit e43f5ac

Browse files
committed
feat(app-shell): an authored record page is drawn on the desktop full page only
On a phone and in every embedded record view (the side drawer, the split pane, an interface page's preview) the record draws the platform's standard page for its object; Open full page lands on the authored one. One reader, `authoredRecordPageApplies` in `recordPageSurface.ts`, names the host's two exceptions: a page named in the URL, and the approval request and user pages. Slotted pages are untouched. The showcase task's Recalculate Estimate also declares `record_more`, so the standard page reaches it under the header's overflow; the authored header leaves it out and the full page still draws it once. pages.mdx says where an authored page applies. Seventeen RecordDetailView test files that mounted the drawer only as a harness for an authored page now mount the full page. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgVHYk1S4MD4WibYGKk
1 parent 146b6f9 commit e43f5ac

26 files changed

Lines changed: 471 additions & 40 deletions
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
10+
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.
11+
12+
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.
13+
14+
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.
15+
16+
Nothing to migrate: no metadata key changes, and the desktop full page draws exactly as before.

‎content/docs/ui/pages.mdx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,27 @@ 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, and in the
264+
side drawer or split pane a list opens a record in, the record takes the platform's standard
265+
page for its object, whether or not the object has an authored page; **Open full page** from the
266+
drawer lands on the authored one. There is no setting that keeps an authored page on the phone
267+
or in the drawer.
268+
269+
What carries over is what the object declares: its field groups and their order, field
270+
permissions and visibility, the actions placed at `record_header` and `record_more`, one tab per
271+
child table, the stage and the approval state. What does not is the page's own layout and
272+
anything that lives only on it: its tabs and sections, a related list or block placed only on
273+
the page, a banner, and `record_section` actions, which the standard page does not draw. To keep
274+
such an action reachable off the full page, add `record_more` to its `locations`, and leave it
275+
out of the page header's `actions` list so the full page still draws it once.
276+
277+
A slotted page is the standard page with its slots filled, so its slots apply on every surface.
278+
A page named in the URL (`…/record/:id/page/:pageName`, print pages and other named routes) is
279+
drawn wherever that route renders. The platform's approval request and user pages keep their
280+
own page on every surface.
281+
261282
### The discussion panel is composed, never appended
262283

263284
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 — but the section bar\'s', () => {
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/views/RecordDetailView.appendInset-27520.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ function renderRecordPage(pages: any[]): HTMLElement {
123123
onEdit={() => {}}
124124
objectNameOverride={OBJECT}
125125
recordIdOverride={REC}
126-
embedded
126+
/* objectstack#36150 — not `embedded`: an authored page draws on the full page only. */
127127
/>
128128
</MetadataCtx.Provider>
129129
</MemoryRouter>,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ async function mount(comments: Record<string, unknown>[], options: MountOptions)
218218
onEdit={() => {}}
219219
objectNameOverride={OBJECT_NAME}
220220
recordIdOverride={RECORD_ID}
221-
embedded
221+
/* objectstack#36150 — not `embedded`: an authored page draws on the full page only. */
222222
/>
223223
</MetadataCtx.Provider>
224224
</MemoryRouter>

0 commit comments

Comments
 (0)