Skip to content

Studio 重构(1-1a):元数据列表的搜索、筛选、排序和滚动位置写进地址,并提供「当前筛选下的有序名字列表」给详情页的 ‹ › 用 #36896

Description

@os-support-ai

repo:objectstack#3 · os-support-ai · session_01WGufzufqmKuir7GiTdwGd3Z

③ topic child · Source: topic #36890 (「× 回到列表,筛选和滚动位置保留」; decision 10). Part of #36890.

为什么

专题里点一行在右侧全屏打开详情,× 回来时筛选和滚动位置要还在;详情页的 ‹ › 要按列表当前筛选的顺序走,直接打开详情(刷新、分享、⌘K)时按名称排序(决定 10)。

今天(读代码确认,主干 0819cab)

  • 搜索词、来源筛选、已定制筛选、状态筛选都是组件状态(MA/ResourceListPage.tsx:200-201, 237, 249),只有 package 和 scope 在地址里;列表没有排序。

要做的

  1. 在现有表格上把搜索、来源包、来源、已定制、状态筛选和排序写进地址参数;滚动位置在 × 返回时恢复。
  2. 加列表排序(至少按标签、API 名称;有 1-2a 后按修改时间)。
  3. 提供一个「当前筛选和排序下的有序名字列表」的来源(hook 或纯函数),详情页没有列表上下文时按名称排序;接口和 0-2 头部组合件对齐。
  4. 详情地址带上列表上下文参数(决定 10)。

不做的

  • 不换表格组件(1-1b)。

验收

  • 筛选后点进详情再 ×,筛选和滚动位置都在;刷新列表页筛选还在。
  • 有序名字列表有单测:有筛选、无上下文两种情况。

Blocked-by: #36860 — only its part (a) PR (server-served list columns and the console read order; the card split it on 2026-11-24 06:04Z). Both touch ResourceListPage.tsx; this card can be dispatched as soon as that PR merges, without waiting for part (b).

Grading: area:ux · Feature · metadata list (filters lost on every round trip to a detail) · builders, every list visit · evidence: read from code. Topic child ⇒ p2.
Dedupe: ResourceListPage filter url (no open card).
Reader: seat repo:objectstack#3, one os-dev card. Size M. Metadata-protocol: none. Wave 1.

Activity

  1. added
    enhancement
    on Nov 24, 2026
  2. added
    priority:p2
    pm:blocked
    domain:ui
    on Nov 24, 2026
  3. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x

    Claim: PM loop round 1
    Session: session_01WGufzgNtKtppbRbXmHGH8x
    Account: os-support-ai
    Branch: claude/issue-36896-list-state-in-url
    Worktree: objectstack-issue-36896
    Domain: domain:ui
    Seat: repo:objectstack#3
    Area: ux-E2
    File surface: ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx (search, source package, source, customized, status filters and sort into URL params; scroll restore), NEW module(s) beside it for the list-state codec and the ordered-name-list source (hook + pure function) with their own new test files, the detail address's list-context params where ResourceListPage builds row links, Studio strings in ui/packages/i18n/** if a sort control needs them, and a changeset 36896-list-state-in-url.md; ⛔ no StudioDesignSurface.tsx, no table swap (that is #36897) (stop on breach; explain in the report)
    Container & model: M, mode:subagent, model: default — dispatch-gates.mjs --tier: "Model tier — no path-derived mandate", effort: high (M card whose ordered-name-list interface is consumed by #36901 and #36897)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — not a defect card
    Thread-read: none
    Premise: holds (read on origin/main 4f7d6f7: query, sourceFilter, onlyCustomized, statusFilter are component state (ResourceListPage.tsx:201-202, 238, 250), only package / scope ride useSearchParams (:203, :353, :399); no list sort)
    Pre-claim lane: repo:objectstack seat 3 area ux-E2 (epic #36890, list side, seat order 08:58Z); every path under ui/packages/app-shell/src/views/metadata-admin/, domain:ui, area:ux
    Pre-claim deps: Blocked-by: #36860 (part (a) only) — its part (a) PR #36881 MERGED 2026-11-24T08:20:28Z (151e812); pm:blocked removed on that merge
    Prior rulings read: check-prior-rulings --card 36896 --paths ResourceListPage.tsx: card thread 0 rulings of 0 comments; surface grep 0 ruling / 0 Ruling-ref / 2 ⛔ lines, neither on filter or URL state; governing text is epic #36890 decision 10 (list filter and sort ride the detail address; no list context ⇒ by name) and 15 (「从 Studio 来」 in the address). same-day churn: 151e812 (#36881) — 基于合并后的代码工作,issue 引用的片段可能已变,先核对当前 main。
    Serial constraints cleared: no open PR touches ResourceListPage.tsx (open-PR file scan 08:59Z); #36860 part (b) (card thread, PR not yet open) will edit the same list route — overlap-check against its PR once it opens, before every push; StudioDesignSurface.tsx not touched (no SDS slot needed)

  4. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 24, 2026
  5. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x
    os-dev-report

    {
     "issue": 36896,
     "status": "done",
     "branch": "claude/issue-36896-list-state-in-url",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/36939",
     "pr_number": 36939,
     "remote_head": "origin/claude/issue-36896-list-state-in-url @ 234dc13a6297e80467b5424b50231de681471ca0",
     "session": "session_01WGufzgNtKtppbRbXmHGH8x",
     "premise_still_valid": true,
     "summary": "Premise re-read on origin/main 4f7d6f7e: query, sourceFilter, onlyCustomized and statusFilter were React.useState; only package/scope rode useSearchParams; no sort. ResourceListPage now keeps search (q), source, customized=1, status and a new sort (by API name or label, each way; default API name A-Z, previously server order) in URL params, every write a replace; defaults are omitted; package/scope unchanged. Row links carry the non-default list params to the detail address (decision 10); no 'from Studio' marker exists in the address, so none was invented. New pure module metadataListState.ts (codec, scopeListRows, applyListState, orderedListNames - the page draws through the same filter/sort the detail reads) and hook useListOrderedNames(type) returning {status, names, fromList}; names is the readonly string[] the 36892 header composite's sequence.names takes (read from its branch, no PR open, not edited); no list context => every item of the scope by API name. Scroll position kept per list address in memory and restored once rows are drawn (useListScrollRestore.ts). Five en/zh sort strings. StudioDesignSurface.tsx untouched; no table swap.",
     "tests": "At final head 234dc13a6 (after merging origin/main 4f19091997): pnpm --dir ui exec vitest run --maxWorkers=2 over the 3 new files (metadataListState-36896.test.ts, useListScrollRestore-36896.test.tsx, ResourceListPage.listStateInUrl-36896.test.tsx) + machineLocaleCensus-9909 + every ResourceListPage.*.test + metadataAreaHost.* + walledCatalogReadOnly-12183 + anchors.validation-retired + ResourceEditPage.picklistReadOnly-10202 + StudioMetadataArea.* + StudioDesignSurface.metadataArea-28561 => 'Test Files 24 passed (24) / Tests 215 passed (215)', lock VERDICT command-exit 0. Earlier pnpm --dir ui exec vitest run packages/i18n/ caught machineLocaleCensus-9909 red on 'new Intl.Collator(undefined, ...)' in metadataListState.ts; fixed in 311972ea1 (collator takes the display locale), census green since. Ablations (subject resolves through the vitest src alias, no dist): (1) ResourceListPage.tsx row-link listContext -> '' via ablation-replace: anchor 1->0, blob 425cce28->7ca7e252, 'x a row link carries the list context; an untouched list carries none', Tests 1 failed | 7 passed, restored blob == HEAD, git diff HEAD empty. (2) useListScrollRestore.ts 'if (restoredRef.current) keep(...)' -> 'if (true) keep(...)': anchor 1->0, 'x comes back where it was, at the same address, once the rows are drawn', Tests 1 failed | 2 passed, restored == HEAD. A first attempt at (2) used a replacement that is a substring of its anchor; ablation-replace refused it (count 1->1) before running - a no-op, redone. test:repo not run locally (diff touches no repo-project test) - declared to CI.",
     "gates": "Local: pnpm --filter @object-ui/app-shell run type-check (src + tsconfig.test.json) exit 0 at 311972ea1 (lock VERDICT command-exit 0), after building the @objectstack/{spec,lint,formula,client,sdui-parser} and @object-ui/app-shell^... closures (each VERDICT 0). dispatch-gates --commands: 38 commands, all 'exit 0' (captured before any pipe, record in scratchpad gate-results), run across 26cfd99cf..311972ea1, including pnpm --dir ui exec vitest run scripts/ (172 passed | 2 skipped files, 5127 tests); dispatch-gates --ran: 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. Re-run on 311972ea1 after the last code commit: check:new-line-citations, check:doc-authoring, check:type-check-debt, check:type-check-coverage, check:test-source-alias, check:cross-package-test-inputs, check:nul-bytes, check:undeclared-dep-imports, check:published-files, check-empty-changeset, check-closing-keyword-parity :: exit 0 each. eslint on touched files: 0 errors (warnings only, pre-existing rule families). overlap-check: VERDICT clean exit 0 at 311972ea1 vs origin/main 4f19091997 and 4 open PRs (36933, 36924, 36888, 36784 share the studio catalogue, all merge cleanly); no 36860 part (b) PR open yet. CI on PR 36939 head 234dc13a6: started (22 check-runs, in_progress at report time; mergeable_state blocked, not dirty) - in_progress, convergence is PM's.",
     "dogfood_battery": "n/a - no ! in the PR title and Clause-2 is 'no' with no (narrowing) arm",
     "line_budget": "1230 changed lines (+1185 / -45, 10 files) vs merge base; under the ~1500 stop line and the 3000 human-review line; this is the card's only PR",
     "files_changed": [
      ".changeset/36896-list-state-in-url.md",
      "ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.tsx",
      "ui/packages/app-shell/src/views/metadata-admin/metadataListState.ts",
      "ui/packages/app-shell/src/views/metadata-admin/useListOrderedNames.ts",
      "ui/packages/app-shell/src/views/metadata-admin/useListScrollRestore.ts",
      "ui/packages/app-shell/src/views/metadata-admin/metadataListState-36896.test.ts",
      "ui/packages/app-shell/src/views/metadata-admin/useListScrollRestore-36896.test.tsx",
      "ui/packages/app-shell/src/views/metadata-admin/ResourceListPage.listStateInUrl-36896.test.tsx",
      "ui/packages/i18n/src/namespaces/studio/en.ts",
      "ui/packages/i18n/src/namespaces/studio/zh.ts"
     ],
     "deviations": [
      "Default list order changed from the server's order to API name A-Z, so an untouched list and a context-free detail agree (decision 10); stated in the changeset and PR body.",
      "Screenshots not attached: the card's acceptance is behavioural and pinned by tests; the only new UI is one sort select in the existing filter row.",
      "The derived gate battery ran across commits 26cfd99cf..311972ea1 (the run started before two small commits); the path-reading families were re-run on 311972ea1. The origin/main merge (234dc13a6) brought no change to the 10 files except a clean auto-merge of the studio catalogue; targeted tests re-run there, typecheck not re-run after the merge (CI).",
      "Merge commit 234dc13a6 carries git's default message without the Claude-Session trailer pair (model-free either way).",
      "PR body footer uses the dispatch-ordered form (robot line + session URL + signed comment) rather than os-dev's _Generated by_ rule-line form; the dispatch order is the more specific instruction."
     ],
     "Dev-effort": "high",
     "Rounds": 1,
     "mcp_calls": "0",
     "api_writes": "2 - relay dispatches: (1) fleet-write pr_create (POST /repos/objectstack-ai/objectstack/pulls draft + POST /issues/36939/assignees os-support-ai), run 45370446562 success, read-back identical 9260 bytes; (2) post-stamped os-dev-report comment POST /repos/objectstack-ai/objectstack/issues/36896/comments. git push is not a REST write (7 pushes to the work branch, one per commit).",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "carrier: 36901 - ordered names are keyed by name: rows sharing a name (bundle members, two-holder permission sets) are one entry; a member-aware sequence needs the header's sequence to carry more than names. Noted, not filed.",
      "carrier: 36901 - on the Studio cross-package leg a row link carries ?package=X, which moves the detail onto X's leg (areaLocationRedirect), so its order there is X's list, not the cross-package list. Pre-existing link behaviour, unchanged here. Noted, not filed."
     ]
    }
  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzgNtKtppbRbXmHGH8x

    Close-out 2026-11-24T11:17Z: PR #36939 merged 2026-11-24T11:16Z (bac4864), closing this card by Fixes. Delivered: search, source package, source, customized, status and sort in the list URL (replace writes, defaults omitted); sort by API name or label (default API name A-Z); row links carry the list context; scroll restored on return; ordered-name-list source useListOrderedNames(type) → {status, names, fromList} (names feed the #36892 header's sequence.names), by name with no list context. Nothing left on this card. Carrier notes for #36901 (not filed): names are keyed by name, so same-name rows (bundle members, two-holder permission sets) collapse to one entry; on the cross-package leg a row link carries ?package=X, so ‹ › follows X's list. Unblocks #36897, #36898 (with #36894) and #36901.

  7. removed
    pm:dispatched
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions