Skip to content

fix(console): the /data page keeps its list's search, sort, grouping and Filter panel in the address - #36571

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36408-data-page-list-state
Nov 23, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/issue-36408-data-page-list-state

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #36408
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在对象的「数据」页上,读者的搜索、排序、分组和筛选面板条件,打开一条记录再关闭、或刷新页面之后都还在,地址栏也能直接复制分享。
  • 为什么做:列表体验收口——数据页此前每打开一条记录就丢掉读者的搜索,只能重新输入;对象列表早已保留这些,这里补齐同样的做法。
  • 出错会怎样:数据页的读者可能看到一个他没想要的搜索或筛选还在生效;页面的「已筛选」标签与「重置」照常可用,合并可直接回滚撤销。
  • 要你做什么:无。

What changes

ObjectDataPage (/apps/APP/OBJECT/data) now keeps its list's own state in the address, under the keys ObjectView already uses and through the same reader and writer (parseListStateParams / applyListStateParams from userFilterUrlState.ts, reused unchanged; objectViewListUrlState.ts is not touched):

What Param How the list reads it How a change is written
search uf__search initialSearchTerm onSearchChange, replace
sort uf__sort schema.sort onSortChange, replace; an emptied sort deletes the param (no sort is this page's default)
grouping uf__group schema.grouping onGroupingChange, replace
Filter panel uf__filter initialFilters onFilterChange, replace

Opening a record already carried the page's address as the record page's origin (listOriginOf), so its close, a reload and a copied link now open the list as the reader left it. /data has no pager (measured in #36299's report), so uf__page is not wired.

The design point, as settled in the claim (two layers, no new spelling). filter[...] stays the page's own address conditions: the removable 「Filtered by」 tags, what 「Reset」 puts back to the source, and what "Save as view" saves (unchanged here). uf__filter is the Filter panel on top of them, exactly as ObjectView keeps its panel on top of the view's filter. ListView applies both (the conditions AND the panel); nothing writes one from the other. No case was measured where the two layers conflict: a panel condition on the same field as a filter[...] tag simply narrows further (AND), the same as a panel condition over a view filter on the object list.

Seed. The state is read from the address once per object and list generation (the ListView props it feeds are one-shot), through ObjectView's field gate (a field the object does not declare, or one the reader cannot read once permissions are loaded, is dropped), and a uf__filter that loses any condition to the checks is refused whole with ObjectView's notice (console.objectView.linkFilterRefused, objectstack#31869's posture). The seed is then written back (replace) so the address shows what the list shows. Unlike ObjectView (objectstack#35955), a reload is not a reset here: /data has no view to return to and no draft store, and the card's acceptance asks for reload survival.

viewDefaults. schema.sort / schema.grouping now carry the address's state, so the page hands ListView its own defaults apart (DATA_PAGE_LIST_DEFAULTS: no sort, no grouping; hidden fields and row height left unset, which is what the page's schema already had). The list therefore still draws no 「Reset to default」 for a sort nobody declared, and judges a reader-added grouping level as the reader's.

resetToSource (the PM's mechanism assumption, measured). resetToSource and conditionsAreSourced match the uf_ prefix, so the uf__* keys are cleared by 「Reset」 and counted by its enabled state, as the claim assumed. That is the wanted behaviour (back to the list as the related list opened it), but clearing the address alone was not enough: ListView takes its search and panel once, at mount, so the list kept applying a search the address no longer carried. 「Reset」 now also moves a list generation (key on ListView), so the list remounts on an empty seed with no search, sort, grouping, panel or quick-filter selection. That seed deliberately writes nothing back: the router commits the reset's navigation in a transition, and a write-back from the render that still read the old location put the removed filter[status] back (caught by the Reset pin below before the fix).

The L567 comment. Its intent was #2251's "nothing here writes back to any saved view": the schema-level onSortChange / onFilterChange hooks are the ones ObjectView's relay uses to persist a view. That stays true; the comment now says the list's own changes go to the address only, through ListView's host callbacks.

Files to read first, by risk:

  1. ui/packages/app-shell/src/views/ObjectDataPage.tsx — the seed block (listSeedRef, the write-back effect and its reset skip), then resetToSource.
  2. ui/packages/app-shell/src/views/ObjectDataPage.tsx — the ListView props (key, viewDefaults, the four callbacks) and the schema's sort / grouping rungs.
  3. ui/packages/app-shell/src/views/ObjectDataPage.openRule-35875.test.tsx — the new top-level describe.

Tests

The pins go into the page's existing open/close harness (ObjectDataPage.openRule-35875.test.tsx) as one new top-level describe, driven through the real ObjectDataPage, ListView grid and MePermissionsProvider:

  • the card's pin: a search typed in the toolbar, the record opened by its name and closed with the page's ✕: the origin carries uf__search, the list the close returns to still sends $search and shows the term;
  • a reload of an address with filter[status], uf__search, uf__sort and uf__filter: the query carries the search, the sort, and both layers' conditions; the address keeps both layers as they came; the panel condition draws no 「Filtered by」 tag; all of it survives an open and close;
  • a reload of an address with uf__group: the grid asks for its groups by that field, the address keeps it;
  • CONTROL: an address without list state sends no search, sort or grouping and gets none written;
  • a uf__filter naming an undeclared field is refused whole and leaves the address, filter[...] untouched;
  • 「Reset」 to the source: uf__search leaves the address and the list stops searching;
  • a sort the reader removes leaves the address, and no 「Reset to default」 is drawn.

No existing test was changed.

Runs
  • cd ui && pnpm exec vitest run --maxWorkers=2 packages/app-shell/src/views/ObjectDataPage (under os-verify-lock, after the origin/main merge, head 1a95ac7a): Test Files 9 passed (9), Tests 96 passed (96) (89 before this PR, all still green).
  • Ablation, one behaviour: the search write onSearchChange={(search: string) => writeListUrlState({ search })} replaced by onSearchChange={() => undefined} through scripts/ablation-replace.mjs (anchor x1 -> x0, blob b524303191dd -> d168962bdeb0): × a search, then a record opened and closed: the search is still applied, Tests 1 failed | 6 passed | 8 skipped; restored, blob == HEAD, git diff HEAD empty. The test imports the page from source, so no build stands between the mutation and the run.
  • pnpm run type-check in ui/packages/app-shell (both tsc --noEmit and tsconfig.test.json, whose include is src/**/*.test.ts(x), so the new pins are compiled), after building the @object-ui/app-shell^... closure (68/68): exit 0, under os-verify-lock (VERDICT command-exit 0).

Acceptance notes

  • The refused-panel notice reuses ObjectView's string, which says the list "shows the view without it"; on /data there is no saved view. Not a new key, to keep this PR off the locale packs.
  • "Save as view" saves the filter[...] conditions only, as ruled; a Filter panel condition, search, sort or grouping on /data is not carried into the new view.
  • Read from code, not measured: when the route moves from one object's /data page straight to another's, the page stays mounted and ListView is not remounted (unchanged here: it carries no object key), so its one-shot search and panel are not re-read from the new address; the seed for the new object's sort and grouping is. The quick-filter selections (uf_FIELD) were already captured once per page mount the same way. Console navigation reaches /data from a list or a related list, which mounts the page afresh.
  • Read from code, not measured: the phone list panels emit through the same ListView callbacks, so they write the same params.

Verification

Two minutes: open /apps/APP/OBJECT/data in the console, type a term in the list's search, open a record by its name, press ✕ — the list comes back still searching for it, and the address bar shows uf__search=TERM; reload — still searching.

Local gates at 1a95ac7

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 38 families for this diff; each was run after the last commit and every one exited 0 (check:* without the lock, pnpm --dir ui exec vitest run scripts/ under it: Test Files 172 passed | 2 skipped, Tests 5127 passed | 2 skipped). --ran reconciliation: 38 derived famil(ies) accounted for — 38 run, 0 NOT-MEASURED. node scripts/pm/overlap-check.mjs --branch=claude/issue-36408-data-page-list-state: VERDICT clean exit 0. Every other family is CI's.

https://claude.ai/code/session_01ADHkmRGDrq6JSytBsNFabU

🤖 Generated with Claude Code

…ng and Filter panel in the address

Claude-Session: https://claude.ai/code/session_01ADHkmRGDrq6JSytBsNFabU
Co-authored-by: Claude <noreply@anthropic.com>
…a record's open and close, a reload and a Reset

Claude-Session: https://claude.ai/code/session_01ADHkmRGDrq6JSytBsNFabU
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 22, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRGDrq6JSytBsNFabU

席位核对

ACCEPT — PR #36571 @ 1a95ac7a8fc655831505f1a16d361c3716403236 · card #36408 · L1 read by area s2-D itself (seat area order item 9), at 2026-11-23T00:07Z

  • Shape: draft → main; first line Fixes #36408 (search, sort, grouping and Filter panel kept in the address, pinned through open/close and reload); no closing keyword on another card; Clause-②: no · Metadata-protocol: none in body and changeset (l1-face.mjs --pr 36571: CLEAN).
  • Premise: /data page: closing a record opened from page 3 returns to page 1, because the page number is not in the address #36299's report 7077650228 measured the lost search; origin/main 87c7bbaf ObjectDataPage.tsx never called the list-state readers. The design point is landed as the claim 7086904833 settled it: filter[...] stays the page's own conditions (tags, 「Reset」 to source, "Save as view"), the Filter panel is uf__filter on top, ListView ANDs the two, neither rewrites the other; the dev measured no conflicting case.
  • Diff read (3 files, +379/−7): ObjectDataPage reuses parseListStateParams / applyListStateParams from userFilterUrlState.ts (unchanged, as is objectViewListUrlState.ts, which PR feat(kanban): the board's own view settings, lane header create and menu, and a lane statistic #36411 edits), seeds the list once per object and list generation through ObjectView's field gate (undeclared or unreadable fields dropped; a panel filter losing any condition is refused whole with ObjectView's notice), writes the seed back with replace, and writes every list change with replace (no history entry per keystroke). 「Reset」 to source now also remounts the list on an empty seed, so it stops searching by a term the address lost; the dev caught and fixed a write-back that restored a removed filter[status], pinned by the Reset case. The L567 comment's intent (chore: version packages #2251: never write back to a saved view) holds and is reworded.
  • Tests: 7 new cases as a top-level describe in the shared harness ObjectDataPage.openRule-35875.test.tsx (the card's search → open → close case, reload with both layers, grouping restore, CONTROL with no list state, refused panel filter, Reset, cleared sort leaves the address); 89 existing cases unchanged and green. Ablation of the search write ⇒ the card's case red, restored blob == HEAD.
  • Gates: check-runs at 1a95ac7a: 39 success, 13 expected skip, 0 failed (pr-state.mjs --pr 36571); 38 derived families reconciled 0 NOT-MEASURED (/mnt/project-files/objectstack-seat2/36408-gates-ran.txt); overlap-check clean.
  • Accepted deviation: a reload is not a reset here, unlike ObjectView, because the card's acceptance asks state to survive a reload and this page has no view to return to.
  • Out of scope, not filed (both in the PR's Acceptance notes): the refused-panel notice reuses ObjectView's wording, which says "the view"; and, read from code only and unchanged by this PR, moving straight from one object's /data to another's does not remount the page or the list, so the once-read seed is not re-read from the new address.
  • Landing: check-governed-merges.mjs --pr 36571 ⇒ NOT governed, 386 lines ≤ 3000; no contract face ⇒ no L2 owed; K = 4, no display label changed ⇒ area lands it.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 23, 2026 00:08
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 047e1dc Nov 23, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-36408-data-page-list-state branch November 23, 2026 00:35
247257110 pushed a commit to 247257110/objectstack that referenced this pull request Nov 23, 2026
…s opens the new address's list (objectstack-ai#36599)

<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9GPJ8pmbK219Pay95x25Uno)_
Fixes objectstack-ai#36577
Clause-②: no
Metadata-protocol: none

## 维护者速读
- 用户能看到什么变化:在数据页(某个对象的 /data
页)直接跳到另一个对象的数据页时,新列表按新地址里的搜索、筛选、排序、分组和快捷筛选打开,不再沿用上一个对象的搜索。
- 为什么做:刚合入的「数据页把列表状态写进地址」留下的缺口,替从一个对象数据页直接跳到另一个对象数据页的用户补上。
- 出错会怎样:最坏是换对象时列表多重新加载一次,或换对象后列表状态读错;只影响数据页,可直接撤回本改动。
- 要你做什么:无

## What changes

`ObjectDataPage` (the bare data page, `/apps/APP/OBJECT/data`) stays
mounted when the router moves from one object's data page to another's:
the route element carries no key, and `AppContent` keeps the route tree
up whenever the new object's metadata is already in scope (the same
app's bundle). Its `ListView` was keyed on `listGeneration` alone, and
`ListView` takes its search, Filter panel and `uf_FIELD` chip selections
once, at mount. So the seed the page already re-read per
`OBJECT~GENERATION` was written back into the address, but the list on
screen kept the previous object's search and ignored the new address's.

- `ListView` is now keyed on the seed key (`OBJECT~GENERATION`), the
pair the seed is already read for: a new object remounts the list on the
new address's seed; 「Reset」 to the source still moves the generation and
remounts on an empty seed, exactly as before.
- The `uf_FIELD` quick-filter chip selections (ADR-0047) are read with
the seed, from the router's address, instead of once per page mount from
`window.location.search` (which also handed a later object the first
object's chips). A 「Reset」 seed still carries none.

No props, exports or address keys change. `objectViewListUrlState.ts`
and `userFilterUrlState.ts` are untouched.

## Tests

New top-level `describe` in the shared harness
`ObjectDataPage.openRule-35875.test.tsx` (`objectstack#36577 — moving
straight from one object's data page to another's …`), driving the real
page and `ListView` under a `MemoryRouter`, navigating with
`useNavigate` (no reload):

1. `/data/demo_account?uf__search=Acm` →
`/data/demo_contact?uf__search=Glo&uf_stage=won`: the contact list
queries `$search: "Glo"` with the `stage = won` chip in `$filter`, the
toolbar keyword is `Glo`, and the address keeps both.
2. `/data/demo_account?uf__search=Acm` → `/data/demo_contact`: no
contact query carries a search, no keyword is drawn, no `uf__search` is
written.

No existing test was changed.

## Acceptance notes

- Measured on `origin/main` c0eecb1 (after PR objectstack-ai#36571), before the fix,
in the harness above: after the switch the address read
`?uf__search=Glo&uf_stage=won`, while both `demo_contact` list queries
carried `$search: "Acm"` and no `stage` condition, and the toolbar
keyword read `Acm`. The card's premise holds.
- In the running console the page stays mounted only when the new object
is already in the route's object scope (no metadata wait between the two
routes); when `AppContent` shows the route skeleton in between, the page
remounted and read the address anyway. The harness reading is the
mounted case; no browser run was made.
- `ui/packages/app-shell` has 2414 test files; the full package suite is
far beyond one foreground run here and is left to CI (`Test UI`). Run
locally: every `ObjectDataPage*.test.tsx` and every app-shell test file
naming `ObjectDataPage`.

## Verification

<details><summary>Measurement before the fix (origin/main
c0eecb1)</summary>

```
READING {"pathname":"/apps/sales/demo_contact/data","search":"?uf__search=Glo&uf_stage=won","contactQueries":[{"$search":"Acm"},{"$search":"Acm"}],"keyword":"Acm"}
```
</details>

<details><summary>Tests after the fix (HEAD b79c0e9)</summary>

```
ObjectDataPage.openRule-35875.test.tsx   Test Files 1 passed (1) · Tests 17 passed (17)
ObjectDataPage*.test.tsx                 Test Files 9 passed (9) · Tests 98 passed (98)
app-shell tests naming ObjectDataPage    Test Files 24 passed (24) · Tests 305 passed (305)
pnpm --filter @object-ui/app-shell type-check   exit 0
```
</details>

<details><summary>Ablation: key the list on the generation
again</summary>

`scripts/ablation-replace.mjs`, anchor `key={listSeedKey}` →
`key={listGeneration}` (anchor 1 → 0, replacement 0 → 1, blob 31d1f7d →
3a349549):

```
× a search and a chip on the new address … — expected 'Acm' to be 'Glo'
× a new address with no list state … — expected 'Acm' to be undefined
Tests 2 failed | 15 skipped (17)
```
Restored: blob after restore 31d1f7d == HEAD, `git diff HEAD` empty.
</details>

<details><summary>Derived gates (HEAD b79c0e9)</summary>

```
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran … :: exit 0
Run reconciliation — 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN.
node scripts/pm/overlap-check.mjs --branch=claude/issue-36577-data-page-object-switch :: VERDICT clean exit 0
```
</details>

Read first: `ObjectDataPage.tsx` — the `ListView` `key` and the seed's
`userFilterSelections` (risk: a remount loop if the key changed on every
render; it changes only with the object or a 「Reset」).

Two-minute check: `cd ui && pnpm exec vitest run
packages/app-shell/src/views/ObjectDataPage.openRule-35875.test.tsx -t
36577` — two passing cases.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/data page: search, sort, grouping and filters are lost after opening a record (not kept in the address)

2 participants