Skip to content

docs(windowing): the shared engine's home is packages/core/src/virtualization - #10809

Draft
cixzhang wants to merge 1 commit into
mainfrom
cixzhang/windowing-engine-home
Draft

cixzhang wants to merge 1 commit into
mainfrom
cixzhang/windowing-engine-home

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Records only. People get the same windowing behavior in every long list, because the behavior the consumers share lives in one place: the list-windowing record now names the shared engine's home, packages/core/src/virtualization/, and the private internal entry Lab uses to reach it. It also requires that any change that swaps a windowing engine ships before-and-after timing and per-frame layout-correctness evidence, so an engine swap can't quietly bring back overlapping or mispositioned rows or janky scrolling.

This PR is based on main and takes the next free numbers after #10796 (which adds FR1–FR4, INV4, INV5 and DEC-2 to DEC-4 to the same file). It rebases after #10796 merges; FR5 cites #10796's INV5.

Exact decision needed

Where the shared windowing engine lives, how Lab reaches it, and what evidence an engine swap ships. The owner decided all three (DEC-5).

Existing authority searched

Decision

  • FR5: the shared windowing engine lives in packages/core/src/virtualization/. It isn't a package export. Table, the chat virtualizer and Selector import it from there, and windowing behavior they share lives there rather than in any one consumer. Lab reaches it only through Core's private internal entry, @astryxdesign/core/internal/virtualization, the same pattern as @astryxdesign/core/internal/scroll-anchoring. The engine size budget (INV5) and the swizzle shared-state checks measure that folder.
  • FR6: any change that swaps or replaces a windowing engine ships same-session before-and-after evidence: timing (frame time and long frames during scroll, mount and append cost) and per-frame layout correctness (every row within 1 px of an unwindowed reference, no overlap or gap, including after a text-scale change and inserts above the viewport; zero unprompted scroll jumps; anchored-row drift at most 1 px). A regression on any of these blocks the change.
  • DEC-5 quotes the owner's three dictated statements verbatim, decider cixzhang, 2026-11-09. "[move]" stays bracketed as a dictation fill-in.
  • FR5 gaps: the chat virtualizer has its own engine; Table's window math lives in packages/core/src/utils/ and its own plugin folder.
  • Owning code names the engine's home in place of "no path yet".

Rejected alternatives

  • None recorded. The owner gave one direction for each point; FR5 states that shared behavior does not live in any one consumer, and that the engine is not a public export.

Claim scope and non-goals

  • Only FR5, FR6, DEC-5, the two gap lines, the Owning code line, the Governing rules row and two Verification rows change.
  • Out of scope: which engine wins, the engine's API, OQ1, and what each consumer renders.

Evidence and implementation relationship

  • On main, packages/core/src/virtualization/ does not exist; Table's window math lives in packages/core/src/utils/listWindow.ts and packages/core/src/Table/plugins/virtualization/. The record names both as FR5 gaps. No code changes.
  • FR6's evidence source is the engine comparison harness (scenarios S1–S11), which is not in this repository; the Verification row names that as an evidence gap.

Writing rubric results

  • R1 narration: none. FR5, FR6 and DEC-5 state the system in the present tense; the quotes are the owner's words, kept verbatim.
  • R2 research in the record: none. No measurements or harness results appear.
  • R3 evidence naming a change: none. The new Verification rows name evidence, not a pull request.
  • R4 rejected alternatives over one line or outside a decision: none. The record has no Rejected: line.
  • R5 pull request or issue references remaining: none in the record.
  • R6 ruled open questions still listing options: none. OQ1 is unchanged.
  • Status phrases: the new lines add no build-status or sequencing phrase (checked with the status-phrase list from chore(knowledge): warn on temporary project status in records #10794); the existing ones are untouched.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal context.

Validation

  • pnpm check:knowledge: Knowledge templates and records are aligned.
  • pnpm specs:for --diff origin/main: reviewed.
  • Prettier, git diff --check: clean.

Owner and land path

Owner: the Astryx fix loop, lane 3. Lands after #10796 and then #10806 merge; Specs, CodeBunny and green CI; the drain merges.

…lization

FR5 names the engine's folder and Lab's private internal entry; FR6 requires same-session timing and layout-correctness evidence for an engine swap; DEC-5 quotes the owner.
@vercel

vercel Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 9, 2026 3:09pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 9, 2026
@astracat-bot

astracat-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 9, 2026, 3:38 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026
@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 8a7d6e6

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 9, 2026

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for recording where the shared windowing engine lives. The direction is approved at this head, but the record needs five fixes before it can merge.

  • FR5, FR6 and DEC-5 reuse the IDs that open #10806 assigns in this record to scroll-area attachment, so agree the order with #10806, renumber one side, and list #10806 as overlapping work.
  • FR5's Verification row relies on @astryx/no-core-internal-import to catch Lab importing the engine by another path, but that rule never runs on packages/lab/** and has no pattern for core/src/virtualization, so mark the Lab clause as an evidence gap or name a check that runs on Lab files.
  • FR5 cites "the engine size budget (INV5)", which only open #10796 defines, and "the swizzle shared-state checks", none of which measures a folder, so rebase onto #10796 (or declare the stack) and name the swizzle check by file and claim, or drop it.
  • FR5 says the chat virtualizer imports the engine from the Core folder while DEC-5 makes it Lab's ChatVirtualizer (now on main, so the chat gap line holds), which FR5 limits to the internal entry, so give it the internal-entry route and say whether Core's Chat message list stays a consumer.
  • Regression: #10795 has since rewritten the record's Contract at a glance table on main and this branch's Governing rules row edit now conflicts with it, so rebase onto main, keep main's table, consumer list and DEC-1 lines, and add DEC-5 to the Governing rules row.

Smaller points: the record still says Table's virtualization hook is "not built" and "has no code yet", and FR6 sets no timing tolerance for what counts as a regression. A new commit will need a fresh /approve-spec.

[Automated review]


## Requirements

- **FR5 — The engine's home.** The shared windowing engine lives in

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR5, FR6 and DEC-5 collide with #10806. Open #10806 assigns FR5 ("The owner owns the scroll box"), FR6 ("Attachment is a callback scrollRef or the page") and DEC-5 ("Virtualizers attach to the scroll area or the page") in this same record, also on top of #10796. Whichever lands second leaves two of each, and the citations at lines 34, 103-107, 122 and 168-169 point at two claims. Agree the order with #10806 and renumber one side (for example FR20, FR21 and DEC-6 here, after #10806's FR19 and DEC-5), and list #10806 as overlapping work.

`@astryxdesign/core/internal/virtualization`, the same pattern as Core's
`@astryxdesign/core/internal/scroll-anchoring` entry for Lab (`spec:AST-017`
FR21, `architecture:react-component-runtime` INV13); it is not a public
export. The engine size budget (INV5) and the swizzle shared-state checks

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INV5 and the swizzle checks don't resolve at this head. The record defines no INV5 here (it comes from open #10796, and no Stack: line ties this branch to it), and spec:AST-110's only shared-state check is sharedContexts.test.tsx for the shared-context module, which measures no folder. Rebase onto #10796 once it merges (or declare the stack), and name the swizzle check by file and claim or drop the clause.

Comment on lines +103 to +104
- **FR5 gap:** the chat virtualizer has its own engine and doesn't use the
shared one.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No chat virtualizer exists in this repository. The only one is in open #5461 (packages/lab/src/Chat/ChatVirtualizer.tsx), and lines 101-102 still say Chat renders every message. FR5 (line 62) also has the chat virtualizer importing from the Core folder, while DEC-5 (lines 149-150) makes it Lab's, which FR5 says uses only the internal entry. Drop this gap line until a chat virtualizer is in the repository, and have FR5 name one chat consumer and one route.

Comment on lines +105 to +107
- **FR5 gap:** Table's window math lives in `packages/core/src/utils/` and
Table's own virtualization plugin folder, not in
`packages/core/src/virtualization/`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this line is accurate (packages/core/src/Table/plugins/virtualization/useTableRowsVirtualization.ts exists and Core exports it), but lines 100-101 and 118 still say the hook is "not built" and "has no code yet". Updating them in this edit keeps the section consistent.

| INV1 | Review of each Core list that windows (evidence gap: no module or automated check exists yet) | A Core component keeps its own windowing implementation beside the module |
| INV2 | Public export review of every package entry point (evidence gap: no module exists yet) | The module, or a type only it uses, is reachable from a public entry point |
| INV3 | The public-API report for `useTableRowsVirtualization` and each consumer (evidence gap: the hook is not built yet) | Adopting the module changes a consumer's public props, types, or exports |
| FR5 | Import review of each windowing consumer; the `@astryx/no-core-internal-import` lint rule for Lab's import of the internal entry | A consumer keeps shared windowing behavior outside the engine's folder, Lab imports the engine by another path, or a public entry point exports it |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check can't see Lab. eslint.config.js turns @astryx/no-core-internal-import off for packages/lab/** (line 311), and the rule only reports @astryxdesign/core/internal* and core/src/{internal,gestures,motion,touch-support} paths, so a Lab file importing ../../core/src/virtualization/… passes. Mark the Lab clause "(evidence gap: no check limits Lab to the internal entry)" or name a check that runs on Lab files.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 8a7d6e6

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 29 rows, core 36 rows, theme-butter 1 row, theme-y2k 1 row; run pnpm api:report.

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

This branch was successfully deployed

1 active deployment
Preview — 8a7d6e65 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant