You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d19cbad
Browse filesBrowse the repository at this point in the historyBrowse files
chore(spec): regenerate artifacts, correct the per-user wording, add the changeset
- api-surface / export-origins record the new `VIEW_CONSOLE_ROUND_TRIP_KEYS`
export; the view reference page carries the declared meanings.
- A stored `view` row has no per-user scope, so the column-layout
descriptions no longer call it per-user state.
- Changeset: `@objectstack/spec` minor, with the Clause-② declaration.
Claude-Session: https://claude.ai/code/session_01ARcDurZ5j34RdqsGgc4jgH
Co-authored-by: Claude <noreply@anthropic.com>
feat(spec): the console's round-trip keys on a stored `view` row are declared on the wire, so a parse keeps them (#20456)
6
+
7
+
Clause-②: yes
8
+
9
+
`saveMetaItem` stores a `view` body exactly as it was sent (ADR-0005 appendix (c)), and the members of `ViewMetadataSchema` that judge a stored row `.strip()` every key they do not declare. So the keys the console writes onto a stored view and reads back were in the store and nowhere in the contract. A census of objectui's console (at the `.objectui-sha` pin) measured which ones the parse dropped:
10
+
11
+
-`isPinned` and `sortOrder` on a flattened list overlay (they were already declared on the ViewItem record);
12
+
-`visibility`, on both the flattened list overlay and the ViewItem record;
13
+
-`_isOverride`, the marker that tells the console a row is the settings overlay of a code-defined view and not a saved view of its own.
14
+
15
+
## What it does now
16
+
17
+
- The ViewItem wire member (`ViewItemWireSchema`) and the flattened list overlay (`VIEW_METADATA_MEMBERS.listOverlay`) declare `isPinned`, `sortOrder` and `visibility` from one shared declaration, each with its meaning. The flattened list overlay also declares `_isOverride: true`, and its existing `isDefault` now carries its meaning. A parse of a console-written row keeps every one of them.
18
+
-**New export `VIEW_CONSOLE_ROUND_TRIP_KEYS`** (`@objectstack/spec/ui`): each round-trip key, mapped to the members whose rows the console writes it on (`isDefault`, `isPinned`, `sortOrder`, `visibility`, `columnState`, `_isOverride`).
19
+
-`visibility` is display grouping only (`private` / `team` / `organization` / `public` in the view switcher). It restricts nobody, and its declared meaning says so.
20
+
- None of these keys is authorable. `defineViewItem` still refuses each of them by name, and `visibility` now gets a prescription that says what it is.
21
+
22
+
## What does not change
23
+
24
+
-**What is persisted.** The save still stores the request body verbatim. Storing the parsed body is a later, separate change.
25
+
- The alias spellings the census found keep their declared spellings: `objectName` is `object`, and a top-level `id` is `name`. The console's filter / sort builder row ids stay `VIEW_CONSOLE_ROW_DECORATIONS`, removed before the parse.
26
+
27
+
## Values that are now refused
28
+
29
+
A declared key is typed, so a stored-row write carrying one of these keys with a value of the wrong type is now refused `422 INVALID_METADATA` at that key, where the key used to be dropped from the parse and the body stored as sent: a non-boolean `isPinned`, a non-integer `sortOrder`, a `visibility` outside the four groups, or an `_isOverride` other than `true`. The console writes none of these: its pin toggle writes a boolean, its reorder an integer index, and it stamps the marker as `true`.
|**_lockDocsUrl**|`string`| optional | Optional documentation link surfaced next to _lockReason. |
2259
-
|**isPinned**|`boolean`| optional | Studio round-trip: view pinned in the switcher (per-user state, written by the console — not authored). |
2260
-
|**sortOrder**|`integer`| optional | Studio round-trip: position within the switcher (per-user state, written by the console — not authored). |
2261
-
|**columnState**|`{ order?: string[]; widths?: Record<string, number> }`| optional | Studio round-trip: per-user column order/widths (runtime-only state, written by the console grid — not authored) |
2259
+
|**isPinned**|`boolean`| optional | Console round-trip: the view is pinned in the object's view switcher. Written by the console's pin toggle through the `view` metadata API and read back to draw the pinned group. Stored on the view's row, which has no per-user scope. Not authored. |
2260
+
|**sortOrder**|`integer`| optional | Console round-trip: the view's position among the object's saved views in the switcher, 0-based and counted over saved views only (a code-defined view carries none). Written by the console's drag-reorder and read back to order the tabs. Not authored: `order` is the authored default position. |
2261
+
|**visibility**|`Enum<'private' \| 'team' \| 'organization' \| 'public'>`| optional | Console round-trip: the group the switcher files this view's tab under (private, team, organization or public). Display grouping only, NOT access control: nothing restricts who can list or open the view by this value. No console control sets it; the console carries a stored value forward when it re-saves the row. Not authored. |
2262
+
|**columnState**|`{ order?: string[]; widths?: Record<string, number> }`| optional | Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored) |
@@ -2327,8 +2328,8 @@ This schema accepts one of the following structures:
2327
2328
2328
2329
| Property | Type | Required | Description |
2329
2330
| :--- | :--- | :--- | :--- |
2330
-
|**order**|`string[]`| optional | Column order as field names, leftmost first (runtime-only per-user state — written by the console grid, never authored). |
2331
-
|**widths**|`Record<string, number>`| optional | Column widths in pixels, keyed by field name (runtime-only per-user state — written by the console grid, never authored). |
2331
+
|**order**|`string[]`| optional | Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored). |
2332
+
|**widths**|`Record<string, number>`| optional | Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored). |
2332
2333
2333
2334
---
2334
2335
@@ -2356,9 +2357,10 @@ This schema accepts one of the following structures:
|**_lockDocsUrl**|`string`| optional | Optional documentation link surfaced next to _lockReason. |
2359
-
|**isPinned**|`boolean`| optional | Studio round-trip: view pinned in the switcher (per-user state, written by the console — not authored). |
2360
-
|**sortOrder**|`integer`| optional | Studio round-trip: position within the switcher (per-user state, written by the console — not authored). |
2361
-
|**columnState**|`{ order?: string[]; widths?: Record<string, number> }`| optional | Studio round-trip: per-user column order/widths (runtime-only state, written by the console grid — not authored) |
2360
+
|**isPinned**|`boolean`| optional | Console round-trip: the view is pinned in the object's view switcher. Written by the console's pin toggle through the `view` metadata API and read back to draw the pinned group. Stored on the view's row, which has no per-user scope. Not authored. |
2361
+
|**sortOrder**|`integer`| optional | Console round-trip: the view's position among the object's saved views in the switcher, 0-based and counted over saved views only (a code-defined view carries none). Written by the console's drag-reorder and read back to order the tabs. Not authored: `order` is the authored default position. |
2362
+
|**visibility**|`Enum<'private' \| 'team' \| 'organization' \| 'public'>`| optional | Console round-trip: the group the switcher files this view's tab under (private, team, organization or public). Display grouping only, NOT access control: nothing restricts who can list or open the view by this value. No console control sets it; the console carries a stored value forward when it re-saves the row. Not authored. |
2363
+
|**columnState**|`{ order?: string[]; widths?: Record<string, number> }`| optional | Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored) |
@@ -2402,8 +2404,8 @@ This schema accepts one of the following structures:
2402
2404
2403
2405
| Property | Type | Required | Description |
2404
2406
| :--- | :--- | :--- | :--- |
2405
-
|**order**|`string[]`| optional | Column order as field names, leftmost first (runtime-only per-user state — written by the console grid, never authored). |
2406
-
|**widths**|`Record<string, number>`| optional | Column widths in pixels, keyed by field name (runtime-only per-user state — written by the console grid, never authored). |
2407
+
|**order**|`string[]`| optional | Column order as field names, leftmost first (runtime-only state — written by the console grid, never authored). |
2408
+
|**widths**|`Record<string, number>`| optional | Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored). |
why: "platform-written, never authored — `Studio round-trip: per-user column order/widths (runtime-only state, written by the console grid — not authored)`. Declared on the wire members only so the console's own write parses; the authoring door (`ViewItemSchema`) rejects the key by name",
277
+
why: "platform-written, never authored — `Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view's row, which has no per-user scope — not authored)`. Declared on the wire members only so the console's own write parses; the authoring door (`ViewItemSchema`) rejects the key by name",
278
278
},
279
279
{
280
280
kind: 'omit',
281
281
type: 'view',
282
282
path: ROOT_PATH,
283
283
key: 'isPinned',
284
-
why: "platform-written, never authored — `Studio round-trip: view pinned in the switcher (per-user state, written by the console — not authored)`; the authoring door (`ViewItemSchema`) rejects the key by name",
284
+
why: "platform-written, never authored — `Console round-trip: the view is pinned in the object's view switcher. … Not authored.`; the authoring door (`ViewItemSchema`) rejects the key by name",
285
285
},
286
286
{
287
287
kind: 'omit',
288
288
type: 'view',
289
289
path: ROOT_PATH,
290
290
key: 'sortOrder',
291
-
why: "platform-written, never authored — `Studio round-trip: position within the switcher (per-user state, written by the console — not authored)`; the authoring door (`ViewItemSchema`) rejects the key by name and points the author at `order`, the authored default",
291
+
why: "platform-written, never authored — `Console round-trip: the view's position among the object's saved views in the switcher … Not authored`; the authoring door (`ViewItemSchema`) rejects the key by name and points the author at `order`, the authored default",
292
292
},
293
293
294
294
// Deprecated or legacy alias — deliberately not offered to new authors, the
.describe('Column widths in pixels, keyed by field name (runtime-only per-user state — written by the console grid, never authored).'),
5065
+
.describe('Column widths in pixels, keyed by field name (runtime-only state — written by the console grid, never authored).'),
5066
5066
}).describe(
5067
-
'Runtime-only personalization overlay key: the per-user column layout (order/widths) the console grid '
5067
+
'Runtime-only personalization overlay key: the column layout (order/widths) the console grid '
5068
5068
+'persists through the `view` metadata API. NOT authorable — authoring doors reject it by name; do not write it in metadata source.',
5069
5069
);
5070
5070
@@ -5207,7 +5207,7 @@ function viewItemWireFields() {
5207
5207
// key arrives at THIS member's top level; declaring it validates the
5208
5208
// shape where `.strip()` used to let it ride through unchecked.
5209
5209
columnState: ViewColumnStateSchema.optional()
5210
-
.describe('Studio round-trip: per-user column order/widths (runtime-only state, written by the console grid — not authored)'),
5210
+
.describe('Studio round-trip: column order/widths (runtime-only state, written by the console grid and stored on the view\'s row, which has no per-user scope — not authored)'),
0 commit comments