Skip to content

fix(plugin-list): key the list's scroll memory without the record drawer's parameters - #38893

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-37029-list-back-scroll-key
Dec 1, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-37029-list-back-scroll-key

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread

Fixes #37029

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:在长列表里滚动后打开记录,再按浏览器后退,列表回到离开时的位置和已加载的行数,侧边抽屉开着时也一样;之前只有记录页自己的关闭按钮做得到。
  • 为什么做:列表页重做(列表住在地址里、滚动加载要恢复位置)的验收发现后退回到顶部。
  • 出错会怎样:最坏是后退回到列表顶部,或抽屉里的记录行没有自动滚到眼前;可以直接撤回,不影响数据。
  • 要你做什么:无。

What changes

A scroll-loaded list keeps its position, and the number of rows it held, in session storage under os:list-scroll: plus a key: the object name, then the address bar's path and query, read once when the list mounts. Browser Back failed to return there in two ways, both tied to the record drawer that opens over the list.

1. The key carried the drawer's parameters (ui/packages/plugin-list/src/ListView.tsx, the scrollRestoreKey initializer). The drawer adds ?recordId= (and ?recordObject=) without remounting the list. A record opened while the drawer was open leaves a history entry that carries the drawer. Back returned to that entry and computed a different key, so it missed the kept position: first window, top of the list. ✕ returns to the list's address without the drawer (app-shell listOriginOf) and found it. A list that first mounted under an open drawer lost its position on every return. The key now drops recordId and recordObject (app-shell's RECORD_DRAWER_PARAM / RECORD_DRAWER_OBJECT_PARAM) and keeps every other parameter, because those can change which rows the list shows.

2. The drawer's open-row scroll ran over the restored position (ui/packages/components/src/custom/record-list-face.tsx, useScrollActiveListRecordIntoView). On Back to a drawer-open entry, the grid restored scrollTop 1840, and about 17 ms later the drawer scrolled its record's row into view (scrollTop 72). Now:

  • A ListView mount that returns to a kept position marks its root with data-list-kept-position.
  • Inside a marked list, the open-row scroll skips the drawer's first record, as long as no other record has been opened since. The open-record store tracks that.
  • A row click, a step to another record, and a deep link with no kept position all scroll as before.
  • The attribute name is spelled in both files, because components cannot import plugin-list.

Governing ruling: #30850 letter A, "if it loads on scroll, the PR restores the batch or scroll position too". Zone answer A on the card (claim amendment 7308936914): Back restores what ✕ restores.

Read first (riskiest first):

  1. record-list-face.tsx: the store's isOnlyRecordOpened and the guard in useScrollActiveListRecordIntoView. This changes when the drawer scrolls the list.
  2. ListView.tsx: the scrollRestoreKey initializer and returnsToKeptPosition, the root mark.
  3. ui/packages/components/src/__tests__/record-list-face-37029.test.tsx: both sides of the guard.

Tests

  • ListView.backScrollKey-37029.test.tsx: 5 cases.
    • Key: Back to a drawer entry loads back the 120 rows kept under the plain address; a list mounted under the drawer hands the plain key; two filters stay two keys.
    • Root mark: present on a return to a kept position (drawer open or not); absent with no kept position or one kept at the top.
  • record-list-face-37029.test.tsx: 4 cases.
    • On a return, the drawer's record is not scrolled into view, including after its row remounts.
    • After the return, a step to another record scrolls, and so does the way back.
    • A fresh deep link still scrolls.
    • A row click scrolls.
  • Ablations, each through scripts/ablation-replace.mjs. Every mutation landed and was restored to the HEAD blob with an empty git diff HEAD.
    • Key: removing the two params.delete lines gives Tests 3 failed (3).
    • Guard: removing the guard line in useScrollActiveListRecordIntoView gives 2 failed | 2 passed; the deep-link and click cases stay green.
    • Store: removing the moved-on tracking gives 1 failed | 3 passed (the way back).
    • Root mark: removing it gives 1 failed | 4 passed.
vitest and type-check readings
  • pnpm --dir ui exec vitest run --maxWorkers=2 over the two new files plus ListView.infiniteRereadPageCap-35554, record-list-face-27545 and navigation-overlay-drawer-27545: Test Files 5 passed (5), Tests 31 passed (31). The verify lock reads command-exit 0.
  • pnpm --filter @object-ui/components type-check && pnpm --filter @object-ui/plugin-list type-check: command-exit 0. The new components test is in its tsconfig.test.json program (--listFiles: 1).
  • Not measured locally: the full components and plugin-list package suites. The run was stopped by a 560 s bound (exit 124) inside the foreground cap, so CI's Test UI is the reading.

Acceptance notes

  • Real app. Setup: showcase backend (--fresh) and the Vite console, Chromium 1243, 1280x800, a fresh context per run, showcase_inquiry with 133 rows. Each run scrolls to row 60 (scrollTop 1840, 100 rows) and reads [data-table-scroll-box]. Three runs each:

    Variant Before (197e3ff) After the key fix After both
    Drawer open over the list, name clicked, Back 0 / 50 rows, 0/3 72 / 100, 0/3 1840 / 100, 3/3
    Same, ✕ 3/3 3/3 3/3
    List mounted under the drawer, drawer closed, Back / ✕ 0/3 / 0/3 3/3 / 3/3 not re-run
    View switched first, Back 3/3 3/3 3/3
    No view switch, Back 3/3 3/3 3/3

    Intended uses after both, 3/3 each:

    • A fresh deep link to row 45 scrolls it into view (scrollTop 980), and the list is unmarked.
    • After the drawer-open Back, a step to the next record scrolls row 3 into view (scrollTop 108).
  • Switching views changes the path and remounts the list, so the key is read again. The lead about a query string that changes after mount does not reproduce for view switches; the drawer's ?recordId= is the query change that does.

  • Two string seams are spelled twice with no pin holding the copies equal: the drawer parameter names (plugin-list vs app-shell) and data-list-kept-position (plugin-list vs components). The current package barrels do not export them, and the barrels are outside this claim's surface.

  • No shared harness file exists for either component, so the pins are new files named for the card, reusing the existing stub patterns. The components test sits in src/__tests__/, the package's test directory.

Verification

  • Two-minute check: pnpm --dir ui exec vitest run packages/components/src/__tests__/record-list-face-37029.test.tsx packages/plugin-list/src/__tests__/ListView.backScrollKey-37029.test.tsx should print Tests 9 passed (9).
  • In the app:
    1. Open a list with 100+ rows and open one row in the side drawer.
    2. Scroll down and click another row's name.
    3. Press Back. Expected: the list is where you left it, with its rows loaded and the drawer reopened.
    4. Press the drawer's next-record arrow. Expected: the list scrolls to that row.

Generated by Claude Code

…wer's parameters

Browser Back from a record opened while the side drawer was open over the
list returned to an address carrying ?recordId=, whose scroll key missed the
position the list had kept; the record page's close button returns without
the drawer's parameters and found it.

Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7
Co-authored-by: Claude <noreply@anthropic.com>
…s parameters; changeset

Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7
Co-authored-by: Claude <noreply@anthropic.com>
… overridden by the drawer's open-row scroll

Back to a list entry whose record drawer was open restored the loaded rows
and the scroll position, then the drawer scrolled its open row into view over
it. The list marks a mount that returns to a kept position, and the open-row
scroll skips the drawer's first record there; a row click or a step to another
record scrolls as before.

Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7
Co-authored-by: Claude <noreply@anthropic.com>
…he drawer's open-row scroll

Claude-Session: https://claude.ai/code/session_01WGufzfcCk7a8bQdgyaxzu7
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7

Final head for review · 2026-12-01T11:52Z · zone osa-ux: 2cf4cc53 (PR #38893, Fixes #37029), draft, mergeable_state clean, check-runs 47 success / 17 skipped / 0 failed. 345 lines across 5 files, Clause-②: no, Metadata-protocol: none, not governed. Claim 7306455176 with amendment 7308936914 (adds record-list-face.tsx); os-dev reports: round 1 on the card, round 2 7310138725. The zone rewrote the PR body (relay issue_patch, read-back identical) from Part of to Fixes, since round 2 closes the QA shape.

Points to judge: (1) round 1: the scroll key in ListView.tsx drops the drawer's recordId / recordObject, so Back to a drawer-open entry finds the kept batch. (2) round 2: useScrollActiveListRecordIntoView skips the open-row scroll inside a list marked data-list-kept-position for the drawer's first record only; a row click, a record step and a deep link with no kept position scroll as before (pinned both sides, 3 ablations red). Real app, 3/3 each: QA shape back at 1840 with 100 rows and the drawer reopened; close; variants A and B; fresh deep link; step after Back. (3) Two string seams are spelled twice with no equality pin (drawer param names plugin-list vs app-shell; data-list-kept-position plugin-list vs components), because a shared constant needs package barrels outside the surface. Readings: /mnt/project-files/card-37029/.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzhGA3zoCFquQgku4pm

L1 review · PR #38893 (#37029) · head 2cf4cc5 · 2026-12-01T11:54Z

ACCEPT. The PR is not governed and is Clause-②: no. useScrollActiveListRecordIntoView gains an optional parameter, but the package index exports only ActiveListRecordProvider from record-list-face, so no published face widens. No L2 is owed, so the zone lands it.

What I checked:

  • l1-face.mjs --pr 38893: CLEAN, with 47 checks success and 0 failed or pending.
  • The scroll key (ListView.tsx). It drops only recordId and recordObject, and every other parameter still keys the list. The tests pin both exits (Back carrying the drawer, and a mount under an open drawer) and the two-filters-are-two-lists control. Positions kept under the old key are missed once after deploy, which is harmless because they live in session storage.
  • The open-row skip guard (record-list-face.tsx). It skips the scroll only when all three of these hold:
    • the store says this record is the first one opened and no other has been opened since;
    • the row sits inside [data-list-kept-position];
    • recordId is known.
  • Walking the cases:
    • Back to a drawer-open entry skips the scroll, so the kept position wins.
    • A step to another record sets movedOn, so it scrolls, and the way back scrolls too.
    • A fresh deep link has no marked root, so it scrolls.
    • Closing the drawer and clicking the same first row again skips the scroll. That is harmless, because the row is already in view where it was clicked.
    • The marker is written only when infiniteScroll holds and the kept top is above 0.
  • The two duplicated string seams. I judge them a nit, not blocking:
    • 'recordId'/'recordObject' in ListView.tsx copy app-shell's RECORD_DRAWER_PARAM/RECORD_DRAWER_OBJECT_PARAM. plugin-list cannot import app-shell, which is the right dependency direction.
    • data-list-kept-position is written in plugin-list and read in components. Each side's test pins its own literal.
    • A rename on one side would fail quietly, but only back to today's behaviour (Back lands at the top), never to a wrong record.
    • A cheap follow-up: an app-shell test that reads ListView.tsx's text and asserts it names RECORD_DRAWER_PARAM and RECORD_DRAWER_OBJECT_PARAM. It could ride along with a later app-shell card.
  • Scope. The 5 files are inside claim 7306455176 as widened by amendment 7308936914 (record-list-face.tsx). Fixes #37029 is right, because the card's Back case is delivered. The changeset reads true sentence by sentence.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-support-ai · os-support-ai · session_01WGufzfcCk7a8bQdgyaxzu7

Landing · 2026-12-01T11:55Z · zone osa-ux · head 2cf4cc53 · ACCEPT → PR #38893 comment 7310356130

reading value
check-governed-merges.mjs --pr 38893 NOT governed (0 of 5 paths on the register); 345 lines, card total under 3000; no L2 owed (the hook is not exported)
K read by hand (UI-only run): merge base ac97540f, 0 first-parent commits to origin/main (< 15)
check-runs at head 47 success · 17 expected skip · 0 failed · 0 pending; mergeable_state clean

State: ready + auto-merge; Fixes #37029 closes the card on merge. L1's nit (the two string seams) is not filed as a card; a rename only falls back to today's behaviour.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 1, 2026 11:56
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 0f2778c Dec 1, 2026
65 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37029-list-back-scroll-key branch December 1, 2026 12:23
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.

List page: browser Back from a record returns the scroll-loaded list to the top (the page's own ✕ restores it)

2 participants