Skip to content

docs(specs): windowed Table row-number columns fit their last logical position - #10666

Merged
humbertovirtudes merged 1 commit into
mainfrom
spec/table-windowed-row-number-floor
Nov 8, 2026
Merged

humbertovirtudes merged 1 commit into
mainfrom
spec/table-windowed-row-number-floor

Conversation

@humbertovirtudes

@humbertovirtudes humbertovirtudes commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Can a windowed Table size its row-number column to fit its last row number?

component:Table FR13, PR3 and DEC-2 say that virtualization and row data never change a column floor, and useTableRowIndex authors a 48px number column. In the default theme, a four-digit number does not fit in 48px. So when row 1,000 mounts in a windowed table, the number either clips, or the module's fixed-content check (module:Table/useTableRowsVirtualization FR14 and AR5) falls back to full rendering mid-scroll. In a 10,000- or 100,000-row table, that fallback renders every row.

Existing authority searched

Decision

The change applies only while Table.virtualization windows a table. A recognized row-index cell consumer, such as the useTableRowIndex column, keeps at least its authored width. It widens to fit the last position, which is the logical row count, in the column's own font and padding at the active density. "Recognized row-index cell consumer" is the record's existing Public-concepts term. Table cannot tell that a caller's own renderCell shows positions, so other columns are out of scope.

  • Timing: Table measures that width in its first client layout pass and again whenever the logical row count or the column's font or padding changes, before a wider position paints. A mounted position never clips, and windowing never falls back mid-scroll because a longer number mounts. That includes an append that crosses a digit boundary while the reader is scrolled to the end. Padding covers density and the host inset: the first column's start padding follows the host's container edge, so closing a start panel can change it with no font, theme or density change.
  • Server and client (PR3): server output and the first client render use the authored width, so hydration matches. Table measures the floor in its first client layout pass and again on the same triggers.
  • Inputs: only the last position, measured in the column's own font and padding. Row values, other content, sorting and loading state still change no floor.
  • Pinned columns: a pinned column after a widened row-number column keeps its inline start at the end of the columns before it, so it never overlaps the wider column.
  • Unchanged: ordinary tables keep the authored 48px column. Every other column keeps its authored floor. Explicit startFrom and legacy offsets still take the full-render fallback (Public concepts, FR20). The module's fixed-content check (module FR14 and AR5) still guards everything else.
  • Owner: component:Table, FR13 and DEC-2.

Record changes:

  • Compatibility and migration: the retained width compatibility bullet names the exception (explicit widths remain unchanged, except the windowed row-index consumer under FR13).
  • FR13: one exception sentence and its reason. The evidence-state cell adds that the windowed floor awaits implementation evidence.
  • PR3: the static-resolution guarantees are unchanged. The windowed floor is named as the one exception: server output and the first client render use the authored width, and Table measures the floor in its first client layout pass and again whenever the logical row count or the column's font or padding changes, before a wider position paints.
  • Verification map (FR13, PR3): the windowed floor's evidence: each density's first overflow of the default 48px column (compact row 10,000, balanced row 1,000, spacious row 100), an append from 999 to 1,000 rows while scrolled to the end, re-measurement after a font, theme, density or host-inset change, a pinned column after a widened row-number column (an overlap fails), and the failure signals.
  • DEC-2: the same exception, with the same scope term and triggers, and the reason: windowing must never clip a mounted position or fall back to full rendering mid-scroll. DEC-2 keeps its Decider line and its Rejected: line; the approving owner's approval binds the amended text.

module:Table/useTableRowsVirtualization needs no change. FR9 already admits row indexing, PR2 already allows shared observation for font, theme and geometry changes, and FR14 and AR5 stay the fallback for any other overflow. None of them contradicts the amended FR13.

Rejected alternatives

  • One wider fixed column for every table (for example, 72px): this changes released ordinary tables, whose floors stay unchanged without virtualization (Compatibility and migration), and it wastes width in short tables.
  • Widen every table, windowed or not, when its count reaches 1,000: this changes released default output without the opt-in.
  • Compute the width from a per-digit constant for each density: cell padding and the code font come from theme tokens and density, which a constant cannot know, so a theme with wider digits or padding would still clip or fall back.
  • Measure each number only after its row mounts: the width would change mid-scroll, after a clipped number has already shown.
  • Keep 48px and accept the fallback: a 10,000-row windowed table renders every row at row 1,000, which defeats the module's structural bound (module PR1).
  • Clip or truncate the number: module DEC-2 and AR5 reject silent clipping, and a clipped row number misstates the row's position.

Claim scope and non-goals

  • Covered: only the floor of a recognized row-index cell consumer, and only while the table is windowed.
  • Not covered: the useTableRowIndex API, the header label's width, other plugins' columns, the 60px and 120px floors, density definitions, and the module's fixed-content fallback.
  • No change to module:Table/useTableRowsVirtualization.
  • DEC-2's Rejected: line still applies. The floor of ordinary columns is never derived from rendered or sampled row content. The windowed exception measures only the last position's text, in the row-number column's own font and padding.

Evidence and implementation relationship

  • Implementation: feat(Table): window fixed-height flat tables through useTableRowsVirtualization #8280 and feat(Table): window tables that use selection and row index #10658 widen the windowed row-number column. While a table is windowed, Table measures the last position's text with text metrics from the cell's computed font and padding, with no extra layout read. It does so in the first client layout pass and again whenever the row count or the column's font or padding changes, host inset included. Pinned columns after the row-number column carry the extra width in their sticky offsets.
  • The amended FR13 evidence state says the windowed floor awaits implementation evidence. The verification row names the evidence that proves it: row-index unit tests, and a real-browser windowing check. That check covers each density's first overflow of the default 48px column, an append from 999 to 1,000 rows while scrolled to the end, re-measurement after a font, theme, density or host-inset change, and a pinned column after a widened row-number column keeping its inline start at the end of the columns before it.
  • This PR changes no code, and its text is valid on its own.

Writing rubric results

  • R1 narration: none. The search for proposes, decided, previously, now and history finds none in the added text. The exception and its reason are present-tense statements about the system: "windowing never clips a mounted position or falls back mid-scroll" in FR13, and "because windowing must never clip a mounted position or fall back to full rendering mid-scroll" in DEC-2.
  • R2 research in the record: none. The alternatives stay in this description.
  • R3 evidence naming a change: none. The new evidence-state clause says the floor "awaits implementation evidence", and the verification row names test files and a real-browser check, not pull requests.
  • R4 rejected alternatives over one line or outside a decision: DEC-2 keeps its one existing Rejected: line inside the decision. No new rejected alternative enters the record.
  • R5 pull request or issue references remaining: none. A search for # followed by digits, /pull/ and /issues/ finds nothing in the record.
  • R6 ruled open questions still listing options: none. "Open questions: None." is unchanged.

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. (The record names the public Table.virtualization prop and useTableRowIndex hook. It states when the floor applies, first client layout pass versus server and first render, because hydration and mid-scroll stability depend on that timing; it does not name how Table measures.)
  • 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 Meta context.

Validation

  • pnpm check:knowledge (node scripts/check-knowledge.mjs): "Knowledge templates and records are aligned."
  • Prettier --check docs/specs/components/Table/Table.spec.md: passes. Every edited table row keeps its column widths, so no other row is re-padded.
  • git diff --check origin/main...HEAD: clean.
  • pnpm specs:for --diff origin/main: routes component:Table and its linked records, plus the global claims for its accessibility, behavior, layout, public-api and theming triggers. No added line routes a further claim, and the change touches no API report, source or theme.

This PR was generated with AI assistance (Navi).

@vercel

vercel Bot commented Nov 8, 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 8, 2026 11:45am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 8, 2026, 11:53 AM UTC

@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.

This spec change needs an engineering owner's decision: it intentionally amends component:Table FR13, PR3 and DEC-2, which today say that virtualization never changes a column floor and that floors resolve without DOM measurement. An engineering owner settles whether a windowed table's row-number column may widen past its authored 48px to fit the last row position, measured in the first client layout pass, and records that by commenting /approve-spec followed by this head's full commit SHA (the author may do so as an engineering owner).

Two fixes are needed either way:

  • FR13, DEC-2 and the PR3 exception say only that Table measures the width in its first client layout pass, while the FR13/PR3 verification row fails a column that does not re-measure after a font, theme or density change; state when the floor re-resolves (row-count, font, theme and density changes, before a wider position paints) and add an append that crosses a digit boundary to the verification row.
  • "A column of logical row positions, like the useTableRowIndex column" leaves open which columns qualify, although Table cannot detect a custom column that shows positions and the description scopes other plugins' columns out; name the class with the existing Public concepts term, "a recognized row-index cell consumer, such as the useTableRowIndex column".

A smaller point: "past row 999 in each density" in the verification row reaches the overflow point only at balanced density, since with the current padding a compact column first overflows at row 10,000 and a spacious one at row 100.

[Automated review]

@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.

This spec change needs an engineering owner's decision before it can be approved: it intentionally amends component:Table FR13, PR3 and DEC-2, which today say that virtualization never changes a column floor and that floors resolve without DOM measurement or observers. An engineering owner settles whether a windowed table's row-number column may widen past its authored 48px to fit the last row position, measured in the first client layout pass and re-measured as its inputs change, and records that by commenting /approve-spec followed by the full head commit SHA (the author may do so as an engineering owner).

One fix is needed either way:

  • FR13, the PR3 exception and DEC-2 re-measure only when the row count, font, theme or density changes, but the number column is usually the first column, whose start padding follows the host's inset (the container-edge styles in table.stylex.ts), so closing a Layout start panel under padding={6} moves that padding from 16px to 24px with none of those changes and drops windowing; re-measure "whenever the logical row count or the column's font or padding changes" in all three places and add a host-inset change to the verification row.

Smaller points: the windowed check could include a pinned row-number column, since pinned offsets come from the static floor resolver today, and the Compatibility bullet that says explicit widths remain unchanged could name the windowed exception.

[Automated review]

… position

component:Table FR13, PR3 and DEC-2 gain one exception: in a table that
Table.virtualization windows, a recognized row-index cell consumer, such as
the useTableRowIndex column, keeps at least its authored width and widens to
fit the last position (the logical row count) in the column's own font and
padding at the active density. Table measures that width in its first client
layout pass and again whenever the logical row count or the column's font or
padding changes, before a wider position paints, so windowing never clips a
mounted position or falls back to full rendering mid-scroll. Server output and
the first client render use the authored width. Unwindowed tables and every
other column keep their authored floors; the retained width compatibility
bullet names the exception.

The FR13 evidence state and verification row name the evidence the new clause
needs: each density's first overflow of the default 48px column, an append
that crosses a digit boundary while scrolled to the end, re-measurement after a
font, theme, density or host-inset change, and a pinned column after a widened
row-number column that keeps its inline start at the end of the columns before
it.

This diff was generated with AI assistance (Navi).
Tags: ai-generated

@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.

This spec change needs an engineering owner's decision before it can be approved: it intentionally amends component:Table FR13, PR3, DEC-2 and the Compatibility width bullet, which today say that virtualization never changes a column floor and that floors resolve without DOM measurement or observers. An engineering owner settles whether a windowed table's row-index column may keep at least its authored 48px and widen to fit the last row position in its own font and padding, measured in the first client layout pass and re-measured before paint when the row count, font or padding changes, and records that by commenting /approve-spec followed by the full head commit SHA (the author may do so as an engineering owner).

No other change is required: padding from the host container is now a re-measurement input, and the verification row covers the host inset and a pinned column after the widened one.

One optional point:

  • Miss: DEC-2's closing "Rejected: deriving the floor from rendered or sampled content, because it shifts with data and view state" now follows an exception whose floor does shift with the row count and padding; scoping it to the other columns ("deriving any other column's floor ...") would remove that tension.

[Automated review]

Comment on lines +500 to +501
authored width. Rejected: deriving the floor from rendered or sampled content,
because it shifts with data and view state.

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 (missed in earlier reviews): this Rejected: reason, "because it shifts with data and view state", now follows an exception whose floor does shift with the row count and with padding, and it does not say the rejection covers only the other columns. Suggest scoping it:

-authored width. Rejected: deriving the floor from rendered or sampled content,
+authored width. Rejected: deriving any other column's floor from rendered or sampled content,

@humbertovirtudes

Copy link
Copy Markdown
Contributor Author

/approve-spec f92e00d

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 8, 2026
@humbertovirtudes
humbertovirtudes merged commit 289e7cf into main Nov 8, 2026
73 checks passed
@github-actions
github-actions Bot deleted the spec/table-windowed-row-number-floor branch November 9, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — f92e00d0 Deployed Nov 8, 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