This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 6d1e77c
fix(plugin-list): a held user filter does not narrow the fetch on a dataset-bound chart (objectui#10512) (#10597)
Fixes #10512
Clause-②: no
## What changes
objectui#10327 withholds the toolbar Filter builder and the
`UserFilters` chips while a dataset-bound `chart` is on screen
(`datasetChartOnScreen`), but only the controls. A group the host
restored at mount (`initialFilters`), or one set on a grid before an
in-list switch, still reached `ListView`'s own fetch, and so the
record-count bar. This PR withholds the APPLIED user filter too, in the
shape objectui#10326 gave Search (`searchTerm` derived empty beside the
held `searchInput`), as the triage ruled (comment 5829668693).
- `appliedFilters` / `appliedUserFilterConditions` are derived beside
the held `currentFilters` / `userFilterConditions`: empty while
`datasetChartOnScreen`, the held value otherwise.
- The held state is not touched: a switch back to a view that offers the
controls applies it again, and `onFilterChange` is not called for the
switch.
- The view's own `schema.filter` is not the user's filter and stays in
the query.
- Each held source is swapped for a module constant only when it holds
something, so a switch into the dataset chart with nothing held hands
the fetch effect the identities it already had and re-issues no query
(the objectui#7394 class).
- ⛔ The toolbar gate (`showFilters` / `showUserFilters`) from
objectui#10327 is unchanged: no diff line touches either flag.
### Readers of the user filter
Switched to the applied value:
- the fetch: `buildEffectiveFilter` in the fetch effect, and the
effect's dependency list;
- the server export: `buildEffectiveFilter` in the export callback, and
its dependency list (the client export writes `data`, the fetch's own
answer);
- `pageResetSignature`;
- `selfQueryFilter`, with no behaviour change: its consumers (the gantt,
tree and object-bound chart nodes) are views on which
`datasetChartOnScreen` is false, so applied equals held there, and the
dataset node carries no filter (objectui#10327). Switched so that its
comment, "the SAME effective filter this component's own fetch sends",
stays literally true;
- the grid empty-state `hasActiveQuery`, with no behaviour change (grid
only, where applied equals held).
Left on the held state, deliberately:
- the Filter builder's `value`, and its trigger's `hasFilters` highlight
and badge count: the control that shows and edits the held group, not
rendered on the dataset chart;
- `UserFilters`, which keeps its own selection state and is not rendered
on the dataset chart;
- the host write-back (`onFilterChange`,
`onUserFilterSelectionsChange`), fired only by the controls, so the
host's storage keeps the held state.
## H0, measured first (objectui `origin/main` `a506001`)
A component-level probe (not committed): the real `ListView`, an
`object-chart` stand-in that records the node it is handed, a
dataset-bound `chart` block, and `initialFilters` restoring `status
equals open` over three rows. Readings on the base:
- the chart node was the dataset shape (`dataset: task_ds`, no `filter`
key);
- `ListView`'s fetch ran, 1 call, with `$filter` =
`["status","=","open"]`;
- the record-count bar rendered and read `1 record` (3 rows unnarrowed);
- neither the Filter builder nor the chips were on screen.
The fetch runs AND the count bar draws, so the narrowing is user-visible
and the fix lands. ⛔ Not rendered in a browser: the count bar is
`ListView`'s own DOM, independent of the chart renderer.
## Pins
`ListView.datasetChartAppliedFilter-10512.test.tsx` in
`packages/plugin-list/src/__tests__`, 6 cases. Each asserts the query
the data source receives (the fake answers from the fields its `$filter`
names, so the count bar reads a different number for a narrowed query):
1. CONTROL: on a grid, a restored group narrows the fetch, and the count
bar reads `1 record`.
2. CONTROL: on a chart bound to the list object, a restored group still
narrows the fetch.
3. On a dataset-bound chart the fetch runs and the count bar draws, and
a restored group narrows neither: no `$filter` in any call, the bar
reads `3 records`, `onFilterChange` not called.
4. The view's own `filter` stays in the query on the dataset chart,
alone: every call's `$filter` equals the base filter, the bar reads `2
records`.
5. A group restored on a grid plus a chip toggled there stop narrowing
the fetch on a switch to the dataset chart, and the group applies again
back on the grid; the builder badge still reads 1 and `onFilterChange`
is never called.
6. CONTROL (objectui#7394): with nothing held, the switch to the dataset
chart re-issues no query.
### Reverse verification (from the committed fix)
`ListView.tsx` checked out at the base `a506001` (on-disk blob `03798ad`
equal to the base blob; 0 occurrences of `appliedFilters` on disk), the
pin run, then restored with `git checkout HEAD --` under a trap
(restored blob `d86a5db` equal to the HEAD blob, `git diff HEAD` 0
bytes):
- base leg: exit 1, `Tests 3 failed | 3 passed (6)`; red are cases 3, 4
and 5, green are the three controls;
- fix leg: exit 0, `Tests 6 passed (6)`.
### Ablation (the objectui#7394 control can fail)
Predicted before running: an unconditional swap of the Filter group
turns case 6 red and nothing else. Run through `ablation-replace.mjs`
(anchor `datasetChartOnScreen && currentFilters.conditions &&
currentFilters.conditions.length > 0`, 1 hit, anchor count 1 to 0, blob
`d86a5db` to `d364171`): exit 1, `Tests 1 failed | 5 passed (6)`, the
failed case is case 6. Restored: blob equal to HEAD, `git diff HEAD`
empty. Observed direction matches the prediction.
## Verification (final head `ad119b4`, after merging `origin/main`
`f5178a2`)
- `pnpm exec vitest run packages/plugin-list/ --maxWorkers=2`: exit 0,
`Test Files 94 passed (94)`, `Tests 1131 passed (1131)`.
- `pnpm turbo run type-check --filter @object-ui/plugin-list
--concurrency=2`: exit 0, `Tasks: 14 successful, 14 total`, plugin-list
a cache miss; `tsconfig.test.json` lists the new pin (`--listFilesOnly`,
1 hit).
- `pnpm exec eslint` on `ListView.tsx` and the new pin: exit 0, 0
errors; per-rule warning counts on `ListView.tsx` equal to the base
file's (compared in one `--format json` run).
- `pnpm check:control-bytes`, `check:test-path-roots`,
`check:vi-mock-specifiers`, `check:vi-mock-inherit`,
`check:vi-mock-override-shape`, `check:new-line-citations` (0 new
citations), `check:changeset-claims`,
`check:pending-changeset-literals`, `check:shell-escape-residue`,
`check:handler-key-reads`, `check:i18n-keys`,
`check:unreferenced-sources`: each exit 0.
- `node scripts/check-changeset-presence.mjs`,
`check-changeset-no-major.mjs`, `check-type-check-coverage.mjs`,
`check-lint-coverage.mjs`: each exit 0.
- ⛔ The repo-wide `pnpm lint` and the full `pnpm test` are CI's.
`check:changeset-claims` names 7 pending changesets that mention
`ListView.tsx` (`7070-no-invented-gantt-date-fields`,
`7499-gantt-non-axis-floors-omitted`,
`7773-kanban-adapter-groupfield-write`,
`7780-object-kanban-record-source`,
`8990-object-kanban-groupby-optional`,
`list-user-actions-collision-5398`, `listview-comment-pair-4559`). Each
paragraph was read; none is about how the user filter is applied, and
none is made false by this diff.
## Changeset
`.changeset/10512-dataset-chart-applied-filter.md`, `patch` for
`@object-ui/plugin-list`.
## Acceptance notes
- **Chip state across an in-list switch (pre-existing, not changed
here).** Measured on the base `a506001` with the same probe harness:
toggle a `UserFilters` chip ON on a grid, switch to the dataset chart,
switch back. The chip renders OFF again (its button carries the outline
variant), while `ListView`'s held `userFilterConditions` still sends
`["priority","!=",null]` and the count bar reads `2 records`.
`UserFilters` keeps its selection in its own state, and the
objectui#10327 gate unmounts it on the dataset chart. This PR leaves the
grid leg exactly as it was (applied equals held there); the pin
deliberately does not assert the chip's return. Reported to the seat as
a separate finding. Dropdown and tab chips were not measured.
- **An unfinished builder row.** The swap keys on the held group's row
count, not on its compiled filter (compiling at render could throw a
`FilterOperatorError`). A held group whose every row is unfinished
therefore still swaps on a switch into the dataset chart, and that one
switch re-issues a query equal to the one before it.
The session that implemented this:
`https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy` (domain:ui
seat 5 dispatch).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent d3df3c0 commit 6d1e77c
3 files changed
Lines changed: 309 additions & 8 deletions
File tree
- .changeset
- packages/plugin-list/src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
686 | 694 | | |
687 | 695 | | |
688 | 696 | | |
| |||
1145 | 1153 | | |
1146 | 1154 | | |
1147 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1148 | 1165 | | |
1149 | 1166 | | |
1150 | 1167 | | |
| |||
1488 | 1505 | | |
1489 | 1506 | | |
1490 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
1491 | 1524 | | |
1492 | 1525 | | |
1493 | 1526 | | |
| |||
2154 | 2187 | | |
2155 | 2188 | | |
2156 | 2189 | | |
2157 | | - | |
| 2190 | + | |
2158 | 2191 | | |
2159 | 2192 | | |
2160 | 2193 | | |
| |||
2663 | 2696 | | |
2664 | 2697 | | |
2665 | 2698 | | |
2666 | | - | |
| 2699 | + | |
2667 | 2700 | | |
2668 | 2701 | | |
2669 | 2702 | | |
| |||
2674 | 2707 | | |
2675 | 2708 | | |
2676 | 2709 | | |
2677 | | - | |
| 2710 | + | |
2678 | 2711 | | |
2679 | 2712 | | |
2680 | 2713 | | |
| |||
3042 | 3075 | | |
3043 | 3076 | | |
3044 | 3077 | | |
3045 | | - | |
| 3078 | + | |
3046 | 3079 | | |
3047 | 3080 | | |
3048 | 3081 | | |
| |||
3964 | 3997 | | |
3965 | 3998 | | |
3966 | 3999 | | |
3967 | | - | |
| 4000 | + | |
3968 | 4001 | | |
3969 | 4002 | | |
3970 | 4003 | | |
| |||
4066 | 4099 | | |
4067 | 4100 | | |
4068 | 4101 | | |
4069 | | - | |
| 4102 | + | |
4070 | 4103 | | |
4071 | 4104 | | |
4072 | 4105 | | |
| |||
4933 | 4966 | | |
4934 | 4967 | | |
4935 | 4968 | | |
4936 | | - | |
4937 | | - | |
| 4969 | + | |
| 4970 | + | |
4938 | 4971 | | |
4939 | 4972 | | |
4940 | 4973 | | |
| |||
0 commit comments