Skip to content

Offer the bulk action bar on the remaining workspace tables - #105229

Open
Krishna2323 wants to merge 5 commits into
Expensify:mainfrom
Krishna2323:krishna2323/issue/98651-tables-bulk-action-bar
Open

Krishna2323 wants to merge 5 commits into
Expensify:mainfrom
Krishna2323:krishna2323/issue/98651-tables-bulk-action-bar

Conversation

@Krishna2323

@Krishna2323 Krishna2323 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Rolls out the floating bulk action bar to every full-page table that already supports bulk actions, following the pattern established by the Workspace Members table.

Each table accepts a bulkActionOptions prop and renders Table.BulkActionBar. Each page keeps its own header buttons visible in the wide layout, even when rows are selected.

Tables in the RHP are left unchanged, as are tables that support row selection but don't yet have bulk actions.

This is the third and final PR in the three-way split agreed on the issue:

Opting a table in requires two changes, following WorkspaceMembersTable:

/** The actions the selected rates support, offered in the floating bar the wide layout shows while rows are selected. */
bulkActionOptions?: Array<DropdownOption<WorkspaceDistanceRatesBulkActionType>>;

{!!bulkActionOptions && <Table.BulkActionBar options={bulkActionOptions} />}

On the page side, the header's "Selected" dropdown is now limited to shouldUseNarrowLayout && isMobileSelectionModeEnabled, and the same options are passed to the table. This keeps page-level buttons such as Add rate and More visible in the wide layout, regardless of the selection state, as agreed in the report view design thread.

Surfaces migrated:

  • Workspace > Taxes
  • Workspace > Per diem
  • Workspace > Distance rates
  • Workspace > Expensify Cards
  • Workspace > Report fields > List field values
  • Workspace > Tags
  • Workspace > Categories
  • Workspace > Vendors
  • Workspace > Agents
  • Settings > Agents
  • Settings > Rules
  • Workspace > Rules > Card restrictions
  • Workspace > Rules > Expense defaults
  • Workspace > Rules > Require fields
  • Workspace > Rules > Flag for review

Three pages needed more than a simple condition change because their options were created inside the same branch that rendered the dropdown. FieldsListValuesPage, WorkspaceCategoriesPage, and WorkspaceTagsPage now each have a getBulkActionOptions() function shared by the narrow dropdown and floating bar.

WorkspaceVendorsPage needed a similar change: VendorBulkActions was split into a useVendorBulkActionOptions hook and a thin component, allowing the page to access the options without rendering the button.

Not included:

  • Tables rendered in the RHP remain unchanged, as agreed in the design discussion. These include room members, report participants, the tag list view, and Add existing expense. @JS00001's original list included RoomMembersTable and DomainMembersTable, so please flag it if those should be included after all.
  • DomainMembersTable and WorkspaceCompanyCardsTable support row selection but don't currently have bulk actions. Adding actions would introduce new product scope, so they remain unchanged.

Three existing tests covered the wide-layout header dropdown being removed by this PR. They've been updated to open the floating bar instead, using the same openBulkActions helper as the Workspace Members test.

Fixed Issues

$ #98651
$ #101899
$ #104680

Proposal: N/A

Tests

The same flow applies to every surface, so follow these steps for each page in the table below.

  1. On a wide screen (web, desktop, or tablet in landscape), open the listed page.
  2. Select one row using its checkbox.
  3. Verify the floating bulk action bar slides up over the table, showing "1 selected", the available actions, and an X to clear the selection.
  4. Verify the page's own header buttons (Add…, More, etc.) remain visible and enabled. They must not be replaced by a "Selected" dropdown.
  5. Select all rows using the header checkbox and verify the count updates.
  6. If the bar has a More button, click it and verify the remaining actions appear in the menu.
  7. Run an action from the bar. Verify it applies to every selected row and clears the selection afterwards.
  8. Press Esc and verify the selection clears and the bar disappears.
  9. Click the bar's X and verify the selection clears in the same way.
  10. Narrow the window until the layout switches to narrow. Verify the floating bar disappears and the existing "Selected" dropdown in the header provides the bulk actions.
# Page Expected actions
1 Workspace > Taxes Delete, Disable rates, Enable rates
2 Workspace > Per diem Delete rates
3 Workspace > Distance rates Delete rates, Disable rates, Enable rates
4 Workspace > Expensify Cards Export as CSV
5 Workspace > Report fields > Any list field > Values Delete, Disable, Enable
6 Workspace > Tags Delete, Disable, Enable
7 Workspace > Categories Delete, Disable, Enable
8 Workspace > Vendors Enable vendors, Disable vendors
9 Workspace > Agents Delete
10 Settings > Agents Delete
11 Settings > Rules Edit (single selection only), Delete
12 Workspace > Rules > Card restrictions Delete
13 Workspace > Rules > Expense defaults Delete
14 Workspace > Rules > Require fields Delete
15 Workspace > Rules > Flag for review Delete

Regression checks

  1. On Workspace > Tags with a multi-level tag list, verify selection still works as before and the bar doesn't offer Enable/Disable, since those actions are only available for single-level tags.
  2. On Workspace > Tags or Categories, select all rows in a workspace where requiresTag or requiresCategory is enabled. Press Disable and verify the "You cannot disable all tags/categories" modal still appears.
  3. On Workspace > Vendors, select the default vendor and verify Disable isn't offered for it.
  4. On Workspace > Taxes or Categories with an accounting connection, verify Delete remains hidden.
  5. As a workspace member without write access to a feature, open its page and verify no checkboxes or floating bar appear.
  6. Open any RHP table with selection, such as a report's room members, report participants, or a tag list view. Verify it remains unchanged: no floating bar, and the header dropdown still offers the actions.
  7. On any page from the table above, click the "Select all" checkbox with the mouse, then press Esc. Verify the selection clears and the checkbox shows no blue border highlight.
  8. Repeat, but Tab to the checkbox and press Space to select, then press Esc. Verify the focus ring stays on the checkbox, since a keyboard user has to keep seeing where focus is.
  9. Repeat step 22 with a single row checkbox rather than "Select all".
  10. On Workspace > Company cards, select two cards, press Export as CSV from the bar, and verify the file downloads and the selection clears, the same as Search and the report view.
  11. Repeat on Workspace > Expensify Cards.
  • Verify that no errors appear in the JS console.

Offline tests

  1. Go offline.
  2. On Workspace > Categories, select two categories and click Disable in the floating bar.
  3. Verify the rows grey out with the pending style and the selection clears, as it did with the header dropdown.
  4. Go back online and verify the change persists.
  5. While still offline, verify the floating bar renders and its actions are pressable. The bar itself should not depend on connectivity.

QA Steps

Repeat the tests above.

  • 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
    • MacOS: Desktop
  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
web_chrome.mp4

Roll the floating bulk action bar out to every full-page table that already
had bulk actions, following the pattern the members table set. Each table
takes a bulkActionOptions prop and renders Table.BulkActionBar, and each page
keeps its own header buttons in the wide layout now that the actions live in
the bar.

Tables in the RHP are left alone, as are the tables that have row selection
but no bulk actions yet.

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...nents/BulkActionBar/useBulkActionBarFocus/index.ts 90.32% <100.00%> (+14.56%) ⬆️
...mponents/Tables/WorkspaceCategoriesTable/index.tsx 80.00% <100.00%> (+0.31%) ⬆️
...yCardsTable/WorkspaceCompanyCardsTableControls.tsx 96.29% <100.00%> (+29.62%) ⬆️
...onents/Tables/WorkspaceCompanyCardsTable/index.tsx 83.51% <100.00%> (+0.74%) ⬆️
...nents/Tables/WorkspaceDistanceRatesTable/index.tsx 72.94% <100.00%> (+0.32%) ⬆️
...ents/Tables/WorkspaceExpensifyCardsTable/index.tsx 82.56% <100.00%> (+0.16%) ⬆️
src/components/Tables/WorkspaceTagsTable/index.tsx 78.75% <100.00%> (+0.26%) ⬆️
src/pages/settings/Agents/AgentsPage.tsx 89.23% <100.00%> (+0.16%) ⬆️
...rc/pages/workspace/rules/PolicyRulesPageRevamp.tsx 79.22% <100.00%> (+0.48%) ⬆️
src/components/Tables/AgentsTable/index.tsx 0.00% <0.00%> (ø)
... and 26 more
... and 215 files with indirect coverage changes

Escape is itself what makes the focused element match , and
the browser applies that before the bar's handler runs, so asking the element
whether it already had a ring always answered yes and the suppression never
fired. Go by how the focus arrived instead, which Escape leaves untouched.

Fixes Expensify#104680

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Both tables already had bulk actions, so this is the same migration as the
rest: the floating bar takes them in the wide layout, and the header keeps
its own buttons.

Company cards builds its actions from inside the table rather than on the
page, so they move to a hook the bar and the narrow layout's dropdown share.
The selection they are built from is derived once in the table, so the two
cannot drift apart. The filter bar now stays visible while rows are selected,
since the floating bar no longer takes its place.

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Search and the report view both drop the selection as soon as an export
begins, and both say so where they do it. The two card tables kept theirs,
which the header dropdown hid but the floating bar makes plain. Bring them
into line.

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@Krishna2323
Krishna2323 marked this pull request as ready for review October 28, 2026 07:22
@Krishna2323
Krishna2323 requested review from a team as code owners October 28, 2026 07:22
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-28T08:59:39.418285Z
We couldn’t complete this review. Comment @codex review to try again.
606e660 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@melvin-bot
melvin-bot Bot removed the request for review from a team October 28, 2026 07:22
@melvin-bot

melvin-bot Bot commented Oct 28, 2026

Copy link
Copy Markdown

@shubham1206agra 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]

@Krishna2323

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ 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".

A page in the RHP is not a small screen, so a header gated on
isSmallScreenWidth kept its dropdown there while the bar, gated on
shouldUseNarrowLayout, stayed hidden. Narrowing those gates took the
dropdown away and left nothing in its place.

FieldsListValuesPage only ever renders in the RHP, so it goes back to how it
was. WorkspaceCategoriesPage renders in both, and now keeps the bar on the
full page and the dropdown in the RHP.

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@shubham1206agra

Copy link
Copy Markdown
Contributor

@Krishna2323 Conflicts

This branch has not been deployed

No deployments
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.

3 participants