Repository navigation
Commit e7399fc
fix(console): moving straight from one object's data page to another's opens the new address's list (#36599)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9GPJ8pmbK219Pay95x25Uno)_
Fixes #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 #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>1 parent d24e4ab commit e7399fc
3 files changed
Lines changed: 128 additions & 14 deletions
File tree
- .changeset
- ui/packages/app-shell/src/views
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
359 | 357 | | |
360 | 358 | | |
361 | 359 | | |
| |||
378 | 376 | | |
379 | 377 | | |
380 | 378 | | |
381 | | - | |
382 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
383 | 384 | | |
384 | 385 | | |
385 | 386 | | |
| |||
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| 400 | + | |
| 401 | + | |
399 | 402 | | |
400 | 403 | | |
401 | 404 | | |
| |||
414 | 417 | | |
415 | 418 | | |
416 | 419 | | |
417 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
418 | 426 | | |
419 | 427 | | |
420 | | - | |
| 428 | + | |
| 429 | + | |
421 | 430 | | |
422 | 431 | | |
423 | 432 | | |
| |||
447 | 456 | | |
448 | 457 | | |
449 | 458 | | |
450 | | - | |
| 459 | + | |
451 | 460 | | |
452 | | - | |
| 461 | + | |
453 | 462 | | |
454 | 463 | | |
455 | 464 | | |
| |||
1063 | 1072 | | |
1064 | 1073 | | |
1065 | 1074 | | |
1066 | | - | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1067 | 1078 | | |
1068 | 1079 | | |
1069 | 1080 | | |
| |||
0 commit comments