Skip to content

Commit 6c200a4

Browse files
committed
fix(components): FilterBuilder 值控件按「无值」而非「假值」判空,三处键入数值读数收敛到严格判定 (#4873, #4875)
#4873:`!condition.value` 与 `String(condition.value || "")` 把布尔 false 与 数字 0 当成没填 —— 控件显示 placeholder / 空框,行却带着、存着、按着这个值筛。 「无值」收成一处判定(undefined / null / ''),四个显示站点与两个既有正确站点 共读。 #4875:三处 parseFloat(raw) || 0 改走 convertScalarToFamily 的严格读数 —— '42abc' 不再落成 42、'acme' 不再落成 0。读不出数在单值/区间是「没填」, 在 token 输入是拒绝提交并保留草稿。今天被 number 输入框挡着,收敛防口径漂移。 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 372d9f9 commit 6c200a4

3 files changed

Lines changed: 573 additions & 22 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
`FilterBuilder` shows the falsy values a row actually holds — a boolean `false` and a number `0` are values, not empty boxes.
6+
7+
The value controls asked `!condition.value` and `String(condition.value || "")`,
8+
which folds `false` and `0` in with the rows nobody has filled in yet. Both rows
9+
saved, persisted and filtered by their value the whole time; only the control
10+
said otherwise:
11+
12+
- a boolean column filtered `equals false` snapped back to the **Select value**
13+
placeholder the moment the user clicked **False**, while the row carried
14+
`value: false`;
15+
- a number column filtered `equals 0` showed an empty box — and typing `0` into
16+
one looked like the keystroke had never landed, because the row took the value
17+
and the very next render blanked the input;
18+
- a single-select whose option id is `0` showed the placeholder too, even though
19+
the same control's multi-select branch already drew that option as checked.
20+
21+
"No value" is now one judgement (`undefined` / `null` / `''`), read by every
22+
value control and by the two helpers that already spelled it out correctly, so
23+
"not picked yet" and "picked False" stay two distinguishable states rather than
24+
trading places.
25+
26+
The three keyed numeric paths — the token input's commit, a range bound, and the
27+
single value input — no longer read with `parseFloat(raw) || 0`, which takes half
28+
of `"42abc"` and turns `"acme"` into `0`: a filter the user never wrote. All
29+
three now use the same strict reading a field switch uses, so this component
30+
holds one answer to "is this string a number" instead of a strict one and a
31+
lenient one. An unreadable entry becomes an unfilled value, except in the token
32+
input, which declines the commit and leaves the text in the draft box to be
33+
fixed. No behaviour a user can reach today changes: those inputs are
34+
`<input type="number">`, which never hands a non-numeric string to the component
35+
in the first place — this closes the drift, before a text box, a formula or a
36+
paste path opens it.

0 commit comments

Comments
 (0)