Skip to content

Commit fa15002

Browse files
committed
docs(ui): state the view filter any-of group in the views guide; Skills-docs line in the changeset
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgXa2W2ZCA4huS5hVVx
1 parent 55235a5 commit fa15002

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

‎.changeset/28370-view-filter-or-group-console.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ feat(console): a stored view filter's OR group filters the list, and the filter
1010

1111
Clause-②: yes (widening: `@object-ui/core` adds the export `builderRulesOfSpecFilter` and its result type `BuilderFilterRules`; no schema, accept set or error code changes)
1212
Metadata-protocol: none
13+
Skills-docs: follow-up owed — skills/objectstack-ui/rules/list-views.md, skills/objectstack-ui/evals/views-apps-actions-pages.json (the any-of group is not taught there yet); `content/docs/ui/views.mdx` gains a Base filter section that states it
1314

1415
A view filter list may hold an any-of group beside its rules, `{ or: [rule, ...] }` (`ViewFilterOrGroupSchema` in `@objectstack/spec/ui`): the list ANDs its elements and the group ORs its rules. Until now no console reader applied it. The list query passed the group through, the server refused the query as a malformed filter (400 `INVALID_FILTER`), and the view showed no rows.
1516

‎content/docs/ui/views.mdx‎

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ A List View controls how a collection of records is presented. It supports multi
9898
| `label` | `string` | optional | Display label shown in the view switcher |
9999
| `type` | `enum` | optional | View type (see table above; default `'grid'`) |
100100
| `data` | `ViewData` | optional | Data source configuration (defaults to the `object` provider) |
101-
| `filter` | `array` | optional | Base filter criteria |
101+
| `filter` | `array` | optional | Base filter: rules that all must match, any of which may be an any-of group `{ or: [...] }` — see [Base filter](#base-filter-filter) below |
102102
| `sort` | `array` | optional | Sort configuration |
103103
| `searchableFields` | `string[]` | optional | Fields the toolbar search scans — **narrows** the set the object allows, never widens it (ADR-0061). Every entry must be in that allowed set, or every toolbar search on the list returns `400 INVALID_FIELD` (#4254) — see [Toolbar search](#toolbar-search-searchablefields) below |
104104
| `grouping` | `object` | optional | Row grouping configuration |
@@ -115,6 +115,30 @@ The view's machine name is its **key** in the container (`listViews.urgent` on
115115
object `task` becomes `task.urgent`); the default `list` claims `task.default`.
116116
List and form views share that one namespace — don't reuse a key.
117117

118+
### Base filter (`filter`)
119+
120+
A list view's `filter` is a list of conditions that **all** must match. Each
121+
element is a rule `{ field, operator, value }`, or an **any-of group**
122+
`{ or: [rule, ...] }` that matches a record when **any** of its rules does. A
123+
group holds flat rules only (no group inside a group), and the list still ANDs
124+
the group with the elements beside it:
125+
126+
```typescript
127+
// open, or completed in the last 7 days — and owned by me
128+
filter: [
129+
{ or: [
130+
{ field: 'status', operator: 'equals', value: 'open' },
131+
{ field: 'completed_at', operator: 'after', value: '{7_days_ago}' },
132+
] },
133+
{ field: 'owner', operator: 'equals', value: '{current_user_id}' },
134+
],
135+
```
136+
137+
The Console's filter builder saves its **OR** toggle as one such group, and
138+
opens a filter that is exactly one group as an OR group. A filter whose group
139+
sits beside other conditions is applied to the list as written, but the
140+
builder shows it read-only, because it edits one AND or OR over flat rows.
141+
118142
### Toolbar search (`searchableFields`)
119143

120144
The toolbar's search box scans a set the **object** owns. A list view's

0 commit comments

Comments
 (0)