Repository navigation
feat(studio): metadata list filters, sort and scroll ride the list address - #36939
Conversation
…dress The list's search, source, customized-only, status filter and a new sort live in URL params (replace, not push); row links carry them to the detail; a pure filter/sort module and a hook give the detail its ordered names. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
…roll restore Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
…ts state in an effect Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
…machine's Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
|
repo:objectstack#3 · os-support-ai · session_01WGufzgv4KRPATgwPAzKKMU 席位核对 — ACCEPT · repo:objectstack#3 · head 234dc13 · 2026-11-24T10:24ZL1: ACCEPT Read
Checklist
FindingsNo must-fix, no should-fix.
Note to the seat
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x Landing: 2026-11-24T10:26Z · head 234dc13 · L1 ACCEPT 7128761676 (nits only: merge-commit trailers, hook doc wording on the no-package case, no sort-control screenshot)
State: ready + auto-merge via the relay; on MERGED, #36896 closes by |
Requested by Yibo Wang · project thread
Fixes #36896
Part of #36890
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
On the existing table (no table swap), in
ui/packages/app-shell/src/views/metadata-admin/:ResourceListPage.tsx— the search text, source filter, "only customizations" and the activation status filter move from component state into the list's URL as page-scoped params:q,source(artifact/runtime),customized=1,status(active/inactive), plus the newsort. A value at its default is left out (an untouched list keeps its clean address). Every write is areplace, never apush, so typing never floods history and Back leaves the list.packageandscopekeep their params and meaning; the "source package" the card names is that existingpackagescope. The search box keeps a local draft that follows the address only on a navigation the page did not write (PUSH / POP), because the router commits locations in a transition and an echo would otherwise reset the caret mid-typing.LIST_SORT_KEYSplus one reader member; nothing depends on the sibling-field card.package/scope/member. No "from Studio" marker exists in the address today, so none is added (decision 15 belongs to the detail-header card).useListScrollRestore.ts: the list's position is kept in memory per list address (path plus query) and restored once the rows are drawn when the same address is shown again (Back, or a link to the list with the same params). The scroller is the nearest vertically scrolling ancestor, else the page, so Setup and the Studio area behave alike. Positions are recorded only after the restore, so the clamp a loading page causes never overwrites one.metadataListState.ts(new, pure) — the codec (decodeListState/writeListState/listContextQuery/hasListContext), the package scope (scopeListRows), the filter and sort (applyListState) andorderedListNames. The page draws throughapplyListState, so the list and the detail order cannot disagree. Sorting compares in the reader's display locale (Intl.Collator, numeric, case-insensitive), ties broken by name then input order.useListOrderedNames.ts(new) —useListOrderedNames(type)returns{ status, names, fromList }for the detail open at the current address: the type's list under the filter and sort the address carries, read the way the list reads it (area package plus its.custompair,?scope=environment, or?package=). With no list context (refresh, shared link, ⌘K) the names are every item of the scope by API name.namesis thereadonly string[]that the detail-header composite'ssequence.namestakes (read fromclaude/issue-36892-studio-detail-header, no PR open yet, not edited).StudioDesignSurface.tsxis not touched.Tests
New files, named for the card:
metadataListState-36896.test.ts— codec round trip (through the address string, beside params it does not own), defaults omitted, unknown values read as defaults, no collision with the reserved console params or the item page's params; ordered names with no context (by API name, numbers in number order), with a filter and a sort, offered vs not-offered filters, rows sharing a name, the package scope.useListScrollRestore-36896.test.tsx— scrolled, left for a detail, mounted loading (box clamps), rows drawn: back at the position; another address starts at the top.ResourceListPage.listStateInUrl-36896.test.tsx— the real page and hook: an address with a search and a sort draws the list filtered and sorted (what a refresh replays); typing writesqwith a REPLACE; a row link carries the context and an untouched list's carries none; open a row and Back lands on the same filtered list; the hook's order with a context, with none, and under a package.No existing test pinned the old component-state behaviour; none was changed.
Acceptance notes
sequenceto carry more than names.?package=X, which moves the detail onto X's leg (areaLocationRedirect), so the detail's order there is X's list, not the cross-package one. Unchanged by this PR; noted for the ‹ › card.Verification
Read first, by risk:
ResourceListPage.tsx(the search draft effect andupdateListState),useListScrollRestore.ts(record-after-restore),useListOrderedNames.ts(scope resolution).Two-minute check: open Setup, a metadata list with several items, type in the search box and pick "Label (Z–A)"; the address gains
q=andsort=-label. Scroll down, open an item, press Back: the same filtered, sorted list at the same scroll position. Refresh: the filters are still applied.All readings below at head
234dc13a6unless named.Targeted tests — 24 files, 215 tests, pass
Typecheck — app-shell, src and tests, pass (311972e, before the main merge)
Ablations — two, each red, each restored to HEAD
A first try of the second ablation used a replacement that is a substring of its anchor;
ablation-replacerefused it before running (count 1 -> 1) and it was redone as above.Derived gates — 38 of 38 exit 0; --ran reconciliation 38 run, 0 unrun
🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x