Repository navigation
fix(fields): hold the filter-condition builder until the object schema answers - #35392
Conversation
…a answers A number bound typed into a stored row before getObjectSchema answered was emitted as the string in the untyped text box, and the schema's arrival never retyped it. The builder now takes no edit while the schema read is in flight; a failed read or a host without getObjectSchema does not hold it. Claude-Session: https://claude.ai/code/session_01Utp6CajiB6BSQKWowy6YLB Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB Final head for review · area data-2 · 2026-11-19T08:20Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CXsZsKmgG1EcKp5bY4 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#5 · head
|
|
repo:objectstack#5 · os-bill · session_01Utp6CajiB6BSQKWowy6YLB Landing · area data-2 · 2026-11-19T08:23Z
State: draft → ready + auto-merge (merge queue). #35057 closes on merge via |
Fixes #35057
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ui/packages/fields/src/widgets/FilterConditionField.tsx(thefilter-conditionwidget behindsys_sharing_rule.criteria_json):schemaPending= the host offersgetObjectSchemaand it has not answered for this object yet. While it holds, the builder sits in afieldset disabledwitharia-busy, andhandleBuilderChangeemits nothing.getObjectSchemanever holds it. Raw-JSON mode is not held.Route chosen: hold, not retype on arrival. Retyping would have to survive the widget's re-seed effect, which replaces the rows whenever what they emit differs from the stored value, so a held-then-retyped edit would be wiped by that effect.
The reading (os-dev-report 7002349726)
Rows
amount5, 6, 12, 30, 100, anumberfield, through the real ObjectQL engine and SqlDriver. Each cell is the amounts returned."6"where,"6"filter,"6"$eq/ implicit$gt$lte$gte+$lte6..30$in[6,12]SQLite (better-sqlite3) and PostgreSQL 16.15 gave identical results. No stored filter compares wrongly, and the card stays p2. The engine's number-comparand declared-type door already narrows a numeric string to its number before any driver. This PR removes the race at the producer.
Tests
New pin
FilterConditionField.schemaPendingHold-35057.test.tsx(6 cases):getObjectSchema, for implicit equality,$gtand$lte: the stored row's box is disabled, and a change fired at it emits nothing. After the answer, typing6emits the number ({"amount":{"$gt":6}}).getObjectSchemanever holds it. Both of these still emit the typed text, because no type is known.Readings
All readings below were taken on the working tree that was then committed unchanged as
53cd5c9d(component blobace20001), on base8b550f81. The reverse verification ran before the commit, so its restore was proven by hash rather than by checking outHEAD.pnpm --dir ui exec vitest run packages/fields/src/widgets/__tests__/FilterConditionField.schemaPendingHold-35057.test.tsx: Tests 6 passed.8b550f81and then restored (hashace20001checked after restore): 4 failed, 2 passed. The three held cases failed with "Received element is not disabled", and so did the failed-read release case, whose pre-answer leg asserts the hold. The two controls passed. This is the predicted direction.pnpm --dir ui exec vitest run packages/fields/src/widgets/on the final tree: Test Files 147 passed (147), Tests 1437 passed (1437).pnpm --filter @object-ui/fields run type-check: 0error TS.dispatch-gates --commands): 38 derived, 38 run, every one exit 0. That includespnpm --dir ui exec vitest run scripts/(Test Files 171 passed, 2 skipped).Acceptance notes
FilterConditionField(dataset / related-list filters) has no such window, read at source: it mounts the builder only once the caller's typed field list is non-empty.Generated by Claude Code