Skip to content

Implement bulk change approver flow for Search page v2#77857

Open
QichenZhu wants to merge 30 commits intoExpensify:mainfrom
QichenZhu:feat/bulk-change-approver-v2
Open

Implement bulk change approver flow for Search page v2#77857
QichenZhu wants to merge 30 commits intoExpensify:mainfrom
QichenZhu:feat/bulk-change-approver-v2

Conversation

@QichenZhu
Copy link
Contributor

@QichenZhu QichenZhu commented Dec 17, 2025

Explanation of Change

Fixed Issues

$ #75220
$ #77372
PROPOSAL:

Tests

Same as QA Steps.

  • Verify that no errors appear in the JS console

Offline tests

N/A.

QA Steps

Preconditions

  1. Create three accounts: A, B, and C.
  2. Account A has three Control plan workspaces with Submission frequency set to Manually and Add approvals enabled.
  3. Account A has submitted one expense in each of the three Control workspaces.
  4. Account B is a member of all three Control workspaces and can approve.
  5. Account C is a member of only one of the three Control workspaces.
  6. Create two additional non-Control workspaces (NonControl-1 and NonControl-2) with Add approvals enabled, and have Account A submit one expense in each.

Test 1: Bulk Add Approver

  1. Go to Reports → Reports.
  2. Open the Workspace filter and select the three Control workspaces, then tap Apply.
  3. Select any two of the reports created in the Preconditions.
  4. Tap “2 selected → Change approver.”
  5. Tap “Add approver → Change approver.”
  6. Select Account B and save.
  7. Verify the Action column for those two reports no longer shows Approve.

Test 2: Bulk Bypass Approver

  1. Select all three reports created in the Control workspaces.
  2. Tap “3 selected → Change approver.”
  3. Tap “Bypass approvers → Change approver.”
  4. Verify the Action column for all three reports shows Approve.

Test 3: Account C Visibility Rules

A. Multi-policy selection (C should NOT appear)

  1. With all three Control workspaces filtered, select two or more reports across different workspaces.
  2. Tap “X selected → Change approver.”
  3. Tap “Add approver → Change approver.”
  4. Verify Account C does not appear.

B. Single-policy selection (C may appear)

  1. Filter to only the Control workspace where Account C is a member.
  2. Select the report from that workspace.
  3. Tap “1 selected → Change approver.”
  4. Tap “Add approver → Change approver.”
  5. Verify Account C appears only if C can approve the report and is not already the approver.

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

  1. Filter to NonControl-1 only.
  2. Select its report.
  3. Tap “1 selected → Change approver.”
  4. Tap “Add approver → Change approver.”
  5. Verify you are redirected to the workspace upgrade screen for NonControl-1.
  6. Navigate back and verify no changes were applied.

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

  1. Filter to NonControl-1 and NonControl-2.
  2. Select one report from each.
  3. Tap “2 selected → Change approver.”
  4. Tap “Add approver → Change approver.”
  5. Verify you are redirected to the general workspace upgrade screen.
  6. Navigate back and verify no changes were applied.

Test 6: Mixed State Skip Behavior

  1. Select one report already assigned to Account A and one report not assigned to A.
  2. Tap “X selected → Change approver → Bypass approvers → Change approver.”
  3. Verify the report already assigned to A remains unchanged and the other report changes to A.
  • 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 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

Test 1: Bulk Add Approver

android-native-1.webm

Test 2: Bulk Bypass Approver

android-native-2.webm

Test 3: Account C Visibility Rules

android-native-3.webm

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

android-native-4.webm

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

android-native-5.webm

Test 6: Mixed State Skip Behavior

android-native-6.webm
Android: mWeb Chrome

Test 1: Bulk Add Approver

android-web-1.webm

Test 2: Bulk Bypass Approver

android-web-2.webm

Test 3: Account C Visibility Rules

android-web-3.webm

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

android-web-4.webm

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

android-web-5.webm

Test 6: Mixed State Skip Behavior

android-web-6.webm
iOS: Native

Test 1: Bulk Add Approver

ios-native-1.mov

Test 2: Bulk Bypass Approver

ios-native-2.mov

Test 3: Account C Visibility Rules

ios-native-3.mov

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

ios-native-4.mov

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

ios-native-5.mov

Test 6: Mixed State Skip Behavior

ios-native-6.mov
iOS: mWeb Safari

Test 1: Bulk Add Approver

ios-web-1.mov

Test 2: Bulk Bypass Approver

ios-web-2.mov

Test 3: Account C Visibility Rules

ios-web-3.mov

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

ios-web-4.mov

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

ios-web-5.mov

Test 6: Mixed State Skip Behavior

ios-web-6.mov
MacOS: Chrome / Safari

Test 1: Bulk Add Approver

mac-web-1.mov

Test 2: Bulk Bypass Approver

mac-web-2.mov

Test 3: Account C Visibility Rules

mac-web-3.mov

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

mac-web-4.mov

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

mac-web-5.mov

Test 6: Mixed State Skip Behavior

mac-web-6.mov

@melvin-bot
Copy link

melvin-bot bot commented Dec 17, 2025

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov
Copy link

codecov bot commented Dec 17, 2025

Codecov Report

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

Files with missing lines Coverage Δ
src/CONST/index.ts 93.60% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/ROUTES.ts 16.00% <ø> (ø)
src/SCREENS.ts 100.00% <ø> (ø)
...ections/Search/ActionCell/actionTranslationsMap.ts 100.00% <ø> (ø)
src/libs/API/types.ts 100.00% <ø> (ø)
...avigation/linkingConfig/RELATIONS/SEARCH_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 75.00% <ø> (ø)
src/libs/SearchUIUtils.ts 70.01% <100.00%> (+0.03%) ⬆️
src/pages/ReportChangeApproverPage.tsx 0.00% <ø> (ø)
... and 6 more
... and 8 files with indirect coverage changes

@QichenZhu
Copy link
Contributor Author

@Krishna2323 I'm having trouble making the React Compiler check happy.

Failed to compile 1 added files with React Compiler:

src/pages/Search/SearchChangeApproverPage.tsx:106:39
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
src/pages/Search/SearchChangeApproverPage.tsx:153:8
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly

The error messages are quite technical to me and I can't tell if they mean a good thing or bad thing. The guide doesn't cover them.

src/pages/Search/SearchAddApproverPage.tsx:176:28
Found a manual memoization usage of useCallback. Newly added React component files must not contain any manual memoization and instead be auto-memoized by React Compiler. Remove useCallback or disable automatic memoization by adding the "use no memo"; directive at the beginning of the component and give a reason why automatic memoization is not applicable.

The files above failed the React Compiler compliance check. Do not remove any manual memoization patterns, unless a file is already able to compile with React Compiler. You can use the "React Compiler Marker" VS Code extension to check whether a file is being compiled with React Compiler.

However, the plugin shows the components are optimized by React Compiler successfully.

What do I need to do to fix them?

cc @marcaaron

@QichenZhu QichenZhu changed the title Implement bulk change approver flow for Search page v2 [WIP] Implement bulk change approver flow for Search page v2 Dec 18, 2025
@QichenZhu QichenZhu marked this pull request as ready for review December 18, 2025 10:06
@QichenZhu QichenZhu requested review from a team as code owners December 18, 2025 10:06
@melvin-bot melvin-bot bot requested review from Krishna2323 and joekaufmanexpensify and removed request for a team December 18, 2025 10:06
@melvin-bot
Copy link

melvin-bot bot commented Dec 18, 2025

@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 removed the request for review from a team December 18, 2025 10:06
@QichenZhu
Copy link
Contributor Author

@Krishna2323 I still need to do more testing. Feel free to do a preliminary review if you want.

return null;
}

const {avatar} = personalDetails?.[accountID] ?? {};
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ PERF-4 (docs)

Objects and functions passed as props should be properly memoized to prevent unnecessary re-renders.

The allApprovers array is computed by calling getAllApprovers() on every render without memoization. This creates a new array reference each time, causing the ApproverSelectionList component to re-render unnecessarily even when the underlying data hasn't changed.

Suggested fix:

const allApprovers = useMemo(() => getAllApprovers(), [
    selectedReports,
    allPolicies,
    allReports,
    personalDetails,
    formatPhoneNumber,
    translate,
    icons.FallbackAvatar,
    selectedApproverEmail,
]);


return isPolicyAdmin(policy) && isAllowedToApproveExpenseReport(report, currentUserDetails.accountID, policy);
});

Copy link
Contributor

Choose a reason for hiding this comment

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

❌ PERF-4 (docs)

Objects and functions passed as props should be properly memoized to prevent unnecessary re-renders.

The approverTypes array is computed by calling getApproverTypes() on every render without memoization. This creates a new array reference each time, causing the SelectionList component to re-render unnecessarily even when the underlying data hasn't changed.

Suggested fix:

const approverTypes = useMemo(() => getApproverTypes(), [
    selectedReports,
    allPolicies,
    onyxReports,
    currentUserDetails.accountID,
    selectedApproverType,
    translate,
]);

if (!report) {
return false;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

❌ PERF-4 (docs)

Objects and functions passed as props should be properly memoized to prevent unnecessary re-renders.

The confirmButtonOptions object is created on every render without memoization. This creates a new object reference each time, causing the SelectionList component to re-render unnecessarily even when the underlying data hasn't changed.

Suggested fix:

const confirmButtonOptions = useMemo(() => ({
    showButton: true,
    text: translate('iou.changeApprover.title'),
    onConfirm: changeApprover,
}), [translate, changeApprover]);

Note: You'll also need to memoize the changeApprover function with useCallback.

});

if (shouldShowBypassApproversOption) {
data.push({
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ PERF-4 (docs)

Objects and functions passed as props should be properly memoized to prevent unnecessary re-renders.

The listHeader JSX element is created on every render without memoization. This creates a new element reference each time, causing the SelectionList component to re-render unnecessarily even when the underlying data hasn't changed.

Suggested fix:

const listHeader = useMemo(() => (
    <>
        <Text style={[styles.ph5, styles.mb5]}>
            {translate(selectedReports.length === 1 ? 'iou.changeApprover.subtitle' : 'iou.changeApprover.bulkSubtitle')}
        </Text>
        {selectedPolicies.length === 1 && (
            <View style={[styles.ph5, styles.mb5, styles.renderHTML, styles.flexRow]}>
                <RenderHTML
                    html={translate('iou.changeApprover.description', {
                        workflowSettingLink: `${environmentURL}/${ROUTES.WORKSPACE_WORKFLOWS.getRoute(selectedPolicies.at(0)?.id)}`,
                    })}
                />
            </View>
        )}
    </>
), [styles, translate, selectedReports.length, selectedPolicies, environmentURL]);

}, [hasLoadedApp, onyxReports, selectedReports]);

const getSelectedPolicies = () => {
const policies = new Map<string, Policy>();
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ PERF-4 (docs)

Objects and functions passed as props should be properly memoized to prevent unnecessary re-renders.

The selectedPolicies array is computed by calling getSelectedPolicies() on every render without memoization. This creates a new array reference each time, affecting the memoization of listHeader and other dependent values.

Suggested fix:

const selectedPolicies = useMemo(() => getSelectedPolicies(), [selectedReports, allPolicies]);

Copy link
Contributor

@joekaufmanexpensify joekaufmanexpensify left a comment

Choose a reason for hiding this comment

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

Whats next project 👍

@Krishna2323
Copy link
Contributor

@QichenZhu could you please check the Explanation of Change of this PR? We are doing the same in this PR.

@QichenZhu
Copy link
Contributor Author

@Krishna2323, yes, it is.

@Krishna2323
Copy link
Contributor

Reviewing...

@Krishna2323
Copy link
Contributor

Krishna2323 commented Feb 26, 2026

@QichenZhu please link these regression in the OP.

#77372

@Krishna2323
Copy link
Contributor

@codex review

@chatgpt-codex-connector
Copy link

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

We were unable to download your code in a timely manner.
ℹ️ 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".

@Krishna2323
Copy link
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I verified proper code patterns were followed (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
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • 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 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp

Test 1: Bulk Add Approver

test_1.mp4

Test 2: Bulk Bypass Approver

test_2.mp4

Test 3: Account C Visibility Rules

test_3.mp4

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

test_4_5.mp4

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

test_4_5.mp4

Test 6: Mixed State Skip Behavior

test_6.mp4
Android: mWeb Chrome

Test 1: Bulk Add Approver

test_1.mp4

Test 2: Bulk Bypass Approver

test_2.mp4

Test 3: Account C Visibility Rules

test_3.mp4

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

test_4_5.mp4

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

test_4_5.mp4

Test 6: Mixed State Skip Behavior

test_6.mp4
iOS: HybridApp

Test 1: Bulk Add Approver

test_1.mp4

Test 2: Bulk Bypass Approver

test_2.mp4

Test 3: Account C Visibility Rules

test_3.mp4

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

test_4_5.mp4

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

test_4_5.mp4

Test 6: Mixed State Skip Behavior

test_6.mp4
iOS: mWeb Safari

Test 1: Bulk Add Approver

test_1.mp4

Test 2: Bulk Bypass Approver

test_2.mp4

Test 3: Account C Visibility Rules

test_3.mp4

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

test_4_5.mp4

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

test_4_5.mp4

Test 6: Mixed State Skip Behavior

test_6.mp4
MacOS: Chrome / Safari

Test 1: Bulk Add Approver

test_1.mp4

Test 2: Bulk Bypass Approver

test_2.mp4

Test 3: Account C Visibility Rules

test_3_ab.mp4

Test 4: Single Non-Upgraded (Non-Control) Policy Selected

test_4_5.mp4

Test 5: Two Non-Upgraded (Non-Control) Policies Selected

test_4_5.mp4

Test 6: Mixed State Skip Behavior

test_6.mp4

Copy link
Contributor

@Krishna2323 Krishna2323 left a comment

Choose a reason for hiding this comment

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

LGTM and works well! 🚀

@QichenZhu please resolve the conflicts when you get a chance. Thanks!

@melvin-bot melvin-bot bot requested a review from marcaaron February 26, 2026 22:28
Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

These changes are looking great! Minor comments and then just the conflicts to address. Feels super close! Thanks for your patience on this one @QichenZhu

* Do not use directly, use only via `getSections()` facade.
*/
function getAction(allActions: SearchTransactionAction[]) {
// VIEW should take precedence over CHANGE_APPROVER
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not entirely clear what this method is doing or why "change approver" has special significance here.

* @private
* Returns the main action that can be taken on a given transaction or report
*
* Do not use directly, use only via `getSections()` facade.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment can probably be removed as it's pretty vague. If someone wanted to use this it would not make much difference.


/**
* @private
* Returns the main action that can be taken on a given transaction or report
Copy link
Contributor

Choose a reason for hiding this comment

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

How are we defining "main" here? Can we say this another way? I think it would improve the comment a bit.

);
}

// This actually clears selected reports as well
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// This actually clears selected reports as well
// Note: This clears both reports and transactions

@marcaaron
Copy link
Contributor

Sorry if I missed it, but did we want to address the AI review comments about memoization? Please confirm @QichenZhu @Krishna2323 Thanks!

@QichenZhu
Copy link
Contributor Author

Thanks for your review! Comments addressed.

@QichenZhu
Copy link
Contributor Author

Sorry if I missed it, but did we want to address the AI review comments about memoization? Please confirm @QichenZhu @Krishna2323 Thanks!

React Compiler Marker shows they are auto-memorized.

Screenshot 2026-03-02 at 11 47 44 PM Screenshot 2026-03-02 at 11 48 34 PM

@Krishna2323
Copy link
Contributor

@marcaaron this is ready :)

@QichenZhu

This comment was marked as outdated.

@QichenZhu
Copy link
Contributor Author

QichenZhu commented Mar 11, 2026

The new SearchContext unit tests were not directly related to this PR's core functionality and often conflicted or broke due to other changes in the main branch, so I removed them. I can add them back in a follow-up if needed.

@QichenZhu
Copy link
Contributor Author

@marcaaron, this is ready for your review.

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