Skip to content

conditionalFormatting on the object-view node has a SECOND read on the author-reachable kanban path — the #5097 host-surface exemption is narrower for this one key #5248

Description

@os-support-ai

Found while implementing the ruled exemption on #5097. Filed unassigned, not claiming. No code change was made for it — #5097's ruling preserves the status quo either way (nothing declared, nothing removed).

What was measured

Measured on main at e03dfa5ea (and identical at #5097's base 9fbb9b52f).

The #5097 ruling exempts 27 keys read off the object-view node as HOST-COMPOSITION surface. Its stated basis is measured reachability: the renderListView delegation branch in packages/plugin-view/src/ObjectView.tsx is entered only when a host supplies the prop, and the registered renderer ObjectViewRenderer (packages/plugin-view/src/index.tsx:58) does not, so the schema-registration path documented to authors cannot reach those keys.

That basis holds for 26 of the 27. It is narrower for conditionalFormatting, which has a second read site outside the delegation branch:

  • packages/plugin-view/src/ObjectView.tsx:1094 — inside the host-only renderListView branch, with its 30 neighbours.
  • packages/plugin-view/src/ObjectView.tsx:768 — inside generateViewSchema's kanban branch, as the last fallback of kanbanConditionalFormatting (kanbanCfg.conditionalFormatting ?? activeView?.conditionalFormatting ?? (schema as any).conditionalFormatting), forwarded to the emitted object-kanban node.

The kanban branch is on the author-reachable path: renderContent delegates to renderListView only when the prop is present; otherwise, for a non-grid view type, it calls generateViewSchema(currentViewType) and hands the result to SchemaRenderer. That is exactly what ObjectViewRenderer does. So an author who registers an object-view node with a kanban view type and a top-level conditionalFormatting rule does get an effect today.

conditionalFormatting is not a declared member of ObjectViewSchema (derived from packages/types/src/objectql.ts + BaseSchema: 42 declared members, conditionalFormatting is not among them), and it is not in the object-view registry inputs (packages/plugin-view/src/index.tsx:71-86), so nothing on the authoring surface offers it and nothing rejects it — BaseSchema's index signature means tsc is silent too.

The question

One key is honoured on the authored path while being recorded as host surface. Three ways out, and it shapes the public contract, so it wants a ruling rather than a guess:

  1. Declare conditionalFormatting on ObjectViewSchema (and add it to the object-view registry inputs) — it does something on the author's path, so the "declaring it would promise a surface that does nothing" argument does not apply to it.
  2. Keep it exempt and narrow the kanban read — drop the (schema as any).conditionalFormatting fallback at :768 so the key is genuinely host-only, and let kanban conditional formatting be authored where it is declared. This changes behaviour for any document relying on the top-level rule, so it needs the usual liveness check first.
  3. Keep both as they are, and record the asymmetry as the exemption's known edge (what ObjectView 用 (schema as any) 从 object-view 节点读 31 个键转发给 renderListView,其中 27 个不是 ObjectViewSchema 声明成员 —— #5091 在 ObjectView 上的同形实例 #5097's comment block does today).

Where it is recorded now

The exemption block added by #5097 names this asymmetry in full and points here, so a later sweep meets a statement rather than a flat claim. See packages/plugin-view/src/ObjectView.tsx (OBJECT_VIEW_HOST_COMPOSITION_KEYS), section "The one asymmetry".

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions