Skip to content

Commit 159113f

Browse files
docs(skills): objectstack-ui teaches the board's lane statistic and card settings (#37063)
repo:objectstack#4 · os-justin · session_01QSeKYo86w1wqy2z2fMrryr Fixes #36422 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用 AI 助手搭看板的应用作者,拿到的看板配置会带上每条泳道底部的统计(计数、合计、平均、最小、最大),以及卡片上「是否显示字段名」「是否隐藏空字段」两个开关;此前助手只会写旧的求和写法。 - 为什么做:这是「看板视图有了自己的设置」这项工作的收尾,技能文档此前没有教这些新设置。 - 出错会怎样:助手会照着错的说明去写看板配置;本次只改文字,可以直接撤回。 - 要你做什么:无。 ## What changes `skills/objectstack-ui/rules/list-views.md`, section "Configuring Kanban Views": - The board example writes `kanban.summary` (`{ type: 'sum', field: 'estimate_hours' }`) in place of `summarizeField`, and sets `showFieldLabels` and `hideEmptyFields`, each with its default (`true`) in the trailing comment. - One note under the example: the six `summary.type` values (`none`, `count`, `sum`, `avg`, `min`, `max`); the four aggregates take a `field` and are computed by the query over every record of the lane, not only the loaded cards; the known gap the spec names (lanes over a lookup field, or a view with grouping: `sum` covers one fetched page and the other three show nothing); `summary` takes precedence over the older sum-only `summarizeField`. - `summarizeField` is still an accepted key (`KanbanConfigSchema` in `packages/spec/src/ui/view.zod.ts` declares it, no tombstone, no conversion), so it is named once as the older spelling and no longer taught as the way to write a lane statistic. No other file under `skills/` mentions it (`git grep summarizeField -- skills` at this head: one hit, the new note). Every sentence was written from the spec's describe text and JSDoc for `KanbanLaneSummarySchema`, `summary`, `showFieldLabels` and `hideEmptyFields` at main a68b475. ### Paid for in the same file The file had 4 bytes of token headroom, so the new teaching is paid by cutting restatement in `list-views.md` itself. No ratchet row moves. | Cut | Restates | |:---|:---| | search example comment "No `searchableFields` ..." | the "key omitted" row of the table below it | | search example comment "This list only ..." | the `searchableFields` line under it | | "The full `dropdown / tabs / toggle` range applies only to page lists ..." | "`tabs` is page-only" in the same bullet | | "the whole search box, for every user and every term: no result at all" | its own heading, "One bad entry 400s EVERY search on that list" | | "errors, not warnings" | "fails the build" in the same sentence | | comment "no search box" | the sentence introducing the example | | "one lane per option" on `groupByField` | the `lanes` note under the example | | "the default `list` and every other view untouched" | "a NEW `listViews` entry that coexists with the views the object has" | | gantt comments "task bar start" / "task bar end" | the key names `startDateField` / `endDateField` | ### Skills size readings | | before (a68b475) | after (7d7ca6d) | |:---|:---|:---| | `rules/list-views.md` lines | 409 | 411 | | `rules/list-views.md` bytes / tokens | 17788 / 4447 | 17775 / 4444 (ceiling 4448) | | all `SKILL.md` files, lines | 4942 | 4942 (none touched) | | bundle total, tokens | 295195 (the measured after, plus this file's 3) | 295192 (measured) | Net lines in `skills/**`: +2 (17 added, 15 removed), against a budget of +12. ## Tests Head 7d7ca6d. Text only: no tested behaviour changes, so no ablation. - `pnpm --filter @objectstack/spec run check:skill-examples` (spec and the client-react closure built first, under the verify lock): exit 0, "350 prose examples type-check across 3 surface(s)". This is the gate that type-checks the board example against `ListView`. - `node scripts/check-skills-token-ratchet.mjs`: exit 0, "skills/objectstack-ui/rules/list-views.md is 4444 tokens (ceiling 4448; headroom 4)". ## Acceptance notes - Card acceptance: the board example uses all three keys the board gained (`summary`, `showFieldLabels`, `hideEmptyFields`); the scope addition's three statistics (`avg`, `min`, `max`) are named with what they cover. - No eval case was added. No case in `evals/views-apps-actions-pages.json` exercises these keys, and a case was drafted, but `scripts/pm/overlap-check.mjs` answered exit 1 against open PR #37043, which appends to the same file. The case was dropped so this branch does not queue behind that pull (overlap-check at this head: `VERDICT clean exit 0`). A case for the lane statistic can follow once that pull lands. - The example sets `showFieldLabels: false` and `hideEmptyFields: false`, the non-default values, so the keys are visible in the example; the comments carry the defaults. ## Verification First files to read: `skills/objectstack-ui/rules/list-views.md` (the hunk at "Configuring Kanban Views" is the teaching; every other hunk is a cut). Two-minute check: open the spec describe text for `summary`, `showFieldLabels` and `hideEmptyFields` in `packages/spec/src/ui/view.zod.ts` beside the new note. Expected: every clause of the note has a source sentence there. Local gate subset (derived by `dispatch-gates.mjs --commands`, 48 families): 43 exit 0; 5 exit 3, PREREQUISITE NOT MET because the full workspace is not built here (`check:doc-formula-expressions`, `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`). Those five are NOT MEASURED locally and left to CI; none reads a skills file's prose. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYo86w1wqy2z2fMrryr)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 896bfc4 commit 159113f

2 files changed

Lines changed: 27 additions & 15 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): objectstack-ui teaches the board's lane statistic and card settings
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The kanban example in `rules/list-views.md` now writes `kanban.summary` in place of the older sum-only `summarizeField`, and sets `showFieldLabels` and `hideEmptyFields` with their defaults (both `true`). One note names the six lane statistics (`none`, `count`, `sum`, `avg`, `min`, `max`), says the four aggregates cover every record of the lane and not only the loaded cards, names the known gap (a board over a lookup field or in a grouped view), and says `summary` takes precedence over `summarizeField`. Text only; restating comments and sentences in the same file are cut to pay for it.

‎skills/objectstack-ui/rules/list-views.md‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ Rules:
148148
`element: 'dropdown'` (value chips) is allowed — `tabs` is page-only**
149149
(ADR-0047 amendment): the saved-view switcher already owns the tab bar, so
150150
`ObjectUserFiltersSchema` **rejects** `tabs` at parse (not dropped) and the
151-
`validate` list-view-mode lint reports it. The full
152-
`dropdown | tabs | toggle` range applies only to **page lists** /
153-
`interfaceConfig.userFilters`.
151+
`validate` list-view-mode lint reports it.
154152
- **Omit `userFilters` when unsure — omission means a clean toolbar.** Nothing
155153
is auto-derived.
156154
- `userFilters: { element: 'dropdown' }` (no `fields`) is valid shorthand:
@@ -168,10 +166,8 @@ import { defineView } from '@objectstack/spec';
168166
const data = { provider: 'object' as const, object: 'support_case' };
169167

170168
export const CaseViews = defineView({
171-
// No `searchableFields` → the toolbar searches everything the object allows.
172169
list: { label: 'All Cases', type: 'grid', data, columns: ['subject', 'status'] },
173170
listViews: {
174-
// This list only: search the reference number and the subject line.
175171
triage: {
176172
label: 'Triage', type: 'grid', data,
177173
columns: ['case_number', 'subject', 'status'],
@@ -196,8 +192,7 @@ Modelling side: **objectstack-data → Search Fields**. Query side
196192
#### ⛔ One bad entry 400s EVERY search on that list
197193

198194
The client sends this list verbatim as the `$searchFields` override and the
199-
ingress gate refuses any entry outside the allowed set before the engine runs —
200-
the whole search box, for every user and every term: no result at all.
195+
ingress gate refuses any entry outside the allowed set before the engine runs.
201196

202197
| What you write on the view | `os validate` | Toolbar search at runtime |
203198
|:---------------------------|:--------------|:--------------------------|
@@ -207,7 +202,7 @@ the whole search box, for every user and every term: no result at all.
207202
| a renamed / mistyped column, or a dotted path (`account_id.name`) | `searchable-field-unknown` | `400 INVALID_FIELD` |
208203
| a real column outside the allowed set, or a virtual `formula` column | `searchable-field-unsearchable` | `400 INVALID_FIELD` |
209204

210-
Both diagnostics are **errors**, not warnings — `os validate` fails the build.
205+
Both diagnostics are **errors**: `os validate` fails the build.
211206

212207
To remove the search box, toggle the affordance instead:
213208

@@ -221,7 +216,7 @@ export const AuditViews = defineView({
221216
list: {
222217
label: 'Audit Log', type: 'grid', data,
223218
columns: ['case_number', 'status'],
224-
userActions: { search: false }, // ← no search box
219+
userActions: { search: false },
225220
},
226221
});
227222
```
@@ -270,9 +265,11 @@ const board: ListView = {
270265
data: { provider: 'object', object: 'project_task' },
271266
columns: ['title', 'owner_id', 'priority'],
272267
kanban: {
273-
groupByField: 'status', // a select field — one lane per option
268+
groupByField: 'status', // a select field
274269
lanes: ['todo', 'in_progress', 'review'],
275-
summarizeField: 'estimate_hours', // optional — summed at the top of each column
270+
summary: { type: 'sum', field: 'estimate_hours' }, // each lane's foot statistic
271+
showFieldLabels: false, // default true: cards name each field
272+
hideEmptyFields: false, // default true: cards drop an empty field
276273
columns: ['title', 'owner_id', 'priority'], // fields shown on each card
277274
},
278275
sort: [{ field: 'priority', order: 'desc' }],
@@ -284,13 +281,18 @@ const board: ListView = {
284281
> off the board. Omit it to draw every option in its own order; a value that is
285282
> not one of the field's inline options, or listed twice, fails `os validate`.
286283
284+
> `summary.type`: `none`, `count`, or `sum` / `avg` / `min` / `max` of a `field`,
285+
> computed by the query over every record of the lane, not only the loaded
286+
> cards. Known gap: over a lookup field or in a grouped view, `sum` covers one
287+
> fetched page and the other three show nothing. `summary` overrides the older
288+
> sum-only `summarizeField`.
289+
287290
### Adding a board, calendar, gallery or gantt beside the list
288291

289292
"Add a kanban (calendar / gallery / gantt) view" means a NEW `listViews` entry
290293
that coexists with the views the object has — its key encodes the kind or
291294
purpose (`status_kanban`, `timeline_gantt`: the key a nav item's `viewName`
292-
names, registered as `OBJECT.status_kanban`), the default `list` and every
293-
other view untouched. Never satisfy an add by retyping `list` (or an existing named
295+
names, registered as `OBJECT.status_kanban`). Never satisfy an add by retyping `list` (or an existing named
294296
view) to `type: 'kanban'`: nothing refuses it, the view is converted in place
295297
and the original is gone. Change a view's kind in place only when the request
296298
says to convert or replace THAT view.
@@ -326,8 +328,8 @@ const timeline: ListView = {
326328
data: { provider: 'object', object: 'project_task' },
327329
columns: ['name', 'owner_id', 'status'], // left-pane tree columns
328330
gantt: {
329-
startDateField: 'start_date', // task bar start
330-
endDateField: 'end_date', // task bar end
331+
startDateField: 'start_date',
332+
endDateField: 'end_date',
331333
titleField: 'name', // bar label
332334
progressField: 'progress', // 0–100 fill
333335
dependenciesField: 'depends_on', // FS dependency arrows

0 commit comments

Comments
 (0)