Skip to content

Update table pages to scroll full page - #93877

Open
KJ21-ENG wants to merge 55 commits into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/92930-raising-flow
Open

Update table pages to scroll full page#93877
KJ21-ENG wants to merge 55 commits into
Expensify:mainfrom
KJ21-ENG:KJ21-ENG/92930-raising-flow

Conversation

@KJ21-ENG

@KJ21-ENG KJ21-ENG commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds headerComponent support to the shared Table so page-level controls (header content, buttons, search/filter bar) render inside the table's FlashList and scroll away with the rows, while the table column header is rendered as a sticky list item. Row render indexes and scrollToIndex callers remain aligned to the real table data, and sticky-header activation waits until the list has data to avoid the StickyHeaders load-time error.

All migrated table pages now use the table-owned header flow: Workspaces, Domains (list, admins, groups, members), Categories, Tags, Taxes, Members, Company Cards, Distance Rates, Per Diem, Rooms, Rules (personal rules and all workspace rules tabs), Agents, Expensify Cards, and report participants.

The table empty states (Table.EmptyState / Table.NoResultsState) render inside the scrolling list below the page header, so the page controls stay visible and usable when the table is empty or a search/filter matches nothing.

This PR also $ #95556: on native, focusing the table search bar now scrolls it above the keyboard (using the existing useScrollToFocusedInput pattern), so the input stays visible while typing in landscape.

Fixed Issues

$ #92930
PROPOSAL: #92930 (comment)
$ #95556

Tests

  1. Sign in with an account that has at least one workspace with enough rows to scroll (categories, tags, members, etc.).
  2. Open the Workspaces list. Verify the Workspaces/Domains tab row, the New workspace button, and the search bar scroll away with the rows, while the table column header sticks to the top of the list.
  3. Open Domains, Categories, Tags, Taxes, Members, Company Cards, the workspace Expensify Card list, Distance Rates, Per Diem, Rooms, the workspace Rules tabs, Settings > Rules, Settings > Agents, and a group chat's Members page with enough rows to scroll. Verify each page's controls scroll away with the rows while the column header sticks.
  4. On any table page, search for text that matches nothing. Verify the "no results" view appears below the still-visible search bar, and clearing the search restores the rows.
  5. Open a table page with no data (e.g. Categories on a new workspace). Verify the empty state renders below the page controls instead of replacing them.
  6. Verify search, filters, sorting, and row actions still target the correct rows. Duplicate a workspace and verify the list scrolls to the new workspace. Open a room, navigate back to the Rooms page, and verify the room row is highlighted.
  7. On Android native, rotate to landscape, open Workspaces, and tap the search bar. Verify the list scrolls the search input above the keyboard and it stays fully visible while typing.
  8. Refresh or directly deeplink to a workspace table page. Verify the app does not show the error boundary during the initial table load.
  9. Open Company Cards with no feed, a pending feed, and with cards. Verify the empty/pending states keep the fixed header buttons, and with cards shown the buttons scroll with the list.
  • Verify that no errors appear in the JS console

Offline tests

  1. Disconnect the network and repeat the table scrolling checks on a few pages.
  2. Verify the controls still scroll with the rows, the sticky column header remains usable, and the offline indicator does not overlap the table.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

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
611393262-bb275b7b-db8e-4386-b9f5-19de01001916.mp4
Android: mWeb Chrome
611381825-6fceb35a-5f11-4439-97cd-76fac7124bd9.mp4
iOS: Native
Screen.Recording.2026-06-23.at.12.49.39.AM.mov
iOS: mWeb Safari
VIDEO-2026-06-23-00-03-34.mp4
MacOS: Chrome / Safari
ezyZip.53.mp4

@KJ21-ENG
KJ21-ENG force-pushed the KJ21-ENG/92930-raising-flow branch from 265dd82 to e3d26d7 Compare June 17, 2026 20:20
@KJ21-ENG
KJ21-ENG marked this pull request as ready for review June 18, 2026 22:10
@KJ21-ENG
KJ21-ENG requested review from a team as code owners June 18, 2026 22:10
@melvin-bot
melvin-bot Bot requested a review from Krishna2323 June 18, 2026 22:10
@melvin-bot

melvin-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

@Krishna2323 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot requested review from trjExpensify and removed request for a team June 18, 2026 22:10
@codecov

codecov Bot commented Jun 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/components/Table/Table.tsx 96.72% <100.00%> (+1.16%) ⬆️
...ponents/Table/TableEmptyStates/TableEmptyState.tsx 90.90% <100.00%> (-9.10%) ⬇️
...components/Table/TableFilterBar/TableSearchBar.tsx 100.00% <100.00%> (ø)
src/components/Table/TableHeader.tsx 95.71% <100.00%> (-1.35%) ⬇️
src/components/Table/buildTableListData.ts 100.00% <100.00%> (ø)
src/components/Table/index.tsx 100.00% <ø> (ø)
...mponents/Tables/WorkspaceCategoriesTable/index.tsx 72.09% <100.00%> (ø)
...onents/Tables/WorkspaceCompanyCardsTable/index.tsx 64.39% <100.00%> (+1.11%) ⬆️
src/components/Tables/WorkspaceListTable/index.tsx 79.54% <100.00%> (ø)
.../components/Tables/WorkspaceMembersTable/index.tsx 31.63% <100.00%> (-0.70%) ⬇️
... and 42 more
... and 418 files with indirect coverage changes

Comment thread src/components/Table/TableBody.tsx Outdated
Comment thread src/components/WorkspaceListLayout.tsx Outdated
Comment thread src/components/Table/types.ts
@github-actions

Copy link
Copy Markdown
Contributor

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

Comment thread src/components/Table/TableBody.tsx Outdated
Comment thread src/components/Table/TableBody.tsx Outdated
Comment thread src/components/WorkspaceListLayout.tsx Outdated
@JS00001

JS00001 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor
image

The content scrolls behind the header, so we can see it

@shawnborton

Copy link
Copy Markdown
Contributor

Can we keep the border radius of the table header when we scroll? It looks like it turns into a squared edge:
CleanShot 2026-06-19 at 10 28 23@2x

@shawnborton

Copy link
Copy Markdown
Contributor

Otherwise feeling pretty good to me, very excited for this one!

trjExpensify
trjExpensify previously approved these changes Jun 19, 2026

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

Looks nice, good from product. 👍

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 1c0d498e4f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@KJ21-ENG
KJ21-ENG requested a review from Krishna2323 July 16, 2026 22:20
@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@Krishna2323 Kind ping here. Thanks!

@Krishna2323

Copy link
Copy Markdown
Contributor

re-reviewing today

@Krishna2323

Krishna2323 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Empty state content is not centred:

image

@Krishna2323

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 059f5d8bdd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

function buildTableListData<DataType extends TableData>(data: Array<TableRow<DataType>>, metadata: TableListMetadata): DataType[] {
return [
...(metadata.hasPageHeader ? [createSyntheticRow<DataType>(PAGE_HEADER_KEY)] : []),
...(metadata.shouldRenderStickyHeader ? [createSyntheticRow<DataType>(TABLE_HEADER_KEY)] : []),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve ListEmptyComponent when sticky headers are enabled

When a table opts into shouldUseStickyColumnHeader and supplies a ListEmptyComponent without a page header, this synthetic table-header row makes the FlashList data non-empty even when there are no real rows. TableBody stays mounted for ListEmptyComponent in that empty case, but FlashList will never render it because data.length is now 1, and TableHeader itself returns null for empty data, leaving a blank table instead of the caller's empty view. Consider suppressing the sticky header for empty data or rendering the list-empty content as a synthetic row in this path too.

Useful? React with 👍 / 👎.

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.

Good catch — fixed in b976f00. Empty tables with a sticky header and no page header now render ListEmptyComponent as a synthetic row, and I added coverage for this case.

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

Can we migrate RulesAgentsTab too?

Comment thread src/components/Table/TableBody.tsx Outdated

KJ21-ENG commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

@luacmartins Done — RulesAgentsTab is migrated now too. I also fixed the empty-state centering issue.

luacmartins
luacmartins previously approved these changes Jul 22, 2026
Comment thread src/components/Table/TableBody.tsx Outdated
@Krishna2323

Copy link
Copy Markdown
Contributor

@KJ21-ENG, please resolve the conflicts and check this comment. Let's try to avoid any kind of workaround here, please.

@Krishna2323

Copy link
Copy Markdown
Contributor

@KJ21-ENG the empty state floats over the header/input when keyboard appears:

Monosnap.screencast.2026-07-27.17-16-18.mp4

1 similar comment
@Krishna2323

Copy link
Copy Markdown
Contributor

@KJ21-ENG the empty state floats over the header/input when keyboard appears:

Monosnap.screencast.2026-07-27.17-16-18.mp4

@JS00001

JS00001 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Lets push to get this one in please, our tables feel pretty wonky with the minimum scroll they currently have

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

Sure, investigating this new bug mentioned by Krishna. will be fixed shortly.

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@KJ21-ENG the empty state floats over the header/input when keyboard appears:

Monosnap.screencast.2026-07-27.17-16-18.mp4

@Krishna2323 Fixed in 8299f00

Apologies I missed this as I generally do test in a simulator, and in this case, on-screen keyboard was not opened when I tested. So, I missed this bug.

The blank space was caused by the empty state using a flex-growing footer. While fixing it, we also found that the no-results transition could remount the search input, briefly closing and reopening the keyboard. We now keep the same list/header/input mounted and render the empty state in the normal list flow. Both issues are fixed and verified on iOS.

cc: @JS00001

Simulator.Screen.Recording.-.iPhone.17.-.2026-07-28.at.01.24.07.mov

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.

6 participants