View metadata — list, kanban, calendar
Configure list views and form views — grid, kanban, calendar, gantt, and more
A View defines how records of an Object are displayed to users. ObjectStack supports two main view categories: List Views for browsing records and Form Views for editing individual records.
The defineView Container
Views are authored per object inside a defineView({ ... }) container — the default list, named listViews and named formViews all live in one document. The loader expands the container into independently addressable <object>.<key> view items that power the view switcher.
// src/ui/views/task.view.ts
import { defineView } from '@objectstack/spec';
const data = { provider: 'object' as const, object: 'task' };
export const TaskViews = defineView({
// Default list shown when the object is opened
list: {
label: 'All Tasks',
type: 'grid',
data,
columns: [
{ field: 'title', width: 300 },
{ field: 'status', width: 120 },
{ field: 'assignee', width: 200 },
{ field: 'due_date', width: 150 },
],
sort: [{ field: 'created_at', order: 'desc' }],
},
// Named saved views — entries in the view switcher
listViews: {
urgent: {
label: 'Urgent',
type: 'grid',
data,
columns: [{ field: 'title' }, { field: 'assignee' }, { field: 'due_date' }],
filter: [{ field: 'priority', operator: 'equals', value: 'urgent' }],
},
},
// A named form, opened by a form action that targets `task.quick_triage`.
// The object's own create and edit forms need no form view: they lay out
// by the object's `fieldGroups` (see Form View below).
formViews: {
quick_triage: {
type: 'simple',
data,
sections: [
{ name: 'triage', label: 'Triage', columns: 2, fields: ['status', 'assignee', 'due_date'] },
],
},
},
});Register the container in your stack config:
// objectstack.config.ts
export default defineStack({
// ...
views: [TaskViews],
});Do not author a flat view object — { name: 'all_tasks', label: 'All Tasks', type: 'grid', columns: [...] } at the top level is not a view
container. Nothing registers from it and no view appears in the switcher.
Every view must live under list, listViews, or formViews, and each
view binds its object via data: { provider: 'object', object: '...' }.
List View
A List View controls how a collection of records is presented. It supports multiple visualization types.
View Types
| Type | Description | Use Case |
|---|---|---|
grid | Table/spreadsheet view | Default record listing |
kanban | Card board grouped by field | Status-based workflows |
gallery | Card grid with images | Visual content browsing |
calendar | Calendar with date events | Scheduling and planning |
timeline | Horizontal timeline | Project scheduling |
gantt | Gantt chart with dependencies | Project management |
map | Geographic map pins | Location-based data |
chart | Aggregate chart visualization | Dashboards and summaries |
tree | Self-referencing hierarchy (tree-grid) | Org charts, category trees |
timesheet | Editable row × weekday entry grid | Weekly time entry, daily quantities |
List View Properties
| Property | Type | Required | Description |
|---|---|---|---|
columns | string[] | ListColumn[] | ✅ | Column definitions (required on every list view, including kanban/calendar/…) |
label | string | optional | Display label shown in the view switcher |
type | enum | optional | View type (see table above; default 'grid') |
data | ViewData | optional | Data source configuration (defaults to the object provider) |
filter | array | optional | Base filter: rules that all must match, any of which may be an any-of group { or: [...] } — see Base filter below |
sort | array | optional | Sort configuration |
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 below |
grouping | object | optional | Row grouping configuration |
pagination | object | optional | Pagination settings |
selection | object | optional | Row selection mode |
navigation | object | optional | Row click navigation |
rowActions | array | optional | Per-row action buttons, by action name — see Actions |
bulkActions | array | optional | Bulk selection actions, by action name — see Actions |
bulkActionDefs | array | optional | Rich bulk action definitions — mass edits, and the aggregate single-call mode (below) |
inlineEdit | boolean | optional | Enable inline editing |
exportOptions | object | optional | Export menu configuration: { formats?, maxRecords?, includeHeaders?, fileNamePrefix?, streaming? }. formats accepts csv, xlsx, json (default ['csv', 'json']). 'pdf' is not an export format: to let users print a list as shown, set the view's allowPrinting; a printable document (an invoice, a delivery order) is a page that declares print — see the page reference. A bare format array is the legacy spelling and lifts to { formats: [...] } at parse |
The view's machine name is its key in the container (listViews.urgent on
object task becomes task.urgent); the default list claims task.default.
List and form views share that one namespace — don't reuse a key.
Base filter (filter)
A list view's filter is a list of conditions that all must match. Each
element is a rule { field, operator, value }, or an any-of group
{ or: [rule, ...] } that matches a record when any of its rules does. A
group holds flat rules only (no group inside a group), and the list still ANDs
the group with the elements beside it:
// open, or completed in the last 7 days — and owned by me
filter: [
{ or: [
{ field: 'status', operator: 'equals', value: 'open' },
{ field: 'completed_at', operator: 'after', value: '{7_days_ago}' },
] },
{ field: 'owner', operator: 'equals', value: '{current_user_id}' },
],The Console's filter builder saves its OR toggle as one such group, and opens a filter that is exactly one group as an OR group. A filter whose group sits beside other conditions is applied to the list as written, but the builder shows it read-only, because it edits one AND or OR over flat rows.
Toolbar search (searchableFields)
The toolbar's search box scans a set the object owns. A list view's
searchableFields narrows that set for this one list — it can never widen
it, and the runtime enforces that by refusing the request, not by quietly
dropping the extra name (ADR-0061, #4254).
What the object allows is resolved server-side, and it is the whole rule:
| The object … | The allowed set is |
|---|---|
declares searchableFields | that list, verbatim — whatever the field types are |
| declares nothing | the auto-default: the name field + the text-like columns (text / email / phone / url / autonumber / textarea / markdown / select / status) |
So field type decides only in the second row. On an object that declares
searchableFields: ['subject', 'account_id'], a view narrowing to
['account_id'] — a lookup — is accepted and scanned (a $contains over
the stored id: narrow, but the engine executes it); on that same object,
narrowing to a text column the object left out is refused. Judge every
entry against the object's allowed set, never against the type list.
A dotted path (account_id.name) is not a valid entry on either branch —
search scans this object's own columns, and the narrowing is intersected with
the allowed set by exact name. To search by a related record's title,
mirror it into a stored field
on the object and list that.
One bad entry 400s EVERY search on that list. Clients echo this
declaration verbatim as the $searchFields override — the active view's list
wins over the object's — and the ingress gate refuses any entry outside the
allowed set before the engine ever runs. The blast radius is the list's whole
search box, for every user and every term: not a narrower result, no result at
all.
| What you write on the view | os validate | Toolbar search at runtime |
|---|---|---|
| a subset of the allowed set | clean | scans exactly those columns |
key omitted, or searchableFields: [] | clean | scans the object's full allowed set — 400 INVALID_FIELD when that set is empty |
| a renamed / mistyped column, or a dotted path | searchable-field-unknown | 400 INVALID_FIELD |
| a real column outside the allowed set | searchable-field-unsearchable | 400 INVALID_FIELD |
a virtual formula column — no stored column to scan (#6674) | searchable-field-unsearchable | 400 INVALID_FIELD |
Both diagnostics are errors, not warnings — os validate fails the build.
The object's own set, and the stored-mirror prescription, are covered under
Global search.
Column Configuration
columns: [
{
field: 'name',
label: 'Account Name',
width: 250,
pinned: 'left', // 'left' | 'right' — freeze column
sortable: true,
resizable: true,
summary: 'count', // Column footer aggregation (enum value)
},
{
field: 'annual_revenue',
label: 'Revenue',
width: 150,
align: 'right',
summary: 'sum',
},
{
field: 'opportunity_name',
prefix: { field: 'stage', type: 'badge' }, // compound cell: [Badge] Text
// Object form of `summary` — aggregate a *different* field in this footer
summary: { type: 'sum', field: 'amount_in_base_currency' },
},
]| Property | Type | Description |
|---|---|---|
field | string | Field name |
label | string | Display header |
width | number | Column width in pixels |
hidden | boolean | Hide column |
pinned | 'left' | 'right' | Freeze column position |
sortable | boolean | Allow column sorting |
resizable | boolean | Allow column resize |
wrap | boolean | Allow text wrapping |
summary | enum | { type, field? } | Footer aggregation: none, count, count_empty, count_filled, count_unique, percent_empty, percent_filled, count_true, count_false (a boolean column's yes / no counts; a cell with no value is neither), sum, avg, min, max. The object form aggregates a different field than the column's own |
prefix | { field, type?: 'badge' | 'text' } | Compound cell — render another field's value inline before this cell's value |
align | 'left' | 'center' | 'right' | Text alignment |
link | boolean | Cell functions as the primary navigation link |
Bulk Actions Over a Selection
Two keys drive the multi-select toolbar. bulkActions names actions the object
already declares, and each selected record is dispatched once — the action
runs N times for N rows. bulkActionDefs carries richer entries: a mass edit
through the data API (operation: 'update' + a patch), or the aggregate
mode, where the action is called once for the whole selection.
bulkActions: ['mark_done'], // one dispatch per selected record
bulkActionDefs: [
// Mass edit — one bulk write, no action involved.
{ name: 'archive', operation: 'update', patch: { archived: true } },
// Aggregate — ONE call to the declared `export_zip` action, carrying every
// selected id. This is the "N devices → one zip download" shape; also batch
// print, merged-PDF export.
{ name: 'export_zip', operation: 'custom', execution: 'aggregate' },
]An aggregate dispatch delivers the selection to the handler as
params._selectedIds: string[] — read that, not recordId. Per-row retry
is replaced by re-running the action. batchSize does not apply (the call is
never chunked); set maxRecords when the server work is expensive.
A handler that moved some rows and refused others resolves with a
BulkActionResult (@objectstack/spec/ui) as its whole return value:
{ succeeded: string[], failed: { id, message }[] }. The result dialog then
counts the moved rows, lists each refused row under its record with its
message, and lists every selected row named in neither list as not
confirmed — never as succeeded. Ids are read against _selectedIds: one
outside the selection is dropped, a duplicate counts once, an id in both lists
counts as failed. A return value with neither member (nothing, a summary, a
download link) counts as covering the whole selection; one that carries
succeeded or failed in any other form (counts, only one list) is reported
as an unreadable result, never as full success.
A rejection is reported as one outcome for the whole selection: the result
dialog says the action did not complete for the selected records and shows the
rejection's message once — its userMessage when the handler threw one (the
text the handler wrote for the user, in the request's locale), else its
message. It shows no per-row count and no per-row failure list, because one
call cannot say which records it had changed before it stopped, nor whether
it kept any of those changes. So the dialog says only that some records may
already have been changed. When you close the dialog at the result step, the
list re-reads its rows, whether the action resolved or rejected, so a record
the handler changed shows its current value; the selection stays after a
rejection, ready for a re-run.
A per-record run reports each record on its own: the result dialog lists every
failed record with its refusal's userMessage when the handler threw one, else
the error's message, and the error CSV keeps each failure's whole message.
Pick the right key for the dispatch you mean. Per-record is
bulkActions: ['<name>'] — the bare-string form, which has nowhere to carry a
flag and is promoted with the action's own label, params and visible.
Aggregate is the def form, which is where execution lives. A def that says
operation: 'custom' without execution: 'aggregate' is rejected at parse
time: the renderer has no action attached to such a def, so it used to render a
button that reported success for every selected record and did nothing.
The action gets a say, and the two ends are checked against each other. An
action declares the contract its body was written for with the same key and the
same two values the def uses — execution: 'perRecord' | 'aggregate' (see
Actions). Wiring a
declared action the other way is refused by os validate / os lint /
os build with action-dispatch-contract-mismatch, naming the action, the
view and both contracts:
// actions: { name: 'export_zip', type: 'api', execution: 'aggregate', … }
bulkActions: ['export_zip'], // ⛔ refused — the bare string is the per-record
// contract; this body reads `_selectedIds`
bulkActionDefs: [
{ name: 'export_zip', operation: 'custom', execution: 'aggregate' }, // ✅
]There is no default: an action that omits execution is checked against
neither wiring, which is also the right declaration for a body deliberately
written to serve both.
Gating a def by capability. An inline def takes
requiredPermissions: string[] with action.requiredPermissions semantics —
absent/empty always passes, several entries AND, unknown caller capabilities
fail open (the server stays the authority). A def promoted from
bulkActions: ['<name>'] (or an aggregate def naming a declared action)
inherits the action's own declaration instead, so this key matters chiefly for
the update/delete data-plane forms, which dispatch no action and have
nothing to inherit from. On those defs the gate governs visibility only —
the mass write itself is still authorized by the data API's object permissions.
A url or api action rendered on the list toolbar can also read the current
selection through target interpolation — ${ctx.selection.ids} (comma-joined)
and ${ctx.selection.count} — without any bulk wiring.
action.bulkEnabled was retired in spec 17. The multi-select toolbar is
driven by these two view keys only.
A bulkActionDefs entry is a typed shape — see the
BulkActionDef reference. Unknown keys are
rejected with the canonical spelling named, and so are keys the executor would
never read (patch outside an update, execution outside a custom,
batchSize on an aggregate). One key is deliberately not authorable:
actionDef is attached by the renderer when it resolves the def's name, and
writing it by hand would smuggle an action definition past the action registry.
Data Source
Views can load data from several sources (object, value, and schema):
// From an Object (most common)
data: { provider: 'object', object: 'task' }
// Static values
data: {
provider: 'value',
items: [{ id: '1', name: 'Item 1' }],
}A view does not call an API. The view-level api data source — a read / write
request block with its own url and headers — was retired: it let a credential or
a cross-origin call be written into metadata and served with the view. A
metadata-declared API call is a page element's dataSource binding, which is
same-origin, carries no credentials and is read with the console's signed-in fetch —
see Element data sources.
Type-Specific Configuration
Each non-grid visualization reads its settings from a nested config block
named after the type (kanban, calendar, gantt, gallery, timeline,
chart, tree, timesheet) — not from top-level keys.
Kanban
type: 'kanban',
columns: ['title', 'assignee', 'priority'], // still required at the top level
kanban: {
groupByField: 'status', // Field to group columns by (usually status/select)
summarizeField: 'amount', // Optional numeric field summed at top of each column
columns: ['title', 'assignee', 'priority'], // Fields shown on each card
}Calendar
type: 'calendar',
calendar: {
startDateField: 'start_date',
endDateField: 'end_date',
titleField: 'title',
colorField: 'status',
}Gantt
type: 'gantt',
gantt: {
startDateField: 'start_date',
endDateField: 'end_date',
titleField: 'title',
progressField: 'percent_complete',
dependenciesField: 'depends_on',
}Timesheet
A timesheet pivots detail records into rows × the days of one week, and every cell is
editable. Each record lands in the row its rowFields values name and the day its
dateField falls on; the cell shows its valueField.
type: 'timesheet',
columns: ['project', 'task', 'work_date', 'hours'],
timesheet: {
rowFields: ['project', 'task'], // 1–3 fields; one row per distinct combination
dateField: 'work_date', // date or datetime; places the record on a day
valueField: 'hours', // number, currency or percent; the cell value
}- One record per cell. Typing into an empty cell creates a record carrying the row's field values, the day and the number; changing a cell updates that record; clearing it deletes the record. Each cell is its own call on the record API, so the object's hooks, validation rules and permissions judge it, and a refusal stays on that cell with the server's message.
- A cell holding several records shows their sum and is read-only; edit those records in a grid view.
- The week starts on the viewer's locale first day, with previous / this / next navigation. Row, day and week totals are always shown.
- Add row asks for the row field values first; the row is kept until a typed cell
creates its first record. The view's
filterapplies to the week's query, so a row the filter excludes disappears on the next read.
All three keys are required: a timesheet view without them shows "Timesheet
configuration required", and os validate warns (view/layout-without-binding).
Switching views
In the Console the list's title is the view switcher: it reads the open view's label and a
▾, with no record count beside it (the list's footer says how many records the view holds).
Ahead of it the title names the object
with its plural label, as Leads / My Leads ▾, so the page says which object it lists
with the sidebar collapsed or the list opened from a link; the object's name leads back to its
default list. A view with no label is already called by the plural and reads alone. Where the
row is short (the split pane, a phone) the object's name stays whole and the view's label is
cut first. The switcher opens a dropdown with a search box
and three sections: Pinned, Recent (the user's last views of this object) and
All, where the views you author come first and the views users save at runtime follow.
The split pane beside an open record keeps the same switcher.
- 📌 Pin makes a view the one this user's list of the object opens when the address names no view. The pin is kept per object, in that browser; unpinning goes back to the object's default view. A view named in the address always wins.
- ☆ Star puts a view in the sidebar's Favorites section of the app, where the user can
drag it into place. A view your app's navigation already opens (an
objectentry with thatviewName) is in the menu already, so its star is disabled. - My views are each user's own. Save as my view, at the end of the dropdown, saves the
list on screen under a name the user gives it: the open view with the user's filter, sort,
grouping, column order, hidden columns and density laid over it. The search term and the
filter chips are not saved. The views appear in their own My views section, where each
row can be renamed or deleted, and 📌 Pin on one makes it that user's default. Nobody else
sees them, and an administrator's Manage views does not list them. They are rows of the
sys_personal_viewobject, not view metadata, so a package never carries them. A user the server grants that object nothing (an external member, today) is offered neither the section nor the save. - Shared views are seen by everyone who can see the list, and only an administrator makes
one: a user whose session holds
manage_metadata, the capability the view's write door (PUT /api/v1/meta/view/:name) asks, so the server refuses everyone else whatever the Console shows. For that administrator Add view offers Shared beside My view (My view stays the default). A view created shared is published at once: there is no draft to publish first. A user who opens a view that has since been deleted is told so, and the list shows its default view.
Form View
A Form View is a hand-shaped form for a record. It lives in the same defineView container as the object's list views, and it is served only where it is asked for by name:
formViewsholds named forms. Each one loads where something names it: a form action'starget(<object>.<key>) or a public form (sharing.enabled: true) at its own link.- The Console's create and edit forms load no form view. They lay the record out by the object's
fieldGroupsand the field rules, and leave out of create every field markedshowOnCreate: false; see Create form vs edit form. A non-publicform,formViews.defaultorformViews.createstill parses but changes nothing on those two forms, andos validatereports it asform-view-internal-not-loaded. The exception is one that a form action opens by name: it still loads where that action opens it, and is not reported. The action'stargetmust be the form's served name written out, since an interpolated target names no form.
Basic Structure
// One entry of `formViews`
review: {
type: 'simple',
data: { provider: 'object', object: 'task' },
sections: [
{
name: 'basic_information',
label: 'Basic Information',
columns: 2,
fields: [
{ field: 'title', span: 'full' },
{ field: 'status' },
{ field: 'priority' },
{ field: 'assignee' },
{ field: 'due_date' },
],
},
{
name: 'details',
label: 'Details',
collapsible: true,
columns: 1,
fields: [
{ field: 'description' },
],
},
],
},Form Types
| Type | Description |
|---|---|
simple | Single-page form (the default) |
tabbed | Form with tab navigation |
wizard | Multi-step wizard |
type is the form's layout only. Where a form opens is not part of the form:
a list opens a clicked record by its name (the full page) or by the side-panel icon beside
it (the drawer), and the console's New and Edit entries open the record form
themselves. The old split, drawer and modal values were removed in
@objectstack/spec 18.3.0 and are refused with the fix; run
os migrate meta --from 17 to rewrite existing sources.
Section Configuration
| Property | Type | Description |
|---|---|---|
name | string | Stable identifier (snake_case) for i18n lookup — resolves objects.{object}._sections.{name}.label. A nameless section renders its authored label in every locale, so give every section a name if the app is localized |
label | string | Section header |
columns | 1-4 | Grid column count |
collapsible | boolean | Can section be collapsed |
collapsed | boolean | Initially collapsed |
visibleWhen | string | CEL predicate — section shown only when TRUE. Same scope boundary as field-level predicates: no features.* (refused at parse — see below) |
fields | (string | FormField)[] | Fields in the section |
Form Field Configuration
Each field in a form section can be customized:
fields: [
{
field: 'title',
label: 'Task Title', // Override field label
placeholder: 'Enter title',
helpText: 'A brief description of the task',
required: true, // Override required
span: 'full', // Resolves to the form grid's full column count
visibleWhen: "record.status != 'cancelled'",
},
]| Property | Type | Description |
|---|---|---|
field | string | Field name |
label | string | Display label override |
placeholder | string | Placeholder text |
helpText | string | Help/hint text |
readonly | boolean | Read-only override |
required | boolean | Required override |
hidden | boolean | Hidden override |
span | 'auto' | 'full' | Relative width — 'full' resolves to the form grid's full column count; which container-query tiers emit the span is the renderer's (widest tier only at objectui 53ded82bf7, per objectstack#17328; one clamped class per tier since objectui#9253) |
colSpan | 1-4 | Absolute column span, clamped by the renderer to the current column count — grid-aligned at every surface width |
widget | string | Custom widget/component name |
dependsOn | string | Parent field for cascading |
visibleWhen | string | Visibility predicate (CEL); runtime form fields bind record (+ previous, parent) and, since objectui#6010, current_user — the identity scope page components and per-option predicates already bound (ADR-0089 D1). Form sections bind the same scope since objectui#6110 + objectui#6111. One surface still evaluates it unbound, where the predicate faults open: the public /f/:slug route, mounted outside any provider on purpose because an anonymous visitor has no principal — the authed /forms/:name publishes the session principal and binds normally. ⚠️ Either way the binding is client-side only: nothing on the write path evaluates a form-view field or section visibleWhen, so a current_user.positions test here hides controls and protects no data — declare permission-set field-level security for that. No features.* on any form-view predicate — refused at parse, see the boundary note below. (was visibleOn, ADR-0089) |
Form-view predicates may not name the features.* scope root (ruled 2026-08-27, objectui#6262).
A form view also renders on routes with no app context — the console's standalone /forms/:name
and the public /f/:slug — where features is unbound: the predicate faults and visibleWhen
fails open, so the field or section a feature flag was meant to hide is shown to everyone.
The spec therefore refuses features.* loudly at parse on every form-view predicate —
section-level, field-level at any nesting depth, and per-option visibleWhen authored inline in
the form view. Gate by record state instead (record.*), or put the feature-gated surface on an
app page or action, where features.* stays bound and stays legal. A record field named
features is unaffected — record.features.x is member access, not the scope root.
How a list opens a record
In the console an object's list opens a record one way, for every reader and every view:
the record's name opens the full page, and the side-panel icon shown beside the name
while the row is hovered opens the record in a drawer over the list, which keeps its full
width. There is no setting to choose between them. Every list-type view (grid, tree, kanban,
calendar, gantt, list, gallery, map and timeline) opens the same record page, so a record
reads with its declared labels and typed values, without its hidden fields, whichever view
it came from. On a phone, or any touch screen without hover, there is no icon: the name opens
the page. A ⌘/Ctrl or middle click on the name opens the page in a new tab.
navigation.mode is deprecated and no longer picks this: on an object's list drawer,
page and new_window still parse and change nothing, so a view that declares one behaves as
one that declares nothing. none keeps its meaning, the rows open nothing; prefer
navigation: { preventNavigation: true } for that. Omit the key. modal, split and popover
were removed in @objectstack/spec 18.3.0 (ADR-0087 D2): a stored value is refused with its fix,
and os migrate meta --from 17 drops it. none and preventNavigation hold on a phone too,
where a list draws each row as a card showing only some of its columns, so the columns a card
does not show are unreachable there: declare either only where the rows need no detail view.
The page a list opens remembers that list: its top bar counts the record among the list's rows (N of M, M being the records the list matched), steps to the previous and next of them, and its ✕ returns to the list as it was left (view, filters, sort, search, grouping and scroll position). This rides in the browser's history entry, so it survives a reload of the tab; a page opened any other way (a shared link, a notification, a search) has none.
The drawer is a card floating over the list. The reader drags its edge to resize it, and its
⤢ opens the full page; there is no wider state. The size bucket on navigation sets
only the drawer's starting width; width is deprecated.
The record opened from a list is addressable: ?recordId= on the list's URL, so a
reload, a shared link or Back reopens it. A record opened inside the drawer (a related
row, a lookup value) opens one level down in the same drawer; those levels are
in-memory, so a reload shows the root record. A record page's own layout, and the
reader's right-column and panel choices on it, are described in
Pages.
A user's list state never writes the view
A header sort, a filter change, grouping, the search, Hide Fields, an added field, a column drag, a footer calculation picked under a column, and the Display panel's layout and row color apply at once and are a draft: they are kept nowhere and never write the view metadata, so they work even where the tenant's metadata is read-only. While the list holds a draft, Discard and Save sit at the end of the condition row (one Save whose menu also holds Discard on a narrow list or a phone).
- Save names what is unsaved and keeps the sort, filters, columns, hidden fields, footer calculations, layout and row color: Save to this view, or Save as my view, which asks a name first (the view's name with "copy") and then opens the new view. Either says "Saved", and the buttons go while the conditions stay. A view the user cannot change in place (one an app package ships, or a shared view they may not edit) offers Save as my view alone.
- Save to this view on a view of the user's own saves it at once. On a shared view it is offered to a user who may edit the view (an administrator, on a stored view whose package takes saves; while the Console has not yet read which packages take saves, it is not offered). It asks once ("everyone who uses this view will see these changes"), then saves the view and publishes it in the same step, so every user sees it on their next read, and says "Saved, visible to everyone". It never writes the user's row height or column widths into the view. When the view already has unpublished changes (a draft saved from the view settings, by anyone), nothing is saved: the Console says so and points to the view settings to publish or discard that draft first. Every other change to a shared view still goes to a draft that the view settings publish. A view settings save is pinned to the draft the settings opened, so one that lands while a Save to this view is between its save and its publish is refused, never published with it: the settings say the draft changed and offer to reload it, overwrite it or keep editing.
- A footer calculation is offered on every column the saved view would carry: the columns the list draws and the fields the user added. Picking the view's own calculation again takes that column out of the draft.
- When the server refuses to save a view an app package ships, the list says so in the user's language (it cannot be changed directly; save it as your own view), never the server's own text.
- Discard puts the list back as its view declares it, the Display panel's layout and row
color included, and removes the list's
uf_*parameters from the address bar. - The draft survives opening a record and coming back. Opening another view or object, or reloading the list's page, drops it, so that reload opens the view as it is declared.
- Column widths, the row height (density) and the views' order are not a draft: they are
remembered in this browser only, per signed-in user and object (localStorage
list-layout:<user id>:<object>). Nothing is sent to the server, another browser or device opens the view's own layout, and signing out clears them with the rest of this browser's Console state. Earlier Consoles kept them, with a stored sort and filters, in the user'ssys_user_preferencerowui.list.<object>; nothing reads that row now. - A link carrying list state (
uf_*parameters) applies it as a draft, whether it opens in a new tab or in-app (an AI answer's list link, after a reload of the chat page too). - When a session ends, the sign-in page's return link keeps the list's path but never its
uf_*state, so whoever signs in next opens the view's default. - A user's hidden fields only subtract from the columns the view shows, never add one.
- Pinned views, favorites, how records open and a "View all" link's
filter[...]scope are not part of a draft and stay. Nothing about Discard and Save is configurable.
A view the user may not open
The server lists only the views and dashboards a user may open, so one gated by
requiredPermissions is absent from their lists. Opened by URL, it answers
403 PERMISSION_DENIED, and the Console shows "You don't have access" with the
server's sentence, not "not found". A name that does not exist still reads "not found".
Complete Example
One container covering a default grid, a kanban saved view, and a tabbed named form that a form action opens:
import { defineView } from '@objectstack/spec';
const data = { provider: 'object' as const, object: 'task' };
export const TaskViews = defineView({
list: {
label: 'All Tasks',
type: 'grid',
data,
columns: [
{ field: 'title', label: 'Title' },
{ field: 'assignee', label: 'Assignee' },
{ field: 'priority', label: 'Priority' },
{ field: 'due_date', label: 'Due Date' },
],
sort: [{ field: 'priority', order: 'desc' }],
},
listViews: {
board: {
label: 'Task Board',
type: 'kanban',
data,
columns: ['title', 'assignee', 'priority', 'due_date'],
kanban: {
groupByField: 'status',
columns: ['title', 'assignee', 'priority', 'due_date'],
},
},
},
formViews: {
full_review: {
type: 'tabbed',
data,
sections: [
{
name: 'details',
label: 'Details',
columns: 2,
fields: [
{ field: 'title', span: 'full', required: true },
{ field: 'status' },
{ field: 'priority' },
{ field: 'assignee' },
{ field: 'due_date' },
{ field: 'description', span: 'full' },
],
},
{
name: 'system',
label: 'System',
collapsible: true,
collapsed: true,
columns: 2,
fields: [
{ field: 'created_at', readonly: true },
{ field: 'updated_at', readonly: true },
],
},
],
},
},
});Related
- Object Metadata — Define the data behind views
- Field Metadata — Field types that views display
- Page Metadata — Custom pages with component layouts
- Dashboard Metadata — Analytics dashboards with charts
React Pages
Write a page body as real React or as constrained JSX that is parsed but never executed — the two source-authoring tiers and how to choose between them.
Actions
Declare buttons as metadata with server-side behavior — bind them to lists, records and navigation, permission-check both sides, and expose them to AI.