Repository navigation
fix(app-shell,plugin-list): emit the spec-canonical kanban lane key, and let the capability gate see it (objectui#8193) - #8227
Conversation
…and let the gate see it (objectui#8193)
ObjectView built the view-level kanban config for the list-view it hands down
and wrote the deprecated alias `groupField` — never `groupByField`, the key
`@objectstack/spec`'s KanbanConfigSchema declares — despite already READING the
canonical key first. Its sibling in the same package, `defaultKanbanFromObject`,
had migrated long before and left the reasoning in a comment; the twin twelve
hundred lines away was not carried along. ObjectView writes into `options.kanban`,
which normalizeListViewSchema's alias fold deliberately does not reach, so the
legacy spelling was what actually drove the lanes.
The expression becomes the exported `kanbanViewOptions`, the fifth member of the
timeline/calendar/gantt/gallery `*ViewOptions` family it had been the odd one out
of, so both app-shell producers are observable and can be pinned against drift.
ListView's kanban capability gate changed with it, and had to. It consulted the
`options.kanban` bag for the LEGACY spelling only, so a producer writing the spec
key into the bag was invisible to it while rendering correctly — the render branch
merges the bag and resolves `groupByField || groupField`. Measured before and
after: `{groupBy, groupField}` offered Kanban and `{groupBy, groupByField}` did
not, so the producer change alone would have removed the Kanban toggle from every
object view. Same one-question-two-sites repair as objectui#5042 (map) and
objectui#7544 (chart).
No alias READ was removed and the alias is not retired: stored metadata still
authors `groupField`, and ListView already preferring the canonical key is why
the sibling could drop the alias write. Only what this one face WRITES changed,
plus one added rung on the gate.
The view-level `groupBy` in the same bag is measured but deliberately not folded:
the strict KanbanConfigSchema refuses it by name, but ListView's projection
collectors read it, so retiring it needs its own producer census — objectui#8213.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
PM ruling on the open question: A — keep the added gate rung. Ship as built.The dispatch fenced 1. The fence's stated reason is not violated. It exists because stored metadata still authors the legacy spelling, so alias reads must survive. This change adds a rung and removes none — all three original rungs are intact and stored metadata still resolves 2. Without it the card's own fix is a live regression, and that is measured rather than argued. On the real component with
Both controls fired, so the FALSE is a reading and not a dead query. 3. It is the third instance of a settled precedent, not a new judgement. objectui#5042 (map) and objectui#7544 (chart) made exactly this repair when a capability gate and its render seam answered the same question differently. The rule those established — a gate and the seam it guards must answer one question — is what this applies. On the alternatives, so the record shows they were weighed:
Also credited: raising this as a deviation rather than shipping it quietly is the right call and is why it could be ruled on the measurements instead of discovered in review. The ablation legs — producer reverted (canonical 1→0 and legacy 0→1 measured in both directions, 6 failed / 9 passed) and the canonical rung deleted (rung 1→0 with legacy still 1, exactly the two canonical-bag arms failing) — each prove the new pins can fail, and restore was proven BY STATE rather than by an exit code. Zone 2 correctly left alone. The view-level
No change requested. Holding as draft for the PM to flip and land once CI converges. Generated by Claude Code |
…ectview-canonical-groupbyfield
…after the gate gained its canonical rung The objectui#7322 pin asserts, off disk, that `ListView.tsx` still reads the VIEW-LEVEL `groupField` alias — the tombstone being node-local. It matches a verbatim snapshot of the capability-gate expression, and objectui#8193 widened that expression with a fourth rung (the canonical spelling for the `options` bag), so the snapshot stopped occurring. Re-derived, not weakened. The pin now reads the four-rung expression verbatim, indentation included, exactly as it read the one-line form before; both alias rungs are still inside the pinned text, so a site that stopped reading the alias still reddens it. The pin's own update note is conditional — "If a site stops reading `groupField`, the retirement's stated boundary has moved and the docblocks on both faces are wrong". That antecedent is FALSE here: `ListView.tsx` still reads the view-level alias at four sites (the two projection collectors, the gate rung, and the render branch's lane resolution), and the other two pinned sites are untouched. So the boundary has not moved, the docblocks on both faces are still correct, and the tombstone is neither widened nor narrowed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Fixes #8193
Session:
session_01YBWFb5YgMU5dw8p2VKj16S(in prose — a body edit downgrades the footer's session URL).What changed
ObjectView(app-shell) built the view-level kanban config it hands to itslist-viewand wrote the deprecated aliasgroupField— nevergroupByField, the key@objectstack/spec'sKanbanConfigSchemaactually declares — even though it already READ the canonical key first. Its sibling producer in the same package,defaultKanbanFromObjectinInterfaceListPage, had migrated long before and left the reasoning next to itself ("that read-site now prefers the spec key, so one key is enough"). The twin twelve hundred lines away was not carried along, so one producer surface spoke two vocabularies for one concept depending on which entry point you arrived through — and becauseObjectViewwrites intooptions.kanban, whichnormalizeListViewSchema's alias fold deliberately does not reach, nothing corrected it downstream.The expression is now the exported
kanbanViewOptions, the fifth member of thetimelineViewOptions/calendarViewOptions/ganttViewOptions/galleryViewOptionsfamily it had been the odd one out of. That is what makes both app-shell producers observable, which is what the anti-fork pin needs.⛔ No alias READ was removed and the alias is not retired. Stored metadata still authors
groupField; every read site still resolves it.ListViewalready preferring the canonical key is exactly why the sibling could drop the alias write.The card asked for a one-line producer change. Measurement said that alone ships a regression.
ListView.availableViewsconsulted theoptions.kanbanbag for the legacy spelling only —schema.options?.kanban?.groupField, with no canonical twin. The render branch one screen down merges the bag and resolvesgroupByField || groupField, so the gate recognized strictly less than what renders. That hole cost nothing while the only producer writing into that bag wrote the alias. Moving the producer onto the canonical key turns it into a live defect.Measured on the real component, before touching the gate —
viewType: 'grid'so the "always allow the schema's own viewType" rung cannot mask it:options.kanban{groupBy, groupField}— today{groupBy, groupByField}— producer fix alonegroupByField(positive control)Both controls fire, so both readings carry information. Shipping only the producer change would have removed the Kanban toggle from every object view in the product, silently, with the board still rendering correctly if you reached it another way.
So the gate gains the canonical rung the bag never had. This is the same one-question-two-sites repair objectui#5042 made for
mapand objectui#7544 forchart, a third time. It is an addition — all three original rungs are untouched. The PM has ruled this rung stays.Clause-② — does this move an accept set?
Yes, and in both directions, which is why both halves are here. The producer change alone narrows the accept set (the table above). With the gate rung, the accept set widens by exactly one previously-unreachable combination: a canonical lane key in the
optionsbag, which is precisely what the render branch has always been willing to render. Net effect on what the product offers: unchanged. What changed is that the gate and the seam now answer the same question, rather than the gate answering a narrower one by accident.The card said plainly it had not measured whether the spec's own kanban config declares the view-level
groupBythe same expression writes, and asked for that before deciding whether it is a second alias or a legitimate key.Measured at runtime against
KanbanConfigSchemafrom@objectstack/spec/ui(strict), resolved version 17.2.0, with a control on the same call:CONTROL shows the schema can refuse an unknown key by name on this exact call shape; CONTROL2 shows it can accept one. So the refusal is about
groupByspecifically. ⇒groupByis not a spec key at view level. The spec even names the other relationship itself — probing{ groupField }returns "Did you meangroupFieldtogroupByField?", so upstream already treats the alias as an alias.⛔ Not folded here, exactly as the card directed.
groupByis read byListView's projection collectors, so retiring it needs a producer census. Filed as objectui#8213 and left untouched in this PR. The measurement is pinned in the test suite so the answer cannot be lost, including a tripwire on the spec's declared key set (objectui#7685 is in flight to move the resolved spec version).CI follow-up — the objectui#7322 alias-site pin was a stale literal
CI run
34075243231was red on one test:packages/types/src/__tests__/object-kanban-group-by-limit-7322.test.ts. That pin asserts, off disk, thatListView.tsxstill reads the VIEW-LEVELgroupFieldalias — the objectui#7322 tombstone being node-local — and it does so by matching a verbatim snapshot of the capability-gate expression. The fourth rung above changed that expression's text, so the snapshot stopped occurring.Verified independently before touching the test. The alias is still read in
ListView.tsxat four sites — the two projection collectors (:1536,:1890), the preserved alias rung in the gate (:2179), and the render branch's lane resolution (:2535) — and the other two pinned sites (normalize-list-view.ts,plugin-view/ObjectView.tsx) are untouched. So this was a stale literal, not a regression.The pin's own update note is conditional: "If a site stops reading
groupField, the retirement's stated boundary has moved and the docblocks on both faces are wrong: re-derive, do not widen the tombstone on the way past." That antecedent is false here, so only the re-derivation applies — the boundary has not moved, the docblocks on both faces are still correct, and the tombstone is neither widened nor narrowed.Re-derived, not weakened: the entry now matches the four-rung expression verbatim, indentation included. Both alias rungs remain inside the pinned text, so the pin still reddens if a site stops reading the alias — proved by ablation, not assumed (below).
Measured vs claimed anchors
The card was written on
a915064e; measured onecf8e726e, with objectui#8188 landed into the target file since. Line numbers were treated as hints and matched on text.ObjectViewproducerInterfaceListPageprecedent commentnormalize-list-viewfoldListViewlane resolutionListViewcapability gateAll three Zone 2b premises confirmed: the fold still refuses the
options.*twin, its pin still says so deliberately, andListViewstill resolvesgroupByField || groupField || detectStatusField(...).Reverse verification
Direction predicted before running, then observed. Every mutation was committed-then-mutated, proven to reach disk with anchored fixed-string counts in both directions, and restored by state (
git hash-objectequal togit rev-parse HEAD:PATH, emptygit diff HEAD), never by an exit code.groupField— canonical anchor 1 to 0, legacy 0 to 1. Pin: 6 failed / 9 passed. The ADR-0085 lane-resolution arms and the spec controls stayed green in both worlds, because this defect never changed which field was chosen, only the key it was filed under. A test asserting the lane value alone would have passed against the unfixed producer.packages/plugin-list/src/ListView.tsx still reads the view-level alias.ListView.tsx— legacy-bag rung 1 to 0, pin 1 failed / 28 passed, failing by name. The re-derived literal can still fail for the reason it exists.Tests
pnpm exec vitest run packages/plugin-list/ packages/app-shell/— 711 files, 7033 passed, 1 skipped, 0 failed (pre-merge)pnpm exec vitest run packages/types/— 137 files, 2589 passed, 0 failed (post-merge)object-kanban-group-by-limit-7322.test.ts— before 1 failed / 28 passed, after 29 passedtype-check— green for app-shell, plugin-list and types (script istype-checkwith a hyphen; atypecheckfilter matches zero scripts and exits 0)check:control-bytes,check:spec-symbols,check:self-import,check:unreferenced-sources,check:changeset-presence,check:changeset-no-major,check:governed-queue-guard— green (this diff is not governed surface)check:readme-exports— NOT MEASURED locally, a prerequisite failure rather than a red gate: it needs every package'sdist/*.d.tsand reports "runpnpm buildfirst" for 84 self-imports across packages this PR does not touch. It has its own CI workflow that builds first.Two new pins, both of which redden against the unfixed code:
packages/app-shell/src/views/ObjectView.kanbanLane-8193.test.tsx— 15 arms. ⭐ Includes the anti-fork arm, which names neither spelling and instead asserts the two app-shell producers agree, with a control proving the agreement is not two empty sets.packages/plugin-list/src/__tests__/ListView.kanbanOptionsBagCanonical-8193.test.tsx— 9 arms, including four refusal arms so the gate fix cannot degrade into "offer kanban whenever whitelisted", which would be worse than the bug.origin/mainmerged in (merge, never rebase — the branch is pushed).Out of scope, deliberately
groupBy, measured above and filed rather than folded.6712930f7) and not objectui#7772; both concern the retired node-level key. This one is view-level and live.packages/plugin-list/README.mdview-level config examples left alone — still valid.Draft on purpose: the PM lands this.