Skip to content

fix(mobile): expand a long table instead of scrolling it in place - #869

Merged
huichen merged 1 commit into
mainfrom
fix/table-rows
Sep 26, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/table-rows

Conversation

@huichen

@huichen huichen commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

What

A markdown table with more than 20 rows no longer hides its tail behind an inner scroll list. It paints the first 20 rows and puts the rest behind an explicit control under the table; tapping it paints every remaining row inline, and the list around the table scrolls them.

Reported against a 50-row REVISIONS.md preview: the table claimed "共 50 行 · 在表格内上下滑动查看其余行", and swiping inside the table never moved it — rows 21+ were unreachable.

Why the viewport could not work

The bounded viewport was a 360dp vertical FlatList nested inside the horizontal table scroller, inside the vertical list that carries the message/document. On the phone the vertical drag belongs to the outer list, which takes the move before the nested list ever sees one, so the inner list sat motionless while the document scrolled. This is the same failure the long code block was fixed for in #713 ("a nested vertical viewport that loses the pan gesture to the message list"); the table kept that construction. Horizontal panning of a wide table is untouched — a sideways drag is not contended for, which is why the table stays inside its own horizontal scroller.

Fixing it by making the nesting work would mean nested-scroll participation on every list a message can appear in (chat timeline, file preview), and would still leave the reader with a 360dp window onto the table. Painting the rows in the surrounding list removes the dependency instead.

Behaviour

  • ≤ 20 rows: unchanged — the whole table paints inline, no control.
  • > 20 rows: first 20 rows, then a 44dp control reading "共 50 行 · 点击展开全部" / "All 50 rows — tap to show every row"; tapping toggles between that and "收起表格" / "Collapse table". The control sits outside the horizontal scroller so it stays on screen when the table is wider than the phone.
  • 5000-row tables still mount a bounded head (not every row) until the reader asks.

Verification

  • mobile: tsc --noEmit, eslint, full jest --runInBand — 128 suites / 2074 tests pass.
  • New assertions were falsified once: with the row slice removed the test fails on the collapsed table.
  • make check-docs (renamed/updated the stale claim in docs/archives/verification/remaining-performance-2026-09-16.md, both languages).

Note on what was not verified: the harness (headless Chrome / react-native-web) scrolls nested containers natively and cannot reproduce a native pan-gesture conflict, which is how the broken viewport shipped green. The fix removes the gesture dependency rather than re-testing it, so the assertions here cover what the component paints and what the control does, not on-device touch behaviour.

A table with more than 20 rows kept the rest behind a fixed 360dp inner list.
That viewport did not scroll on the phone: the vertical drag belongs to the
list the table sits in, which takes the move before the nested list sees it, so
the promise printed under the table ("scroll inside the table to see the rest")
was false and rows 21+ could not be reached at all — the same nested-viewport
failure the long code block was fixed for in #713.

Paint the first 20 rows and put the rest behind an explicit control, which
paints every remaining row inline and lets the surrounding list scroll them.
The horizontal scroller stays: a wide table still pans sideways.
@huichen
huichen enabled auto-merge (squash) September 26, 2026 07:14
@huichen
huichen merged commit d820484 into main Sep 26, 2026
12 checks passed
@huichen
huichen deleted the fix/table-rows branch September 26, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant