Skip to content

[Bulk workspace edits] Add Copy Policy Settings select-workspaces page (step 1 of 3)#90079

Merged
francoisl merged 20 commits into
Expensify:mainfrom
fedirjh:copy-policy-settings-page-1
May 21, 2026
Merged

[Bulk workspace edits] Add Copy Policy Settings select-workspaces page (step 1 of 3)#90079
francoisl merged 20 commits into
Expensify:mainfrom
fedirjh:copy-policy-settings-page-1

Conversation

@fedirjh

@fedirjh fedirjh commented May 8, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds the entry point and the first RHP step of the new "Copy settings" flow that's part of the Bulk workspace edits project. This is task 3 of the project — task 1 (scaffold #89959) is merged; task 2 (action layer #89963) is still open and this PR is stacked on top of #89963. Please land #89963 first.

What this PR adds

  1. Three-dot menu entry in src/pages/workspace/WorkspacesListPage.tsx — a new "Copy settings" item with the Gear icon next to "Duplicate Workspace", visible only for admins (existing isAdmin guard). Navigates to ROUTES.POLICY_COPY_SETTINGS.

  2. Select Workspaces page in src/pages/workspace/copyPolicySettings/CopyPolicySettingsSelectWorkspacesPage.tsx — first step of the RHP flow. Renders a SelectionList with MultiSelectListItem of policies the current user is admin of, with the eligibility rules from the design doc:

    • Excludes the source policy
    • Excludes policies where the user is not admin and personal policies
    • When the source is CORPORATE, only CORPORATE targets are shown (Release 1 restriction; Issue 7 lifts this in R2 with an upgrade step)

    Layout:

  3. Translations — new workspace.copySettings.{title, selectWorkspaces, whichWorkspaces, searchPlaceholder, selectAll} block in all 10 language files.

  4. Sentry labelCONST.SENTRY_LABEL.WORKSPACE.COPY_SETTINGS_SELECT_WORKSPACES_SELECT_ALL for the select-all pressable.

The page reads its persisted state (targetPolicyIDs) directly from ONYXKEYS.COPY_POLICY_SETTINGS so re-entry restores the user's previous selection.

Fixed Issues

$ #88669
PROPOSAL: N/A

Tests

Setup

Sign in as an admin on at least two non-personal workspaces (a mix of Team/Collect and Corporate/Control if possible).

Test 1 — Three-dot menu entry

  1. Open the Workspaces list.
  2. Click the three-dot menu on a workspace where you're admin.
  3. Verify a new "Copy settings" item appears next to "Duplicate Workspace".
  4. Verify "Copy settings" uses the Copy/duplicate icon and "Duplicate Workspace" uses the Plus icon.
  5. Verify the item is not present on a workspace where you're not admin (or on personal workspaces).
  6. Click "Copy settings" → the RHP slides open with the "Select workspaces" step.

Test 2 — Eligibility filtering

  1. From a Corporate (Control) workspace, open Copy settings.
  2. Verify the list excludes the source workspace.
  3. Verify the list excludes any policy where you're not admin.
  4. Verify the list excludes any personal policy.
  5. Verify only other Corporate workspaces appear (Team workspaces are filtered out).
  6. Go back, repeat from a Team (Collect) workspace.
  7. Verify both Team and Corporate workspaces appear in the list.

Test 3 — Workspace avatars

  1. Open Copy settings.
  2. Verify each row shows the workspace avatar at the standard list-row size (not a tiny icon).
  3. For workspaces without an avatarURL, verify the default workspace avatar (initials/colored placeholder) is rendered.

Test 4 — Select-all alignment and behavior

  1. Open Copy settings.
  2. Verify the select-all checkbox sits on the right of its header row, aligned with the per-row checkboxes below it.
  3. Tap two rows — verify the select-all shows the indeterminate state.
  4. Tap the remaining rows — verify the select-all becomes fully checked.
  5. Tap the select-all checkbox — verify all rows clear.
  6. Tap the select-all label/checkbox again — verify all rows toggle on.

Test 5 — Search

  1. Open Copy settings on an account with 12 or fewer eligible workspaces.
  2. Verify no search input is shown.
  3. Open Copy settings on an account with more than 12 eligible workspaces.
  4. Verify a search input appears above the select-all header (search → select-all → rows order).
  5. Type part of a workspace name — verify the list filters case-insensitively.
  6. Type a string that matches nothing — verify the empty state ("No results found") is shown.
  7. Clear the input — verify the full list returns.

Test 6 — Next / commit selection

  1. Open Copy settings.
  2. With no rows selected, verify the "Next" button is disabled.
  3. Select one or more rows — verify "Next" becomes enabled.
  4. Click "Next" — verify the flow advances to the Select Features step (currently a stub page from this PR's scaffold).
  5. In dev tools / Onyx console, verify copyPolicySettings.targetPolicyIDs now contains the selected IDs and copyPolicySettings.sourcePolicyID is set.

Test 7 — Selection cleared on RHP close

  1. Open Copy settings, select 2–3 workspaces.
  2. Close the RHP via the X / back button without clicking "Next".
  3. Re-open Copy settings from the three-dot menu.
  4. Verify the previous selection is not restored (selection is empty, "Next" disabled).

Test 8 — Console

  • Verify that no errors appear in the JS console while running tests 1–7.

Offline tests

The page is a pure read of ONYXKEYS.COLLECTION.POLICY plus a useState selection; the only Onyx write happens at "Next" via setCopyPolicySettingsData. Both should work fully offline:

  1. Toggle off network connectivity.
  2. From the three-dot menu open Copy settings → the page renders with the cached policies, eligibility filtering still works.
  3. Toggle rows / select-all → state updates instantly.
  4. Click "Next" → the flow advances; verify copyPolicySettings.targetPolicyIDs is written to Onyx even while offline.
  5. Re-enable network — no redundant writes are queued (selection wasn't being persisted on every toggle).

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 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

Screenshot 2026-05-11 at 12 43 47 PM Screenshot 2026-05-11 at 12 43 53 PM Screenshot 2026-05-11 at 12 44 12 PM Screenshot 2026-05-11 at 12 44 22 PM Screenshot 2026-05-11 at 12 44 28 PM Screenshot 2026-05-11 at 12 46 06 PM
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

fedirjh added 3 commits May 8, 2026 21:26
Adds title, selectWorkspaces, whichWorkspaces, searchPlaceholder, and
selectAll keys for the new "Copy settings" RHP flow's first step,
across all ten language files.
Adds a new "Copy settings" item next to "Duplicate Workspace" in the
admin three-dot menu on WorkspacesListPage. Uses the Gear icon and
navigates to ROUTES.POLICY_COPY_SETTINGS, the first step of the new
RHP flow. Visible only for admins (existing isAdmin guard).
First RHP step of the bulk Copy Policy Settings flow. Renders a
SelectionList with MultiSelectListItem of policies the current user
is admin of, excluding:

- the source policy
- personal policies
- policies where the user is not admin
- when the source is Corporate, non-Corporate targets (Release 1
  restriction; Issue 7 lifts this with an upgrade step)

Layout follows the design doc:
- select-all Checkbox above the list (indeterminate when partial)
- SearchBar appears only when there are more than 12 eligible
  workspaces
- "Next" persists targetPolicyIDs through setCopyPolicySettingsData
  and routes to POLICY_COPY_SETTINGS_SELECT_FEATURES; disabled until
  at least one workspace is selected

Adds CONST.SENTRY_LABEL.WORKSPACE.COPY_SETTINGS_SELECT_WORKSPACES_SELECT_ALL
for the select-all pressable.
@melvin-bot

melvin-bot Bot commented May 8, 2026

Copy link
Copy Markdown

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

@fedirjh fedirjh changed the title Add Copy Policy Settings select-workspaces page (step 1 of 3) [Hold App/89963] [Bulk workspace edits] Add Copy Policy Settings select-workspaces page (step 1 of 3) May 8, 2026
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/components/SelectionList/BaseSelectionList.tsx 67.20% <ø> (ø)
...components/SelectionList/components/ListHeader.tsx 85.71% <87.50%> (+2.38%) ⬆️
src/pages/workspace/WorkspacesListPage.tsx 72.95% <87.50%> (+0.77%) ⬆️
...ettings/CopyPolicySettingsSelectWorkspacesPage.tsx 0.00% <0.00%> (ø)
... and 8 files with indirect coverage changes

fedirjh added 7 commits May 8, 2026 22:11
Per review on PR Expensify#90079: use the Plus icon for "Duplicate workspace"
and the Copy (duplicate) icon for "Copy settings", to better match
each item's intent.
Per review on PR Expensify#90079: MultiSelectListItem renders its checkbox on
the right side, so move the select-all Checkbox to the right of the
header row (label on the left, checkbox on the right) so they line up
with the per-row checkboxes below.
Drops the separate SearchBar component above the list in favour of
SelectionList's built-in textInputOptions, which matches the search
field used in the New Chat / start chat flow at /new/chat. The
built-in input owns its own margin/padding so the design is
consistent across the app.

The "more than 12 eligible workspaces" gate is preserved by toggling
shouldShowTextInput.
The built-in select-all header always rendered its checkbox on the
left, which misaligned with lists whose per-row checkboxes use
selectionButtonPosition=RIGHT (e.g. MultiSelectListItem).

Adds a selectionButtonPosition prop to ListHeader (default LEFT for
existing callers) and threads it from BaseSelectionList. When set to
RIGHT, the label/checkbox order is swapped and the row uses
justifyContentBetween so the checkbox sits flush right, matching the
list rows below.
Three review fixes on the Select Workspaces page:

- Use SelectionList's built-in onSelectAll with
  selectionButtonPosition=RIGHT, so the search input sits above the
  select-all header and the select-all checkbox lines up with the
  per-row checkboxes (both on the right). Drops the custom select-all
  header that used to sit above the SelectionList.
- Render the workspace avatar at AVATAR_SIZE.DEFAULT via a leftElement
  on each list item. The previous icons-based path inside
  MultiSelectListItem hardcodes AVATAR_SIZE.SMALLER, which looked too
  small. Falls back to getDefaultWorkspaceAvatar when avatarURL is
  missing.
- Track selectedTargetIDs in local useState instead of writing to
  COPY_POLICY_SETTINGS on every toggle. The Onyx key is now updated
  only when the user confirms "Next", so closing the RHP mid-flow
  naturally drops the in-progress selection without needing a manual
  clear-on-mount.
The page now uses SelectionList's built-in select-all header, which
already reuses workspace.people.selectAll for its label and
SENTRY_LABEL.SELECTION_LIST.LIST_HEADER_SELECT_ALL for its pressable.
The custom workspace.copySettings.selectAll key (10 language files)
and SENTRY_LABEL.WORKSPACE.COPY_SETTINGS_SELECT_WORKSPACES_SELECT_ALL
are no longer referenced — remove them.
@fedirjh fedirjh requested a review from francoisl May 11, 2026 11:50
@fedirjh fedirjh marked this pull request as ready for review May 11, 2026 11:50
@fedirjh fedirjh requested review from a team as code owners May 11, 2026 11:50
@melvin-bot melvin-bot Bot requested review from dmkt9 and joekaufmanexpensify and removed request for a team May 11, 2026 11:51
@melvin-bot

melvin-bot Bot commented May 11, 2026

Copy link
Copy Markdown

@dmkt9 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 May 11, 2026 11:51

@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: 5f2d85f6fb

ℹ️ 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".

Comment thread src/pages/workspace/copyPolicySettings/CopyPolicySettingsSelectWorkspacesPage.tsx Outdated
fedirjh added 3 commits May 11, 2026 13:17
Consolidates the two translation namespaces for the bulk Copy Policy
Settings flow into a single workspace.copyPolicySettings block (next
to the existing error key). Renames whichWorkspaces to description
and updates the copy to:

"Choose the workspaces you want to copy settings to, then select the
settings you'd like to copy."

Localizes the new description across all ten language files.
Updates the three-dot menu entry and the Select Workspaces page to
read from workspace.copyPolicySettings.* now that the translation
block was merged. Also swaps the page subheader to the renamed
description key.
When search was active, toggleAll decided whether to clear or select
against eligiblePolicies (the full unfiltered set) while
SelectionList's header checkbox state was derived from
filteredPolicies (the visible rows). That mismatch let the header
appear checked yet pressing it would select additional hidden
workspaces — copying settings to unintended targets.

Scope select-all to the visible filtered rows: when every visible row
is already selected, deselect just those; otherwise add the visible
rows to the existing selection, preserving selections on rows hidden
by the active search.

Resolves Expensify#90079 (comment)
@dmkt9

dmkt9 commented May 12, 2026

Copy link
Copy Markdown
Contributor
  • 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:

Could you add the link to the Slack message that approved the translation?

@fedirjh fedirjh changed the title [Hold App/89963] [Bulk workspace edits] Add Copy Policy Settings select-workspaces page (step 1 of 3) [Bulk workspace edits] Add Copy Policy Settings select-workspaces page (step 1 of 3) May 19, 2026
@francoisl

Copy link
Copy Markdown
Contributor

Typecheck and Jest seem to be repeatedly failing

@fedirjh

fedirjh commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

Could you add the link to the Slack message that approved the translation?

@dmkt9 Please check https://expensify.slack.com/archives/C01GTK53T8Q/p1778753210690539

@dmkt9

dmkt9 commented May 20, 2026

Copy link
Copy Markdown
Contributor

Could you add the link to the Slack message that approved the translation?

@dmkt9 Please check expensify.slack.com/archives/C01GTK53T8Q/p1778753210690539

Ah, thank you.

@francoisl

Copy link
Copy Markdown
Contributor

@dmkt9 any chance you can review this today you think?

@dmkt9

dmkt9 commented May 21, 2026

Copy link
Copy Markdown
Contributor

@dmkt9 any chance you can review this today you think?

Yes. I will review this today.

@dmkt9

dmkt9 commented May 21, 2026

Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ 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".

@dmkt9

dmkt9 commented May 21, 2026

Copy link
Copy Markdown
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
  • 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 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
android.hybrid.mp4
Android: mWeb Chrome
android.chrome.mp4
iOS: HybridApp
ios.hybrid.mp4
iOS: mWeb Safari
ios.safari.mp4
MacOS: Chrome / Safari
mac.safari.mp4

Comment on lines +400 to +404
threeDotsMenuItems.push({
icon: icons.Copy,
text: translate('workspace.copyPolicySettings.title'),
onSelected: () => (item.policyID ? Navigation.navigate(ROUTES.POLICY_COPY_SETTINGS.getRoute(item.policyID)) : undefined),
});

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.

This item will be rendered when isAdmin == true. If there is no other eligible workspace, this item will still display and open an empty list modal.
I am not sure whether this is a bug, since in the "Explanation of changes", we only refer to "isAdmin" as a guard:

  1. Three-dot menu entry in src/pages/workspace/WorkspacesListPage.tsx — a new "Copy settings" item with the Gear icon next to "Duplicate Workspace", visible only for admins (existing isAdmin guard). Navigates to ROUTES.POLICY_COPY_SETTINGS.

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.

This makes sense; I think we should hide the item in that case. Will push a fix for it. cc @francoisl for visibility.

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.

Done in 942a7fc

fedirjh added 2 commits May 21, 2026 11:14
Precomputes eligible target policy IDs via useMemo so the per-item
menu render does a constant-time check instead of iterating all
policies. Hides the menu entry entirely when there are no valid
targets for the source workspace.
@fedirjh fedirjh requested a review from dmkt9 May 21, 2026 10:42

@dmkt9 dmkt9 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

@francoisl francoisl merged commit daf2f6b into Expensify:main May 21, 2026
43 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@fedirjh fedirjh deleted the copy-policy-settings-page-1 branch May 21, 2026 18:50
@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/francoisl in version: 9.3.79-1 🚀

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

Bundle Size Analysis (Sentry):

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #91381 was identified to be related to this PR.

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #91389 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.79-4 🚀

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

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