Skip to content

Keep table search and filters fixed while columns scroll horizontally - #101564

Merged
JS00001 merged 25 commits into
Expensify:mainfrom
software-mansion-labs:war-in/fix-scrollable-table-header-elements
Sep 29, 2026
Merged

JS00001 merged 25 commits into
Expensify:mainfrom
software-mansion-labs:war-in/fix-scrollable-table-header-elements

Conversation

@war-in

@war-in war-in commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Tables with an in-list filter bar now scroll their columns in the FlashList scroller instead of an ancestor one, so the page header and filter bar stay pinned while the columns move. The column header moves from FlashList's sticky-row overlay into the list header. Adds a COLUMN_HEADER_PLACEMENT enum and fixes inconsistent aria-rowcount/aria-rowindex.

Fixed Issues

$ #101331
PROPOSAL:

Tests

Tests

Prerequisites (Tests 1 and 3)

  • A Control workspace with several members
  • On at least a few members, set long values for Custom Field 1 and Custom Field 2 (Workspace > Members > select member > Custom field 1 / Custom field 2), e.g. 40+ characters each. These add extra columns to the Members table, which is what makes it wider than its container
  • Switch the app language to Polish (Account > Preferences > Language > Polski). Its longer column labels and role names widen the table enough to overflow just above 1024px. In English the columns may still fit at that width
  • Note: at 1024px or narrower the table switches to the card layout (no columns, no horizontal scroll, no role="table"). Keep the browser window wider than 1024px for all steps below

Test 1 — the search input and filters stay fixed while the columns scroll

  1. On web, open Workspace > Members of the Control workspace from the prerequisites
  2. Narrow the browser window toward ~1030px (keep it above 1024px) until a horizontal scrollbar appears under the table
  3. Scroll the table sideways
  4. Verify the search input and the filter pills above the table stay in place and do not move sideways
  5. Verify the search input keeps its own width and does not stretch across the whole scroll range, and the filter pills stay next to it rather than being pushed off to the far right
  6. Verify the column header row (Member, Custom field 1, Custom field 2, Role, shown in Polish) scrolls sideways together with the columns it labels, staying aligned with the cells underneath
  7. Scroll the table down
  8. Verify the column header row sticks to the top of the table while the rows scroll under it, and that it has an opaque background (rows are not visible through it)
  9. Widen the window until the columns fit again
  10. Verify the horizontal scrollbar disappears and the column header still sticks to the top when scrolling down

Test 2 — tables whose columns fit are unchanged

  1. On web, open Workspace > Members in a maximized window, so all columns fit
  2. Scroll the table down
  3. Verify the column header row sticks to the top of the table as before, with no horizontal scrollbar and no sideways movement
  4. Repeat on Workspace > Categories and Workspace > Tags
  5. Verify the filter bar, search input, empty states and row selection all behave as they did before this PR

Test 3 — screen reader row numbering stays consistent

  1. On web, open Workspace > Members of the Control workspace from the prerequisites, in a maximized window
  2. Open devtools and inspect the element with role="table"
  3. Verify aria-rowcount equals the number of data rows + 1 for the header row
  4. Inspect the data rows and verify the first one has aria-rowindex="2", the second 3, and so on (index 1 is reserved for the header row)
  5. Narrow the window, keeping it above 1024px, until the columns overflow and a horizontal scrollbar appears (the header moves into the list header)
  6. Verify the element with role="table" is still present, and aria-rowcount and aria-rowindex still have the same values as in steps 3 and 4. The counts must not shift when the header changes placement

Offline tests

N/A — this PR only changes table layout and accessibility attributes. No API calls, data fetching or Onyx operations are involved.

QA Steps

Same as tests.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-09-18.at.14.34.20.mov

@codecov

codecov Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/index.ts 95.79% <ø> (ø)
src/components/Table/Table.tsx 91.60% <100.00%> (+0.36%) ⬆️
src/components/Table/TableContext.tsx 70.00% <ø> (ø)
src/components/Table/TableRow.tsx 86.11% <100.00%> (ø)
src/components/Table/TableSemanticContainer.tsx 100.00% <100.00%> (ø)
src/components/Table/buildTableListData.ts 100.00% <100.00%> (ø)
src/styles/utils/overflowXAuto/index.native.ts 100.00% <100.00%> (ø)
src/components/Table/TableHeader.tsx 94.56% <66.66%> (-0.95%) ⬇️
src/styles/utils/overflowXAuto/index.ts 0.00% <0.00%> (ø)
src/components/Table/TableBody.tsx 95.12% <78.26%> (-2.86%) ⬇️
... and 11 files with indirect coverage changes

@github-actions

Copy link
Copy Markdown
Contributor

🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@shawnborton

Copy link
Copy Markdown
Contributor

Hmm looks like everything above the Members table is now gone:
CleanShot 2026-09-21 at 11 06 20@2x

@war-in

war-in commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@shawnborton I accidentally pushed my local debug changes 😅 could you rerun the build? it should work fine this time

@shawnborton

Copy link
Copy Markdown
Contributor

Can do!

@github-actions

Copy link
Copy Markdown
Contributor

🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@shawnborton

Copy link
Copy Markdown
Contributor

Only minor thing: I wouldn't expect the table to scroll horizontally unless my mouse was over the horizontal scroll area... it feels weird that I can scroll horizontally when I am in the area for the search input/etc. Curious what @Expensify/design thinks.

CleanShot.2026-09-21.at.12.37.41.mp4

@dannymcclain

Copy link
Copy Markdown
Contributor

I wouldn't expect the table to scroll horizontally unless my mouse was over the horizontal scroll area... it feels weird that I can scroll horizontally when I am in the area for the search input/etc.

Big agree. That feels really odd.

@war-in

war-in commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

@shawnborton @dannymcclain that was the hard one, but we got this 🎉
Could you rebuild and try again? 🙏

@shawnborton

Copy link
Copy Markdown
Contributor

Nice! On it 🚀

@github-actions

Copy link
Copy Markdown
Contributor

🚧 shawnborton has triggered a test Expensify/App build. You can view the workflow run here.

@war-in

war-in commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

@Krishna2323 review addressed 🫡

@Krishna2323

Copy link
Copy Markdown
Contributor

@war-in TS check failing

@war-in

war-in commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@Krishna2323 fixed!

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

LGTM!

@war-in

war-in commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

@JS00001 PR's all yours!

@JS00001

JS00001 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

on it

Comment thread web/index.html
}

/* Hold a table's columns still while the pointer is on the filter bar pinned inside their scroller */
[data-table-column-scroller='true']:has([data-table-page-header='true']:hover) {

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.

why does this have to be a global change? That seems like it'd cause issues

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could go another way and use React state to track hover (instead of css) but it'd cause the list to re-render each time the header is hovered. I decided to use css here because it's only enabled when dataSet has tableColumnScroller set to true and should be harmless for the rest of the app

I'm happy to adjust it if you think rerender (or any other solution) would be better

Comment thread src/components/Table/TableContext.tsx Resolved
@war-in

war-in commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@JS00001 review addressed!

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

lgtm!

@war-in

war-in commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

Do we merge it @JS00001? 👀

@JS00001
JS00001 merged commit 47be229 into Expensify:main Sep 29, 2026
37 of 39 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.4.96-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 cancelled 🔪
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR fixes table layout so the search input, filters, and column header stay in place while columns scroll sideways, and it corrects screen reader row numbering. It adds no new feature, renames nothing, and makes no sentence in docs/articles incorrect.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.4.99-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR is a layout fix that keeps the table search and filters in place while the columns scroll sideways, so no sentence in an existing article becomes incorrect.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.99-2 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@Krishna2323

Copy link
Copy Markdown
Contributor

@war-in the test steps here led to a false bug report (#102613), so I think they need updating.

Test 1 asks testers to narrow to 900–1100px while keeping the wide layout, but below 1025px we switch to the card layout, which has no columns or horizontal scrollbar. Step 2 then asks them to narrow until a scrollbar appears, so they end up in a layout where it can't exist. That's exactly what happened in the Applause test.

The Members table also needs a Control workspace with long Custom Field 1 and 2 values to overflow, but that's missing from the prerequisites.

Test 3, step 5 has a similar issue: below 1025px, there's no role="table" element, so aria-rowcount is absent entirely.

Could you update the steps with the correct width range and workspace setup? Also, Test 1 jumps from step 8 to step 10.

@war-in

war-in commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

@Krishna2323 updated 🫡

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.

8 participants