Repository navigation
refactor(ui-types): one source for the filter-builder field-type list; close the three K4 review should-fixes - #27400
Conversation
FILTER_FIELD_TYPES and its four behaviour buckets move into @object-ui/types (filter-field-types.ts). FilterFieldSchema.type builds its enum from the list, FilterField['type'] is typed from it, and filter-builder.tsx takes its buckets from it. The mirror test drops the frozen LAST_PUBLISHED_TYPES copy and instead pins that every member is a spec FieldType (status exempted by name) and, in the render half, that every member but text draws a branch of its own. Claude-Session: https://claude.ai/code/session_01L9qibxvBS38kVpxSqdV8T4 Co-authored-by: Claude <noreply@anthropic.com>
- check-doc-links scans the objectui skill bundle (skills/objectui) as a disk surface whose relative hrefs must stay inside the bundle, and the two prose doc URLs in it become markdown links the gate judges as site routes. Its heading scan now reads blockquoted ATX headings, which the bundle writes. - ci.yml: the ui paths-filter comment counts five paths, not four roots. - ui/AGENTS.md #2 points at content/docs/frontend/ instead of the retired content/docs/guide/. Claude-Session: https://claude.ai/code/session_01L9qibxvBS38kVpxSqdV8T4 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibxvBS38kVpxSqdV8T4 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibxvBS38kVpxSqdV8T4 Co-authored-by: Claude <noreply@anthropic.com>
|
Contract-review-handoff: triage — CONTRACT_REVIEW_TIER unavailable (maintainer rule 「契约复审都要等分诊」, the dispatching seat does not review, 2026-10-29T05:07Z) · head 796bf3a This PR is the follow-up card #27369 (claim 6487462737) and is Tier H by path: it changes one comment line in Focus: one source for the filter-builder field-type list. The accepted set must stay at 14 members, with Generated by Claude Code |
Requested by Tesla · project thread
Fixes #27369
Clause-②: no
Metadata-protocol: none
维护者速读
@object-ui/types的filter-field-types.ts声明一次,校验 schema、TS 接口、渲染器三处都从这里取;顺带处理 K4 评审的三条建议改项。DELETE /reports/:idrevealing whether a report id exists (#7523) #7562、test(service-job): schedule exact-count cases on an inert cron fixture #8774 修的都是这个),K4 之后还多了一份冻结列表。type可选,缺省text);渲染行为不变。回滚即 revert 本 PR。ui/packages/types/src/filter-field-types.ts、ui/packages/components/src/custom/filter-builder.tsx的分组导入、ui/scripts/check-doc-links.mjs新增的 skills 扫描行。pnpm --dir ui exec vitest run packages/types/src/__tests__/filter-builder-mirror-6939.test.ts examples/schema-catalog/test/filter-builder-mirror-6939.test.tsx,预期全绿。.github/workflows/ci.yml(Tier H),待分诊合约复审后由你合并。What changes
One source for the field-type list (card items 1–2).
ui/packages/types/src/filter-field-types.tsdeclares the renderer's four behaviour buckets (FILTER_NUMBER_LIKE_TYPES,FILTER_DATE_LIKE_TYPES,FILTER_SELECT_LIKE_TYPES,FILTER_LOOKUP_LIKE_TYPES) andFILTER_FIELD_TYPES(text, the buckets,boolean, in the order the retired doc used), plus the member typeFilterFieldType. All are exported from@object-ui/types.FilterFieldSchema.typeisz.enum(FILTER_FIELD_TYPES).optional(). Its.describe()no longer cites "the published doc", and its docblock says where the authority lives now.FilterField['type']isFilterFieldType, not a restated union.filter-builder.tsximports the four buckets and declares no list of its own. They are rebound asreadonly string[]locals so the existing.includes(authoredType)call sites compile unchanged.filter-builder-mirror-6939dropsLAST_PUBLISHED_TYPESand its doc-reader leftovers. It now pins: the enum equalsFILTER_FIELD_TYPESmember for member; every member is a specFieldType(packages/spec/src/data/field.zod.ts) exceptSPEC_FIELD_TYPE_EXEMPTIONS, which namesstatuswith its one-line reason; every exemption is still live (in the list, still outside the spec); and the seven bucketed members are each carried by their shared bucket, which the renderer imports. The header's objectstack#27145 section is rewritten to say the authority isFILTER_FIELD_TYPES.examples/schema-catalog/test/filter-builder-mirror-6939.test.tsx) replaces the stale hand-kept seven ("…and the mirror refuses it") with one case per member ofFILTER_FIELD_TYPESexcepttext. Each case uses the existingoneRowmeasurement and asserts that the member draws a control signature (inputs plus trigger count) different from a nonsense spelling.textis the fallthrough target by construction; its by-name branch stays pinned in the validator half.K4 should-fix (1): the skill doc URLs are now gated. This took both halves.
check-skills-paths.mjsjudges only backtick paths, and it resolvescontent/againstui/, so it could not reach a site URL. I chosecheck-doc-links.mjsinstead:SCAN_ROOTSgains{ path: '../skills/objectui', rule: 'disk', diskRoot: '../skills/objectui' }. The bundle is read on GitHub and by agents, so its relative hrefs are disk paths. It ships to customer projects as one directory, so the new per-rowdiskRootmakes the bundle itself the boundary a relative href must stay inside. The default boundary, this tree's root, sits below the bundle and would have rejected all 34 intra-bundle links.app-composition.md:62,styling.md:318) become markdown links. The gate already judgesobjectstack.ailinks as site routes againstapps/docs.guides/schema-expressions.mdhas a heading inside a blockquote (> ### …). Both renderers anchor that heading, but the gate's ATX scan did not see it, and the corpus test went red. The heading scan now strips blockquote markers first. A unit pin covers this, and the setext-count test counts blockquoted ATX headings.check-skills-token-ratchet: the Theming link coststyling.md2 tokens. I paid them by deleting text in the same line ("the token list" became "tokens").app-composition.mdis 1 token lighter.K4 should-fix (2).
.github/workflows/ci.yml: the ui paths-filter comment said "four roots outside ui/" above a list of five globs. It now says "five paths outside ui/". This is a comment-only change.K4 should-fix (3).
ui/AGENTS.mdrule #2 pointed at the retiredcontent/docs/guide/*.md. It now names the matching page undercontent/docs/frontend/.Changeset:
.changeset/27369-filter-builder-field-types.md,@object-ui/typespatch and@object-ui/componentspatch, with both declaration lines.Skill bundle readings (
skills/**touched)skills/objectui/guides/app-composition.mdskills/objectui/rules/styling.mdSKILL.mdinskills/skills/objectui/**/*.mdTests
All runs are on head
796bf3a3or on its parent7dc5d3f6, which differs only instyling.md.pnpm --dir ui exec vitest run packages/types examples/schema-catalogpassed, with Test Files 429/429 and Tests 12850/12850.pnpm --dir ui exec vitest run scripts/__tests__/check-doc-links.test.ts: 123/123. The wholescripts/suite also ran as part of the derived gates (exit 0).@object-ui/typestype-check(src, examples and tests programs),@object-ui/componentstype-checkand@object-ui/example-schema-catalogtype-checkall exit 0, built against a fresh build of their dependency closure.components-complex-filter-builder/*catalog entries and the nestedsearch-interfacebuilder still validate (the catalog entries the mirror refuseddescribe, green).git grep -n "LAST_PUBLISHED_TYPES\|published doc's fourteen"prints nothing.One-time ablations (each restored from HEAD; git status clean after each)
ui vitest resolves
@object-ui/typestosrcthrough its alias, so these needed no dist rebuild.'email'toFILTER_FIELD_TYPESonly. The render half went red on`email` draws a branch of its own, not the fallthrough(1 failed, 99 passed). The spec check stayed green, as it should, becauseemailis a specFieldType.'zz_not_spec'toFILTER_SELECT_LIKE_TYPES. The validator half went red onevery member is a spec FieldType, or a named exemption(1 failed, 48 passed).ratingfromFILTER_NUMBER_LIKE_TYPES:accepts rating, and the renderer draws it from the shared bucket FILTER_NUMBER_LIKE_TYPESwent red.const f: FilterField = { …, type: 'rating' }failedtsc -p tsconfig.test.jsonwith TS2322. The control, run before the mutation, showed 0 errors.ratingforced into the render probe,`rating` draws a branch of its ownwent red. Aratingcolumn now draws the fallthrough.Acceptance notes
statusis the one member that is not a specFieldType. It is exempted by name, not dropped, so the accepted set does not narrow.check-doc-linksgained a row field (diskRoot) and a heading-scan fix. Both are inside the claim's "only if item 3 needs them" surface: the row is what gates the URLs, and the heading fix is what the row needed to land green.Verification
Derived gates: 88 derived, 87 run, 1 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commandsderived 88 commands. I ran all of them on7dc5d3f6and reran the one red family after the fix:node scripts/check-skills-token-ratchet.mjs: exit 1 on7dc5d3f6(styling.md2701/2699), then exit 0 on796bf3a3.pnpm --filter @objectstack/spec run check:skill-examples: exit 3 untilclient-reactwas built, then exit 0 (270 prose examples type-check).pnpm check:dual-build-cjs-loads: exit 3, PREREQUISITE NOT MET because it needs every published package's dist. NOT MEASURED locally. The diff touches no package it loads, and CI runs it.Reconciliation:
dispatch-gates --ranprinted88 derived famil(ies) accounted for — 87 run, 1 NOT-MEASURED. Lint UI:pnpm --dir ui run lint:rootreported 0 errors, andturbo run lintover the three touched ui packages reported 0 errors. Neither reported a warning on a changed line.Tier H by path (
.github/workflows/ci.yml). It stays a draft until green, then the triage seat writes the contract review and the maintainer merges.Generated by Claude Code