Skip to content

Commit 4266fbe

Browse files
committed
docs(getting-started): drop the tutorial's internal create/edit form for field groups
The Build with Claude Code page's ticket view declared an internal create/edit form, which the platform no longer loads (os validate: form-view-internal-not-loaded). The ticket object now places its fields with fieldGroups, the paragraph says how create and edit lay a ticket out, and the tutorial's e2e pin asserts both advisories absent. Claude-Session: https://claude.ai/code/session_01ADHkmSwS4mQyXWrddL4r6B Co-authored-by: Claude <noreply@anthropic.com>
1 parent 555d699 commit 4266fbe

2 files changed

Lines changed: 35 additions & 19 deletions

File tree

‎content/docs/getting-started/build-with-claude-code.mdx‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@ export const Ticket = ObjectSchema.create({
132132
description: 'A customer support request.',
133133

134134
fields: {
135-
subject: Field.text({ label: 'Subject', required: true, searchable: true, maxLength: 200 }),
136-
description: Field.textarea({ label: 'Description' }),
135+
subject: Field.text({ label: 'Subject', required: true, searchable: true, maxLength: 200, group: 'ticket' }),
136+
description: Field.textarea({ label: 'Description', group: 'ticket' }),
137137

138138
priority: Field.select({
139139
label: 'Priority',
140140
required: true,
141+
group: 'ticket',
141142
options: [
142143
{ label: 'Low', value: 'low', default: true },
143144
{ label: 'Normal', value: 'normal' },
@@ -149,6 +150,7 @@ export const Ticket = ObjectSchema.create({
149150
status: Field.select({
150151
label: 'Status',
151152
required: true,
153+
group: 'ticket',
152154
options: [
153155
{ label: 'Open', value: 'open', color: '#3B82F6', default: true },
154156
{ label: 'Pending', value: 'pending', color: '#F59E0B' },
@@ -158,6 +160,11 @@ export const Ticket = ObjectSchema.create({
158160
}),
159161
},
160162

163+
// The create and edit forms lay a ticket out by these groups: one section,
164+
// its fields in declaration order. No field is marked `showOnCreate: false`,
165+
// so the create form asks for all four.
166+
fieldGroups: [{ key: 'ticket', label: 'Ticket' }],
167+
161168
sharingModel: 'private', // org-wide default (OWD) — required by the security gate
162169
enable: { apiEnabled: true, searchable: true },
163170
});
@@ -212,17 +219,6 @@ export const TicketViews = defineView({
212219
sort: [{ field: 'priority', order: 'desc' }],
213220
},
214221
},
215-
form: {
216-
type: 'simple',
217-
data,
218-
sections: [
219-
{
220-
name: 'ticket',
221-
label: 'Ticket',
222-
fields: [{ field: 'subject' }, { field: 'description' }, { field: 'priority' }, { field: 'status' }],
223-
},
224-
],
225-
},
226222
});
227223
```
228224

@@ -306,11 +302,16 @@ passes an unregistered one, the `os dev` boot log warns
306302
fails when clicked (the
307303
[two paths](/docs/ui/actions#give-it-server-behavior--two-paths) a handler takes).
308304

309-
The view file also declares the create and edit **form**, and the form is where the
310-
long-text `description` is entered and shown. The list columns leave it out, so the
311-
form is the only metadata that names it. A field that no consumer names (a view, a form, a
312-
flow, a formula or an action, among the others the rule counts) gets an advisory
313-
`field-no-consumers` warning from `os validate`.
305+
The view file declares lists only: no file declares a create or edit **form**.
306+
Both forms lay a ticket out by the object's `fieldGroups`, so each field's
307+
`group: 'ticket'` puts it in the one **Ticket** section, in the order the
308+
fields are declared. No field is marked `showOnCreate: false`, so the create
309+
form asks for all four, the long-text `description` among them. The list
310+
columns leave `description` out, so its group is the only metadata that names
311+
it, and that placement counts as a consumer: a field that no consumer names (a
312+
view column, a field group, a flow, a formula or an action, among the others
313+
the rule counts) gets an advisory `field-no-consumers` warning from
314+
`os validate`, and the run below prints none for `description`.
314315

315316
The agent also **exports each new file from its directory's barrel**: one line
316317
at the end of each of the three `index.ts` files, beside the lines the starter

‎packages/cli/test/getting-started-build-with-claude-code.e2e.test.ts‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
* Asserted beside the run: every new file is exported by a barrel line the page
3434
* shows, in its own directory's `index.ts` (the page's rule that metadata
3535
* exists only if its barrel exports it). Exit statuses and count lines are
36-
* asserted; prose is not pinned.
36+
* asserted; prose is not pinned. Two advisories are asserted absent, by rule
37+
* id: `form-view-internal-not-loaded` (the page's files declare no internal
38+
* create/edit form, which the platform does not load) and `field-no-consumers`
39+
* on the ticket's `description` (the page says its field group is the
40+
* consumer that names it).
3741
*
3842
* The `Runtime:` line is not compared. The project here is not installed (it
3943
* lives under this package's `node_modules`, so its imports resolve to
@@ -221,4 +225,15 @@ describe('the page, followed verbatim in a fresh `blank` scaffold', () => {
221225
const printed = validate.stdout.split('\n').filter((l) => COUNT_LINE.test(l)).map(fold);
222226
for (const line of countLines) expect(printed, out(validate)).toContain(line);
223227
});
228+
229+
it('prints no `form-view-internal-not-loaded`: the page declares no internal create/edit form', () => {
230+
expect(out(validate)).not.toContain('form-view-internal-not-loaded');
231+
});
232+
233+
it("prints no `field-no-consumers` for the ticket's `description`: its field group names it", () => {
234+
const advisories = out(validate)
235+
.split('\n')
236+
.filter((l) => l.includes('field "description"') && l.includes('support_desk_ticket'));
237+
expect(advisories, out(validate)).toEqual([]);
238+
});
224239
});

0 commit comments

Comments
 (0)