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 5078f2f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(spec): dashboard columns and bulk-param allowCreate texts say what the runtime does (#37373)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgT7HCvu6MdQGTH72Yw1Vm4R)_Fixes#36913Fixes#36927
repo:objectstack#5 · os-bill · session_01Utp6CahVE6H18HGhfsxm57
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:搭建者和 AI 读到的两处规格说明改成与平台实际行为一致:仪表盘不写列数时按组件宽度自动取 4 列或 12
列;批量操作参数被拒时的提示,说明字段上的“允许新建”会带到批量弹窗。只有文字变化。
- 为什么做:替照规格说明写元数据的搭建者和 AI 解决“说明与运行不一致”,避免按“默认 12 列”布局却得到 4
列,或被告知“允许新建”带不过去。
- 出错会怎样:最坏是说明措辞仍有偏差,运行行为和校验结果都不变;撤回即恢复旧文字。
- 要你做什么:无。
## What changes
Four commits: one per card, then the CLI mirror of the #36913 sentence
(fence widened by the zone) and a test-hygiene import. Text only: no
runtime change, no change to any parsed shape or refused key set.
**#36913, `DashboardSchema.columns` describe.** It said `(default 12)`.
The renderer (`ui/packages/plugin-dashboard/src/DashboardRenderer.tsx`,
`inferredColumns`, ~L391–407 at 98bda0a) has no fixed default: with
`columns` absent it takes the widest `layout.x + layout.w` (or
`layout.w`) over the widgets and returns 12 if that exceeds 4, otherwise
4. The describe now reads: "Number of grid columns. When absent,
inferred from the widgets: 12 if any widget layout reaches past column 4
(x + w > 4), otherwise 4". TSDoc follows;
`content/docs/references/ui/dashboard.mdx` regenerated (`gen:docs`, the
only stale artifact `check:generated` named). The `packages/rest`
fixture that quotes the describe follows it, and the `os explain
dashboard` table in `packages/cli/src/commands/explain.ts` now carries
the same sentence. Because that rest test is edited,
`check:test-source-alias` asked for its module-top `import
'@objectstack/objectql'`; added.
**#36927, `BULK_PARAM_WIDGET_CONFIG_KEYS` prescription and
`list.bulkActionDefs` liveness note.** PR #36919 made a promoted bulk
def's field-backed lookup param carry the field's `allowCreate`
(`resolveActionParams` copies it,
`ui/packages/plugin-grid/src/resolveBulkActions.ts` `toBulkParam` L191
forwards it). The prescription, its TSDoc, and the liveness note now
list `allowCreate` with `lookupFilters` / `lookupColumns` /
`lookupPageSize` / `descriptionField`; the counts move from "four picker
settings / six keys" to "five / seven". Every other key named is
unchanged and still true on main (re-read in the same two files). The
spec test comment that paraphrases the prescription follows it.
## Tests
Local, on 9a3c289:
- `pnpm --filter @objectstack/spec build` · `check:generated` (after
`gen:docs`: all artifacts current)
- `vitest run` on `packages/spec/src/ui/bulk-action.test.ts`,
`packages/spec/src/ui/dashboard.test.ts`,
`packages/rest/src/meta-types-schema-titles.test.ts` (3/3),
`packages/cli` `test/explain-rule-id.test.ts` (14/14), `pnpm --filter
@objectstack/cli typecheck` exit 0
- the `dispatch-gates --commands` set for this diff; rows that need the
whole workspace built exit 3 (prerequisite not met) and are NOT MEASURED
locally, left to CI. 106 of 115 derived commands exit 0; 7 exit 3
(prerequisite); `check:test-source-alias` fixed and re-run green;
`check:platform-checklist` red from main (see notes).
## Acceptance notes
- `packages/cli/src/commands/explain.ts:292` repeated "(default 12)";
the zone widened the fence and it is fixed here.
- `check:platform-checklist` is red locally on an ABSENT SYMBOL anchor
(`FlowItemMoreMenu`) this diff does not touch; it comes from main.
- No `skills/**` page repeats "default 12" (grep at 98bda0a).
## Verification
Two-minute check: `grep -n "columns:"
packages/spec/src/ui/dashboard.zod.ts` shows the inference wording;
`grep -c allowCreate packages/spec/liveness/view.json` is non-zero.
Read first: `packages/spec/src/ui/bulk-action.zod.ts` prescription hunk
(the only place with wording risk), then `dashboard.zod.ts` L1822–1827.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01Utp6CahVE6H18HGhfsxm57)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CahVE6H18HGhfsxm57
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6CahVE6H18HGhfsxm57 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
fix(spec): `DashboardSchema.columns` says what the renderer does when it is absent
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
The `columns` describe said "(default 12)". The dashboard renderer has no fixed default: when `columns` is absent it infers the grid from the widgets, 12 if any widget layout reaches past column 4 (`x + w > 4`), otherwise 4. The describe, its TSDoc, the generated reference page and the `os explain dashboard` table now say that. No runtime change.
fix(spec): the bulk-param widget-config refusal names `allowCreate` among the field keys a promoted action carries
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
Since #36919, a promoted bulk action's field-backed lookup param takes the field's `allowCreate`, so `allowCreate: false` on the field keeps the picker's create entry out of the selection bar's dialog. The `BULK_PARAM_WIDGET_CONFIG_KEYS` prescription and the `list.bulkActionDefs` liveness note still left it off the carried keys, telling authors the opposite. Both now name `allowCreate` with `lookupFilters` / `lookupColumns` / `lookupPageSize` / `descriptionField`. Text only; the refused key set is unchanged.
|**columns**|`integer`| optional | Number of grid columns (default 12)|
36
+
|**columns**|`integer`| optional | Number of grid columns. When absent, inferred from the widgets: 12 if any widget layout reaches past column 4 (x + w > 4), otherwise 4|
37
37
|**gap**|`integer`| optional | Space between widgets, in steps of 0.25rem (4 = 1rem) |
38
38
|**refreshIntervalSeconds**|`number`| optional | Auto-refresh interval in seconds |
39
39
|**refreshInterval**|`never`| optional |[REMOVED]`dashboard.refreshInterval` was renamed to `refreshIntervalSeconds` in @objectstack/spec 17 — the unit of a duration-shaped number lives in the key name, not only in the describe prose. Rename the key to `refreshIntervalSeconds`; the value (seconds) is unchanged. Run `os migrate meta --from 17` to list the mechanical edits for existing sources; `--write` applies the ones it can prove, and you apply the rest by hand. |
{name: 'columns',type: 'number (1-24)',description: 'Number of grid columns (default 12)'},
292
+
{name: 'columns',type: 'number (1-24)',description: 'Number of grid columns. When absent, inferred from the widgets: 12 if any widget layout reaches past column 4 (x + w > 4), otherwise 4'},
293
293
{name: 'gap',type: 'number',description: 'Space between widgets, in steps of 0.25rem (4 = 1rem)'},
294
294
// There is no dashboard-level `layout` template — the key is rejected by
295
295
// name. Positioning is per-widget: `layout: { x, y, w, h }`, and a widget
Copy file name to clipboardExpand all lines: packages/rest/src/meta-types-schema-titles.test.ts
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,15 @@
18
18
19
19
import{describe,it,expect,vi}from'vitest';
20
20
import{RestServer}from'./rest-server.js';
21
+
// Paid at collection, not inside a clocked case: the routes reached through
22
+
// RestServer load it lazily (check:test-source-alias).
23
+
import'@objectstack/objectql';
21
24
22
25
/** The served shape `getMetaTypes()` derives for a `dashboard` entry, trimmed to the header. */
23
26
constDASHBOARD_SCHEMA=()=>({
24
27
type: 'object',
25
28
properties: {
26
-
columns: {type: 'integer',description: 'Number of grid columns (default 12)'},
29
+
columns: {type: 'integer',description: 'Number of grid columns. When absent, inferred from the widgets: 12 if any widget layout reaches past column 4 (x + w > 4), otherwise 4'},
27
30
header: {
28
31
type: 'object',
29
32
properties: {
@@ -145,7 +148,7 @@ describe('#16458 — GET /meta serves a localised `schema` beside the localised
expect(entry.schema.properties.columns.description).toBe('Number of grid columns (default 12)');
151
+
expect(entry.schema.properties.columns.description).toBe('Number of grid columns. When absent, inferred from the widgets: 12 if any widget layout reaches past column 4 (x + w > 4), otherwise 4');
149
152
});
150
153
151
154
it('control — an en request leaves the authored titles in place',async()=>{
"note": "objectui: ListView.tsx:1343 forwards rich defs to ObjectGrid (BulkActionDialog). Dispatch: useBulkExecutor.ts run() — per-record fan-out by default; execution:'aggregate' defs go through the ONE-call bulkCall branch injecting params._selectedIds (ObjectGrid.runBulkActionAggregate, objectui#3139). Verified objectui@4bf612c. #4457 gave the def a SHAPE (it was z.record(z.any())): the entry schema is BulkActionDefSchema, strict, and it refuses the combinations that parse but the executor never reads — so this row's liveness now covers the keys inside a def, not just the array. A PROMOTED def's field-backed params (packages/spec/src/ui/bulk-action.zod.ts; moved out of spec source, #23434): resolved when the dialog opens by objectui main @dca25aff2 packages/plugin-grid/src/resolveBulkActions.ts#resolvePromotedBulkParams through `resolveActionParams` (objectui 29b99490), then renamed onto the bulk vocabulary by the same file's #toBulkParam, which carries the field's type, translated label, options, required, description, placeholder, defaultValue, multiple, `dependsOn`, `accept` and `maxSize` (plus a reference-bearing field's reference and display field) and that field's lookup settings `lookupFilters`, `lookupColumns`, `lookupPageSize` and `descriptionField`, which reach the selection bar's picker as they reach the single-record dialog's (objectstack#26951); `idField` / `titleFormat` are still not carried. An authored param's `options[]` entries (packages/spec/src/ui/bulk-action.zod.ts, the `.passthrough()` rationale; moved out of spec source, #23434): objectui @b9814b334 packages/plugin-grid/src/components/bulkParamToField.ts#bulkParamToField spreads each entry into the field metadata (`options?.map(o => ({ ...o, value: String(o.value) }))`), so every extra key reaches the widget, whose option vocabulary is objectui @b9814b334 packages/types/src/field-types.ts#SelectOptionMetadata, extending objectui @b9814b334 packages/types/src/select-option.ts#SelectOptionBase (`color`, `visibleWhen`, `disabled` and `icon` beyond the pair); the select cell reads `option?.color` in objectui @b9814b334 packages/fields/src/index.tsx#SelectCellRenderer. The renderer's own param type now agrees: objectui @b9814b334 packages/types/src/objectql.ts#BulkActionParam types an `options` entry open (an index signature, citing objectstack#4001), where the source's sha-less reading had it closed (`Array<{ label; value }>`). Re-read 2026-10-15, first cited by line, sha-less."
220
+
"note": "objectui: ListView.tsx:1343 forwards rich defs to ObjectGrid (BulkActionDialog). Dispatch: useBulkExecutor.ts run() — per-record fan-out by default; execution:'aggregate' defs go through the ONE-call bulkCall branch injecting params._selectedIds (ObjectGrid.runBulkActionAggregate, objectui#3139). Verified objectui@4bf612c. #4457 gave the def a SHAPE (it was z.record(z.any())): the entry schema is BulkActionDefSchema, strict, and it refuses the combinations that parse but the executor never reads — so this row's liveness now covers the keys inside a def, not just the array. A PROMOTED def's field-backed params (packages/spec/src/ui/bulk-action.zod.ts; moved out of spec source, #23434): resolved when the dialog opens by objectui main @dca25aff2 packages/plugin-grid/src/resolveBulkActions.ts#resolvePromotedBulkParams through `resolveActionParams` (objectui 29b99490), then renamed onto the bulk vocabulary by the same file's #toBulkParam, which carries the field's type, translated label, options, required, description, placeholder, defaultValue, multiple, `dependsOn`, `accept` and `maxSize` (plus a reference-bearing field's reference and display field) and that field's lookup settings `lookupFilters`, `lookupColumns`, `lookupPageSize`, `descriptionField` and `allowCreate`, which reach the selection bar's picker as they reach the single-record dialog's (objectstack#26951; `allowCreate` since objectstack#36919, carried by #toBulkParam so `allowCreate: false` on the field keeps the picker's create entry out); `idField` / `titleFormat` are still not carried. An authored param's `options[]` entries (packages/spec/src/ui/bulk-action.zod.ts, the `.passthrough()` rationale; moved out of spec source, #23434): objectui @b9814b334 packages/plugin-grid/src/components/bulkParamToField.ts#bulkParamToField spreads each entry into the field metadata (`options?.map(o => ({ ...o, value: String(o.value) }))`), so every extra key reaches the widget, whose option vocabulary is objectui @b9814b334 packages/types/src/field-types.ts#SelectOptionMetadata, extending objectui @b9814b334 packages/types/src/select-option.ts#SelectOptionBase (`color`, `visibleWhen`, `disabled` and `icon` beyond the pair); the select cell reads `option?.color` in objectui @b9814b334 packages/fields/src/index.tsx#SelectCellRenderer. The renderer's own param type now agrees: objectui @b9814b334 packages/types/src/objectql.ts#BulkActionParam types an `options` entry open (an index signature, citing objectstack#4001), where the source's sha-less reading had it closed (`Array<{ label; value }>`). Re-read 2026-10-15, first cited by line, sha-less."
widgets: z.array(DashboardWidgetSchema).describe('Widgets to display'),
1822
1822
1823
-
/** Grid column count — defaults to 12 for a standard 12-column grid */
1824
-
columns: z.number().int().min(1).max(24).optional().describe('Number of grid columns (default 12)'),
1823
+
/**
1824
+
* Grid column count. Absent, the renderer infers it from the widgets: 12 when
1825
+
* any widget's layout reaches past column 4 (`x + w > 4`), otherwise 4.
1826
+
*/
1827
+
columns: z.number().int().min(1).max(24).optional().describe('Number of grid columns. When absent, inferred from the widgets: 12 if any widget layout reaches past column 4 (x + w > 4), otherwise 4'),
1825
1828
1826
1829
/** Space between widgets, in steps of 0.25rem (4 = 1rem) */
1827
1830
gap: z.number().int().min(0).optional().describe('Space between widgets, in steps of 0.25rem (4 = 1rem)'),
0 commit comments