Skip to content

Commit 08ad16b

Browse files
os-zhuangclaude
andcommitted
feat(app-showcase): inline-editable record:line_items on project detail
Slotted showcase_project detail page surfacing the project's tasks as an inline-editable record:line_items grid (view + edit children together). Verified end-to-end: tasks load by the master_detail FK, inline edit + Save persists the diff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e6374b5 commit 08ad16b

4 files changed

Lines changed: 85 additions & 2 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
---
3+
4+
docs(app-showcase): slotted project detail page with an inline-editable `record:line_items` Tasks grid (example only).

examples/app-showcase/objectstack.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ShowcaseApp } from './src/apps/index.js';
1010
import { ChartGalleryDashboard } from './src/dashboards/index.js';
1111
import { allReports } from './src/reports/index.js';
1212
import { allActions } from './src/actions/index.js';
13-
import { ComponentGalleryPage, ProjectWorkspacePage } from './src/pages/index.js';
13+
import { ComponentGalleryPage, ProjectWorkspacePage, ProjectDetailPage } from './src/pages/index.js';
1414
import { allFlows } from './src/flows/index.js';
1515
import { allWebhooks } from './src/webhooks/index.js';
1616
import { allJobs } from './src/jobs/index.js';
@@ -113,7 +113,7 @@ export default defineStack({
113113
apps: [ShowcaseApp],
114114
portals: allPortals,
115115
views: [TaskViews, ProjectViews],
116-
pages: [ComponentGalleryPage, ProjectWorkspacePage],
116+
pages: [ComponentGalleryPage, ProjectWorkspacePage, ProjectDetailPage],
117117
dashboards: [ChartGalleryDashboard],
118118
reports: allReports,
119119
actions: allActions,

examples/app-showcase/src/pages/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import type { Page } from '@objectstack/spec/ui';
44

55
export { ProjectWorkspacePage } from './project-workspace.page.js';
6+
export { ProjectDetailPage } from './project-detail.page.js';
67

78
/**
89
* Component Gallery — a custom page that places a spread of standard page
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
import type { Page } from '@objectstack/spec/ui';
4+
5+
/**
6+
* Project detail — a slotted record page that surfaces the project's Tasks as
7+
* an INLINE-EDITABLE `record:line_items` grid (ObjectUI ADR-0001), instead of
8+
* a read-only related list. This is the "view + edit the children together"
9+
* half of the master-detail story: open a project, edit its tasks in place,
10+
* and Save persists the diff (create/update/delete) with the `master_detail`
11+
* FK maintained.
12+
*
13+
* `kind: 'slotted'` with only the `tabs` slot overridden — the synthesizer
14+
* fills in the header / highlights / details / discussion; the Tasks tab below
15+
* replaces the synthesized related-list strip.
16+
*/
17+
export const ProjectDetailPage: Page = {
18+
name: 'showcase_project_detail',
19+
label: 'Project',
20+
type: 'record',
21+
object: 'showcase_project',
22+
kind: 'slotted',
23+
isDefault: true,
24+
regions: [],
25+
slots: {
26+
tabs: {
27+
type: 'page:tabs',
28+
properties: {
29+
type: 'line',
30+
items: [
31+
{
32+
key: 'tasks',
33+
label: 'Tasks',
34+
children: [
35+
{
36+
type: 'record:line_items',
37+
properties: {
38+
childObject: 'showcase_task',
39+
relationshipField: 'project',
40+
amountField: 'estimate_hours',
41+
title: 'Tasks',
42+
columns: [
43+
{ field: 'title', label: 'Title', type: 'text', required: true },
44+
{
45+
field: 'status',
46+
label: 'Status',
47+
type: 'select',
48+
options: [
49+
{ label: 'Backlog', value: 'backlog' },
50+
{ label: 'To Do', value: 'todo' },
51+
{ label: 'In Progress', value: 'in_progress' },
52+
{ label: 'In Review', value: 'in_review' },
53+
{ label: 'Done', value: 'done' },
54+
],
55+
},
56+
{
57+
field: 'priority',
58+
label: 'Priority',
59+
type: 'select',
60+
options: [
61+
{ label: 'Low', value: 'low' },
62+
{ label: 'Medium', value: 'medium' },
63+
{ label: 'High', value: 'high' },
64+
{ label: 'Urgent', value: 'urgent' },
65+
],
66+
},
67+
{ field: 'estimate_hours', label: 'Estimate (h)', type: 'number' },
68+
{ field: 'due_date', label: 'Due Date', type: 'date' },
69+
],
70+
},
71+
},
72+
],
73+
},
74+
],
75+
},
76+
},
77+
},
78+
};

0 commit comments

Comments
 (0)