Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/36422-skills-board-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/skills': patch
---

docs(skills): objectstack-ui teaches the board's lane statistic and card settings

Clause-②: no
Metadata-protocol: none

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.
32 changes: 17 additions & 15 deletions skills/objectstack-ui/rules/list-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ Rules:
`element: 'dropdown'` (value chips) is allowed — `tabs` is page-only**
(ADR-0047 amendment): the saved-view switcher already owns the tab bar, so
`ObjectUserFiltersSchema` **rejects** `tabs` at parse (not dropped) and the
`validate` list-view-mode lint reports it. The full
`dropdown | tabs | toggle` range applies only to **page lists** /
`interfaceConfig.userFilters`.
`validate` list-view-mode lint reports it.
- **Omit `userFilters` when unsure — omission means a clean toolbar.** Nothing
is auto-derived.
- `userFilters: { element: 'dropdown' }` (no `fields`) is valid shorthand:
Expand All @@ -168,10 +166,8 @@ import { defineView } from '@objectstack/spec';
const data = { provider: 'object' as const, object: 'support_case' };

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

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

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

Both diagnostics are **errors**, not warnings — `os validate` fails the build.
Both diagnostics are **errors**: `os validate` fails the build.

To remove the search box, toggle the affordance instead:

Expand All @@ -221,7 +216,7 @@ export const AuditViews = defineView({
list: {
label: 'Audit Log', type: 'grid', data,
columns: ['case_number', 'status'],
userActions: { search: false }, // ← no search box
userActions: { search: false },
},
});
```
Expand Down Expand Up @@ -270,9 +265,11 @@ const board: ListView = {
data: { provider: 'object', object: 'project_task' },
columns: ['title', 'owner_id', 'priority'],
kanban: {
groupByField: 'status', // a select field — one lane per option
groupByField: 'status', // a select field
lanes: ['todo', 'in_progress', 'review'],
summarizeField: 'estimate_hours', // optional — summed at the top of each column
summary: { type: 'sum', field: 'estimate_hours' }, // each lane's foot statistic
showFieldLabels: false, // default true: cards name each field
hideEmptyFields: false, // default true: cards drop an empty field
columns: ['title', 'owner_id', 'priority'], // fields shown on each card
},
sort: [{ field: 'priority', order: 'desc' }],
Expand All @@ -284,13 +281,18 @@ const board: ListView = {
> off the board. Omit it to draw every option in its own order; a value that is
> not one of the field's inline options, or listed twice, fails `os validate`.

> `summary.type`: `none`, `count`, or `sum` / `avg` / `min` / `max` of a `field`,
> computed by the query over every record of the lane, not only the loaded
> cards. Known gap: over a lookup field or in a grouped view, `sum` covers one
> fetched page and the other three show nothing. `summary` overrides the older
> sum-only `summarizeField`.

### Adding a board, calendar, gallery or gantt beside the list

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