Skip to content

feat(console): the object list keeps the page a reader turned to, in the address - #31229

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-0ph69g
Nov 7, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-0ph69g

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #30850

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:控制台对象列表把当前页码写进地址栏(uf__page,用 replace 写,不新增历史记录)。翻到第 2 页、整页打开一条记录、再按返回,列表回到第 2 页;刷新和复制链接也落在同一页。手机上卡片列表的翻页同样生效。ListView 新增两个宿主属性 page / onPageChange(受控页码,和 sort 由宿主持有同一思路),不传时行为不变。
  • 为什么改:维护者裁决 6708434746 选了方案 A(页码进 URL)。记录路由与列表路由是兄弟路由,整页打开记录会卸载列表,原来的页码是组件内 useState(1),返回后总是第 1 页。手机上每条记录都整页打开,所以手机用户每看一条就回到第 1 页。
  • 风险与回滚:两条既有规则保留:对象、筛选、排序、搜索、分组、每页条数或视图一变就回第 1 页并清掉参数;页码超出末页时收到最后一页。实现中发现一个连带问题并一起修了:路由器的函数式 setSearchParams 基于上一次渲染的参数,在第 2 页输入搜索词时,搜索写入和随之触发的「回第 1 页」写入会互相覆盖,搜索词丢失。现在 ObjectView 的写入在地址变化前串联。回滚即 revert。
  • 先看:ui/packages/app-shell/src/views/ObjectView.tsx(写入串联,风险最高的一段),ui/packages/plugin-list/src/ListView.tsx(受控页码与 setServerPage),ui/packages/app-shell/src/views/userFilterUrlState.ts(uf__page 的读写)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/ObjectView.listPageInUrl-30850.test.tsx,预期 Tests 6 passed (6)。
  • 需要你做的:无,席位落地。

What changes

  • @object-ui/plugin-list — a controlled page. ListView declares two host props, page and onPageChange. Passing page makes the page controlled: the list reads it every render and asks for every move through onPageChange (the pager; the existing reset to page 1 when the object, filters, sort, search, grouping, page size or view change; the existing clamp to the last reachable page when a load comes back empty past the end). setServerPage stays the one door every move goes through; it is now stable and reads the latest committed page and host callback through a ref set in a layout effect, because the fetch effect's clamp and the sort handlers call it from closures taken renders ago. A move to the page already shown calls nothing. Without page the list keeps its page itself, exactly as before, and onPageChange only reports the move. Both props are destructured by name, so neither rides the {...props} forward into the view component.
  • @object-ui/app-shell — the binding. The list's page joins the uf_ list-state family as uf__page (LIST_PAGE_PARAM), owned by userFilterUrlState.ts. parseListPageParam reads it strictly: a whole number from 1 up, else page 1. applyListStateParams({ page }) writes a page past 1 and deletes the param for page 1 or null. useObjectViewListUrlState reads it from the address every render (listPage), and objectViewListRenderer passes it to ListView as page, with onPageChange writing back through writeListUrlState({ page }), which replaces the entry.
  • Name choice against urlParams.ts. RESERVED_URL_PARAMS does not hold uf__page (pinned). The bare name page was not taken: the AppContent docblock above RECORD_NAMED_PAGE_ROUTE records page as a page-scoped list parameter "elsewhere", and the uf_ family is where the object list already keeps its search, sort, filter and grouping, so the sign-out return link (withoutListStateParams) and "Reset to view" drop it with the rest without new code paths.
  • The page is the reader's place, not list state. uf__page is left out of userFilterParamsKey, so a page alone never makes an address read as a link that carries list state (which would skip the reader's stored sort and filters), and out of parseUserFilterParams, so it is never read as a quick-filter chip on a field named _page. It is not part of the seed: it is read live on every render.
  • Write chaining in ObjectView. React Router's functional setSearchParams starts from the params it last rendered, and the navigation commits in a transition. A search typed on page 2 wrote uf__search, then the list's reset wrote "delete uf__page" from the same stale params, and the search term was lost (the real-router test below caught it). ObjectView's one setter now starts each write from the previous write until location.key moves. It serves every writer on the page (list state, quick-filter chips, the drawer's recordId), so a chip change on page 2 is covered by the same fix.
  • README (ui/packages/plugin-list/README.md): a "Host props: page and onPageChange" section beside the other host props.
  • Changeset .changeset/30850-list-page-in-url.md: @object-ui/plugin-list and @object-ui/app-shell patch, Clause-②: yes (widening) (plugin-list's published ListViewProps gains two optional props; app-shell's module exports gain LIST_PAGE_PARAM and parseListPageParam), Metadata-protocol: none. No i18n key is added, changed or removed.

Why

Ruling 6708434746 (maintainer 「同意」 to A): the list page goes in the URL as a page-scoped param named against urlParams.ts, written with replace, cleared by the reset-to-1 rule. The record route is a sibling of the list route in AppContent, so a record opened as a full page unmounts ObjectView and ListView, and the list's useState(1) page started over on Back. On a phone every record opens as a page (#27058), so every phone reader lost their place after each record.

Phone measurement first (the ruling's precondition). The phone list pages; it does not load on scroll. ObjectGrid's card face (below the app breakpoint) ends in object-grid-card-pager, which calls the same manualOnPageChange the table's pager does, and there is no scroll or intersection loader in the card path. Measured in a rendered test at 390 px through the real ObjectView and grid: the card pager is drawn, its Next turns to page 2 ($skip 10), and Back from the record page lands on page 2 with Page 2 of 3. So no batch or scroll restore is owed. Not measured on a physical device or a live Console at phone width.

Tests

  • New ui/packages/app-shell/src/views/ObjectView.listPageInUrl-30850.test.tsx (6 cases). This page, plugin-view's ObjectView, plugin-list's ListView and plugin-grid's grid and card list render for real under a MemoryRouter whose record route is the list route's sibling, as in AppContent. Every step is a click (fireEvent) and the window the list asked for is read at the data source:
    • desktop: Next page → uf__page=2, $skip 10, every navigation REPLACE; the row's ↗ "Open as full page" → the record route, list unmounted; Back → uf__page=2, the remounted list asks only for $skip 10, the pager reads Page 2 of 3; one more Back leaves the list;
    • phone (390 px): the card pager turns to page 2; a card tap opens the record page; Back → page 2, Page 2 of 3 on the card pager;
    • a reload or copied link with uf__page=3 asks only for $skip 20;
    • a search typed on page 2 → uf__search written, uf__page gone, the window { skip: 0, search };
    • uf__page=40 clamps to page 3 and the address follows;
    • control: uf__page=two opens page 1.
  • New ui/packages/plugin-list/src/__tests__/ListView.controlledPage-30850.test.tsx (7 cases, stub grid as in ListView.serverPagination.test.tsx): opens on the host's page with no page-1 window first; a pager move goes to the host and the window follows the value passed back; control: a host that does not pass the move back keeps the list where it is, no refetch; a query change sends the host back to 1; past the end clamps through the host; a move to the page already shown calls nothing; control: uncontrolled keeps its own page and still reports the move.
  • New ui/packages/app-shell/src/views/userFilterUrlState.listPage-30850.test.ts (7 cases): the spelling and no collision with RESERVED_URL_PARAMS; strict reading (0, -2, 2.5, 1e3, 2, 02, two, a 30-digit value all read as 1); page 1 and null delete, a patch without page leaves it; not a chip; not in userFilterParamsKey; dropped by both withoutListStateParams.
  • Ablations, see Verification.

Acceptance notes

  • Page size is not in the address. A page size the reader picks in the pager is still ListView component state (no host stores it, before or after this change). Picking one resets to page 1 and clears the param, but after a full-page open and Back the list returns to the declared or default size while uf__page keeps its number, so the page number then counts windows of that size. Within the ruling's scope (the page only); noted, not filed.
  • A malformed uf__page stays in the address until the next move writes the param; it opens page 1 and changes nothing else. The other uf_ params are rewritten on load by the seed; the page has no seed by design.
  • Write chaining reaches every writer of ObjectView's search params, not only the list's. It changes nothing when writes are already a render apart (the base is then the rendered params, as before); it only stops a second write in the same window from undoing the first.
  • Live Console not run. The round trip and the phone path are proved by rendered tests through the real router and the real list and grid, not by a browser against a backend.

Verification

Base 8ef4d309 (origin/main when the branch was cut). Heavy runs through scripts/pm/os-verify-lock.sh.

Suites and type-checks
  • Prerequisite: pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...' --filter '@object-ui/plugin-list^...' build, VERDICT command-exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=3 --reporter=dot packages/plugin-list/ plus the 171 app-shell test files that import ObjectView, userFilterUrlState, objectViewListUrlState, objectViewListRenderer or plugin-list (on ed830606; head 5793838e differs only by one test-file import): Test Files 343 passed (343), Tests 3749 passed (3749), VERDICT command-exit 0. The whole app-shell suite (2,212 files) is left to CI's Test UI.
  • The three new files on head 5793838e: Test Files 3 passed (3), Tests 20 passed (20), VERDICT command-exit 0.
  • pnpm --filter @object-ui/plugin-list run type-check and pnpm --filter @object-ui/app-shell run type-check (each tsc --noEmit and tsc -p tsconfig.test.json): exit 0.
  • pnpm --dir ui exec eslint over the eight touched or new source and test files: exit 0, 0 errors.
Ablations (3, each red, each restored)

Each through scripts/ablation-replace.mjs: anchor hit once, mutation proven on disk by anchor count and blob change, restore proven by blob == HEAD and git diff HEAD empty. ui vitest aliases @object-ui/plugin-list to src, so no build sits on the path.

# Mutation Red
A1 ListView ignores page (const serverPage = ownPage;) 10 failed / 3 passed across the plugin-list and ObjectView files (the 3 are the uncontrolled control, the same-page no-call case and the malformed-value control)
A2 ObjectView writes stop chaining (pending && false) 1 failed / 5 passed (the search on page 2 loses its term)
A3 uf__page counted in userFilterParamsKey 1 failed / 6 passed (the page alone keys as nothing)

A3's first attempt was refused by the tool before running (its replacement text already occurred in the file, so the count could not rise); it was rerun with a distinct replacement, and the reading above is the rerun.

Derived gates (dispatch-gates --commands, 36 families, plus 4)

All on head 5793838e, exit codes captured before any pipe.

  • 36 derived, 36 run, all exit 0. dispatch-gates.mjs --ran: "36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED".
  • Among them pnpm --dir ui exec vitest run scripts/: Test Files 170 passed | 2 skipped (172), Tests 4996 passed | 2 skipped (4998).
  • Run beyond the derivation, all exit 0: both type-checks, the eslint run above, and pnpm --dir ui check:new-line-citations (0 new citations).
  • The first round (head ed830606) had one red: check:test-source-alias asked the new ObjectView test to load @objectstack/lint at module top, since ObjectView reaches a dynamic import('@objectstack/lint') through celAuthoring.ts. 5793838e adds that import; every family was then rerun.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (Not touched.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

Signed: domain:ui#1 · os-project-manager · session_01FEkQ5pnaew3QBpfvsdUhfi


Generated by Claude Code

ListView takes a controlled page (page / onPageChange). The console's
object page binds it to the uf__page param, written with replace, so Back
from a record opened as a full page, a reload and a copied link land on the
page the reader left. The list's reset to page 1 clears the param, and a page
past the end still clamps to the last reachable one.

The page's search-param writes now chain until the location moves, so the
reset a query change causes no longer drops that change.

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

objectstack-fleet Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nLA7wiVY5YWjT9Svr

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 5793838ea1481dadf5b4f8b5e5ac651bd880631f
Local-runs: none

The lane seat's own review of record, owed by the Clause-②: yes (widening) declaration alone (face declaration). No path of the diff is a published schema (packages/spec untouched) or a governed path.

① Derived judgments

  • @object-ui/plugin-list (published, not private) widens ListViewProps by two optional host props, page?: number and onPageChange?: (page: number) => void, and removes or retypes no member. Both are destructured by name, so neither rides {...props} into the view component. Absent page, the list keeps its own page from 1 as on main. A widening: Clause-②: yes (widening) is RIGHT.
  • setServerPage stays the one door every move goes through. Every caller on the head passes a value (the clamp, the three resets to 1, the pager and the page-size change), never a function updater, so making it a stable value-only callback changes no caller.
  • @object-ui/app-shell is private: true: LIST_PAGE_PARAM, parseListPageParam, the page member of ListStatePatch and the write chaining in ObjectView.tsx are not published surface.
  • Metadata-protocol: none is RIGHT: page is a host prop, never a schema key, and uf__page is a console address param, not metadata an author writes.
  • Accept sets: parseListPageParam reads only ^[1-9][0-9]*$ within safe integers and falls back to page 1; a page past the end is the list's existing clamp. No server door changes.

② Semver level

  • patch on @object-ui/plugin-list and the private @object-ui/app-shell, with both declaration lines on the PR body and the changeset: RIGHT under ruling A.

③ Boundary flags

  • The write chaining in ObjectView.tsx (each search-param write starts from the previous pending write until location.key moves) is outside the claimed urlParams.ts file but inside the claimed list binding in ui/packages/app-shell/src/**. It fixes a defect the new param exposed (a search typed on page 2 lost to the reset's page write) and serves every writer on the page. Accepted; pinned by the real-router test and ablated, per the dev's report.
  • The claim named urlParams.ts; the head leaves it unchanged and pins that RESERVED_URL_PARAMS does not hold uf__page. Accepted: the param joins the existing uf_ list-state family instead.
  • Phone measured in a rendered 390 px test only, not on a device or a live Console. Accepted as the ruling's precondition reading, named in the PR body.
  • The claim said Clause-②: no; it is amended on the card to yes (widening) (as measured).
  • open_questions: none.

Implemented-by: claude/project-thread-0ph69g
Reviewed-by: session_01FEkQ5nLA7wiVY5YWjT9Svr

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nLA7wiVY5YWjT9Svr

席位核对 · ACCEPT · 2026-11-07T18:54Z · head 5793838ea1481dadf5b4f8b5e5ac651bd880631f

Seat domain:ui#1 reviewed the diff of its own dispatch (claim 6709232532 on #30850 with amendment 6711523179, card thread session_01FEkQ5pnaew3QBpfvsdUhfi, report 6711493832). Read against GitHub, not the report.

  1. Shape: 10 files, +744 / -9. ListView gains optional host props page / onPageChange; with page the page is controlled and every move (pager, reset to 1, clamp past the end) goes through onPageChange; setServerPage is a stable value-only callback reading the latest page through a ref, and every caller passes a value. App-shell keeps the page as uf__page in the uf_ list-state family (parseListPageParam strict, page 1 is no param, written with replace, left out of userFilterParamsKey), and ObjectView's search-param setter chains writes until location.key moves, so a search on page 2 is no longer lost to the reset. README section for the host props. Body says Fixes #30850; no other closing keyword.
  2. Premise: on main the list's page is useState(1) in ListView.tsx, so a record opened as a full page unmounts the list and Back lands on page 1. Ruling 6708434746 (option A) puts the page in the URL.
  3. Gates / check-runs: 55 runs on this head, 44 success, 11 skipped, 0 red. Dev: 36/36 derived gates exit 0 with 0 NOT-MEASURED, both type-checks, eslint; new tests through the real router (6 cases incl. phone 390 px) and plugin-list controlled-page tests, the write chaining pinned and ablated. mergeable_state clean.
  4. Accepted deviations / notes: urlParams.ts is unchanged (the param joins the uf_ family instead; RESERVED_URL_PARAMS pinned not to hold it). The phone reading is a rendered 390 px test, not a device or live Console. The write chaining is inside the claimed list binding and serves every writer on the page.
  5. Out of scope / Skills-docs: Metadata-protocol: none (host prop and console address param, not metadata); no packages/spec/src path, so Skills-docs: is not owed. Nothing filed.
  6. Landing: check-governed-merges --pr 31229: not governed, 753 changed lines, so no human approval owed. Clause-②: yes (widening) (two optional props on the published ListViewProps): its TIER_DEFAULT review is PASS on this head (6711530296). Changeset patch for @object-ui/plugin-list and @object-ui/app-shell. Landing on the maintainer's standing words 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z) and 「你应该使用 pm-dispatch 技能审核和落地pr」 (2026-11-07T16:59Z). Relay pr_ready, then automerge_enable. On merge [Decision] A record opened as a full page sends its list back to page 1: should the console list keep the page a reader turned to? #30850 closes by Fixes; the seat removes pm:dispatched.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 7, 2026 18:56
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 7, 2026 18:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 733efbd Nov 7, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-0ph69g branch November 7, 2026 19:15
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/l tests 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.

[Decision] A record opened as a full page sends its list back to page 1: should the console list keep the page a reader turned to?

1 participant