Skip to content

Update table pages to scroll full page#93877

Open
KJ21-ENG wants to merge 43 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 43 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.55% <100.00%> (+1.20%) ⬆️
...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 41 more
... and 29 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
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. 👍

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@Krishna2323 All done, ready for another look 🙌

  • Resolved the conflicts by merging latest main. The table empty-state redesign (Standardize all table empty states #94705) rewrote the same composition this PR changes, so I re-applied the header-scroll pattern on top of the new architecture: when a table has a scrolling page header, Table.EmptyState/Table.NoResultsState now render inside the list below the header, so the page controls and search bar stay visible when the table is empty or a search matches nothing. Tables without a page header keep the default behavior.
  • Covered the newly migrated Agents table/page as well — the narrow-layout "New agent" button, subtitle, and search bar now scroll with the list while the column header sticks.
  • For Android - Workspaces - Searchbar is overlapped by keyboard in landscape mode. #95556 (per JS00001's comment): this PR already moves the search bar into the scrolling list, and I've also wired the existing useScrollToFocusedInput pattern into the table so focusing the search input scrolls it above the keyboard on native. Added it to the Fixed Issues section.
  • Added UI tests covering the in-list empty states, and updated the PR body/test steps to match the current scope. All checks are green.

@KJ21-ENG

KJ21-ENG commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@Krishna2323 One scope question: WorkspaceExpensifyCardsTable and ReportParticipantsTable also use the shared table component but still have the fixed (non-scrolling) header composition — they weren't in the original issue's page list, so this PR doesn't touch them. Want me to include them here as well ?

@shawnborton

Copy link
Copy Markdown
Contributor

I would say yes, as we want all tables to behave the same.

KJ21-ENG added 5 commits July 14, 2026 02:59
…ing-flow

# Conflicts:
#	src/components/Table/TableBody.tsx
#	src/pages/DynamicReportParticipantsPage.tsx
…ing-flow

# Conflicts:
#	src/components/Tables/AgentsTable/index.tsx
#	src/components/Tables/WorkspaceRoomsTable/index.tsx
@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@Krishna2323 @shawnborton Following up on the scope question — done ✅

  • Converted the last two tables per the design call: WorkspaceExpensifyCardsTable (+ WorkspaceExpensifyCardListPage) and ReportParticipantsTable (+ DynamicReportParticipantsPage). Every table under components/Tables now scrolls the full page with a sticky column header. For the Expensify Card page, the header buttons/feed selector stay fixed above the empty-card view (unchanged) and scroll with the rows when the table shows; for report participants, the invite/bulk-actions button now scrolls with the member list.
  • Merged latest main twice more along the way and reconciled with the new Table.LoadingState work (the Agents/Rooms loading skeletons are kept, with the page header rendered above them so the layout doesn't jump), the ButtonWithDropdownMenu prop migration, and the updated TableBody empty contract. Also updated the new company-cards table test mock to expose composeTableHeaderComponent.
  • Heads-up: main is currently failing ExportOnyxStateTest because the new areAgentsLoaded/arePolicyRoomsLoaded keys (from the LoadingState PR) aren't in the export buckets. I added them to the safe export keys here following the RAM_ONLY_COMPANY_CARDS_LOADING_STATE precedent so this PR's CI is green — happy to drop that commit if a separate fix lands on main first.

All checks are green and the branch has no conflicts. Ready for review 🙌

@shawnborton

Copy link
Copy Markdown
Contributor

Awesome, let's get this into final review @Krishna2323

@Krishna2323

Copy link
Copy Markdown
Contributor
  • App crashes on members page - Error: LayoutManager is not initialized, layout info is unavailable
Monosnap.screencast.2026-07-15.08-41-30.mp4

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

@Krishna2323 This happened because the merge-conflict resolution removed the FlashList initialization guard, allowing sticky headers to access LayoutManager before the first layout.
We restored the guard so sticky headers activate only after FlashList onLoad plus one animation frame, and added regression coverage.

@JS00001

JS00001 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

conflicts

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

working on it

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

Now working on solving new conflicts :)

@KJ21-ENG

Copy link
Copy Markdown
Contributor Author

Done!

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.

5 participants