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 5cdeedc
Browse filesBrowse the repository at this point in the historyBrowse files
feat(plugin-detail): row caps admit only a positive integer number, and warn on refusal
normalizeLimit (record:activity, record:chatter, record:discussion) and
normalizeHistoryLimit (record:history) no longer run Number(value) before
their integer check. The spec declares limit as z.number().int().positive(),
so a string, boolean or array is refused and falls back to the block default.
Each renderer states the refusal once through console.warn from an effect,
naming the block and the raw value with its type.
The four pins that asserted numeric-string coercion are flipped to refusal
assertions with lit number controls; the two silence pins are flipped to
warning pins.
feat(plugin-detail): row caps on `record:activity`, `record:history`, `record:chatter` and `record:discussion` admit only a positive integer number, and a refused one warns
6
+
7
+
`@objectstack/spec` declares `limit` on `RecordActivityProps` (which is also
8
+
`RecordChatterProps.feed`) and on `RecordHistoryProps` as
9
+
`z.number().int().positive()`, and refuses a string, a boolean or an array
10
+
outright. The renderers used to run `Number(value)` before their integer check,
11
+
so they also read `'5'` as 5, `' 5 '` as 5, `'0x10'` as 16, `true` as 1 and `[7]`
12
+
as 7: a second accepted set, wider than the contract (objectui#10145, ruled
13
+
STOP).
14
+
15
+
Both resolvers (`normalizeLimit`, shared by activity, chatter and discussion,
16
+
and `normalizeHistoryLimit`) now admit only a value whose type is `number` and
17
+
which is a positive integer. Every other authored value falls back to the
18
+
block's default (20 for activity, chatter and discussion; 50 for history). The
19
+
renderer then logs one `console.warn` that names the block and spells the raw
20
+
value with its type (for example `declared limit: "5" (string)`). The warning
21
+
also fires for the fractional, zero, negative, `NaN` and infinite values these
22
+
blocks already refused silently. That matches the "always warn" ruling on
23
+
objectui#10097 and the three objectui#9925 read points. An absent `limit` is not
24
+
a refusal and stays silent.
25
+
26
+
**Migration.** Stored metadata that spells a row cap as a string (for example
27
+
`limit: '5'`, or `feed: { limit: '5' }` on a chatter or discussion block) now
28
+
drops to the block's default and warns in the console, where it used to be read
29
+
as 5. Write the number instead (`limit: 5`). Publishing such metadata was
30
+
already refused by the spec, so this affects only bodies stored before that
Copy file name to clipboardExpand all lines: content/docs/plugins/plugin-detail.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -255,7 +255,7 @@ itself, so everything above describes that page too.
255
255
|`types`| Allow-list of feed item types. Recognised entries narrow the feed; unrecognised ones are dropped and named in one `console.warn`. A list that keeps nothing — `types: []`, or one whose every entry is unrecognised — filters to **nothing** and the panel renders an empty timeline, rather than widening back to every kind. Omit `types` for no filter; that is the only value that means it. A recognised entry that **no producer emits** is honoured but named too — see [Feed kinds with no producer](#feed-kinds-with-no-producer). | — |
256
256
|`filterMode`| Which slice the filter dropdown opens on (`all` / `comments_only` / `changes_only` / `tasks_only`). The user can still change it. An unrecognised value falls back to `all`. | — |
257
257
|`showFilterToggle`| Shows/hides that dropdown. | — |
258
-
|`limit`| Items per page; also caps the scoped `sys_activity` read. "Load more" grows the window by this much and re-reads. | — |
258
+
|`limit`| Items per page; also caps the scoped `sys_activity` read. "Load more" grows the window by this much and re-reads. Must be a positive integer **number**: any other value (a string such as `"5"`, a boolean, a fraction, zero or a negative) is ignored, the block uses its default of 20, and one `console.warn` names the value. The same rule applies to `feed.limit` on `record:chatter` / `record:discussion` and to `limit` on `record:history` (default 50). | — |
259
259
|`showCompleted`| Include completed activities (`sys_activity.type = 'completed'`, which surfaces as a `task` item). Off by default, per spec. | — |
260
260
|`unifiedTimeline`| Default `true` mixes field changes and comments in one timeline (Airtable style). `false` un-mixes them: the panel becomes a discussion stream and field changes stay in `record:history`. | — |
261
261
|`showCommentInput`| Shows the composer. | A host discussion context to persist the comment. Without one the feed is read-only and no composer is rendered. |
0 commit comments