Skip to content

Make Copilot switching discoverable with a dedicated Switch button on the Accounts page#93393

Merged
inimaga merged 27 commits into
Expensify:mainfrom
wildan-m:wildan/92253-copilot-switch-button
Jul 8, 2026
Merged

Make Copilot switching discoverable with a dedicated Switch button on the Accounts page#93393
inimaga merged 27 commits into
Expensify:mainfrom
wildan-m:wildan/92253-copilot-switch-button

Conversation

@wildan-m

@wildan-m wildan-m commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Copilot account switching is hard to discover on the Accounts page: the only way to switch is pressing the avatar/name block, which carries no visible affordance beyond a small caret, while the most prominent spot in the header is occupied by the Status emoji picker.

The header now shows a dedicated Switch button whenever the account can switch (it reuses the existing Copilot-page label, so no new translations are needed). The button opens the same account-switcher popover, and both the Copilot Access tooltip and the first-time educational tooltip anchor to it. The avatar and name become plain, non-pressable content, and the Status picker is removed from this header — Status stays available through the Profile page, which already links to it. The now-unused status-picker telemetry label and a lazy-loaded icon entry are removed along with it.

Fixed Issues

$ #92253
PROPOSAL: #92253 (comment)

Tests

  1. Log in with an account that has been added as a Copilot for another account.
  2. Go to Settings.
  3. Verify the header shows a Switch button to the right of your avatar and name, and the Status emoji button is no longer there.
  4. The first time a Copilot opens the Accounts page (i.e. the educational tooltip has not been dismissed yet for this account), verify a one-time tooltip reading You can now copilot to another account is shown anchored to the Switch button. Dismiss it with the ✕ and verify it does not reappear on the next visit to the Accounts page.
  5. After the educational tooltip has been dismissed, hover the Switch button and verify the Copilot access tooltip points at it.
  6. Click Switch and verify the Switch accounts: popover opens, listing your account (selected) and the account(s) you can switch to.
  7. Select the other account and verify switching still works, then switch back.
  8. Click the avatar, name, and email in the header and verify nothing opens — they are no longer pressable.
  9. Log in with an account that has no Copilot relationships and verify the header shows no Switch button.
  10. Verify Status is still reachable from Settings > Profile > Status.
  • Verify that no errors appear in the JS console

Offline tests

  1. Complete step 1-2 of Tests, then go offline.
  2. Verify the Switch button still shows and opens the popover.
  3. Select the other account and verify the "You appear to be offline" modal appears (switching requires a connection, matching existing behavior).

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
    • 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
Kapture.2026-06-20.at.10.16.13.mp4
Android: mWeb Chrome
Kapture.2026-06-20.at.10.20.13.mp4
iOS: Native
Kapture.2026-06-20.at.09.11.59.mp4
iOS: mWeb Safari
Kapture.2026-06-20.at.09.14.35.mp4
MacOS: Chrome / Safari
Kapture.2026-06-20.at.08.47.37.mp4

wildan-m added 5 commits June 1, 2026 23:16
Replace the implicit avatar/name press affordance on the Accounts header
with an explicit Switch button in the slot previously held by the Status
emoji picker. The avatar and name are no longer pressable, the Copilot
access tooltip now anchors to the Switch button, and the Status entry is
removed from the Accounts header (it already lives on the Profile page).
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/CONST/index.ts 93.33% <ø> (ø)
src/components/AccountSwitcher.tsx 78.88% <100.00%> (+78.88%) ⬆️
src/pages/settings/InitialSettingsPage.tsx 86.76% <ø> (+1.05%) ⬆️
... and 11 files with indirect coverage changes

@wildan-m
wildan-m marked this pull request as ready for review June 14, 2026 18:17
@wildan-m
wildan-m requested review from a team as code owners June 14, 2026 18:17
@melvin-bot
melvin-bot Bot requested review from a team, eh2077 and trjExpensify and removed request for a team June 14, 2026 18:17
@melvin-bot

melvin-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

@eh2077 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 joekaufmanexpensify and removed request for a team June 14, 2026 18:17
Comment thread tests/ui/AccountSwitcherTest.tsx
@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

Tossing this one over to you @flaviadefaria as this is a project you're working on

@joekaufmanexpensify
joekaufmanexpensify requested review from flaviadefaria and removed request for joekaufmanexpensify and trjExpensify June 15, 2026 21:11
@flaviadefaria

Copy link
Copy Markdown
Contributor

Add a tooltip for whenever someone goes to Accounts for the first time after being added as a copilot (or if we have a tooltip already, we'd update it).

@wildan-m I'm not seeing this change, did you add it in?

wildan-m added 2 commits July 2, 2026 18:57
…t-switch-button

# Conflicts:
#	Mobile-Expensify
#	android/app/build.gradle
#	config/eslint/eslint.seatbelt.tsv
#	docs/articles/new-expensify/concierge-ai/Support-Agent.md
#	docs/articles/new-expensify/concierge-ai/What-Concierge-Can-Do.md
#	ios/AppDelegate.swift
#	ios/NewExpensify/Info.plist
#	ios/NotificationServiceExtension/Info.plist
#	ios/ShareViewController/Info.plist
#	package-lock.json
#	package.json
#	patches/@shopify/flash-list/details.md
#	src/CONST/index.ts
#	src/ONYXKEYS.ts
#	src/ROUTES.ts
#	src/SCREENS.ts
#	src/components/AvatarWithDisplayName.tsx
#	src/components/Charts/BarChart/BarChartContent.tsx
#	src/components/Charts/LineChart/LineChartContent.tsx
#	src/components/DatePicker/DatePickerModal.tsx
#	src/components/FlashList/InvertedFlashList/index.tsx
#	src/components/MoneyReportHeaderActions/MoneyReportHeaderSecondaryActions.tsx
#	src/components/MoneyReportHeaderActions/MoneyReportHeaderSelectionDropdown.tsx
#	src/components/MoneyReportHeaderPrimaryAction/SubmitPrimaryAction.tsx
#	src/components/MoneyRequestConfirmationFields/Provider.tsx
#	src/components/MoneyRequestConfirmationFields/context.ts
#	src/components/MoneyRequestConfirmationList.tsx
#	src/components/MoneyRequestConfirmationList/sections/DescriptionField.tsx
#	src/components/MoneyRequestConfirmationListFooter.tsx
#	src/components/MoneyRequestReportView/SelectionToolbar/index.tsx
#	src/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx
#	src/components/ReportActionItem/MoneyRequestReportPreview/ReportPreviewActionButton.tsx
#	src/components/ReportActionItem/MoneyRequestReportPreview/SubmitActionButton.tsx
#	src/components/ReportSubmitToPopoverAnchor.tsx
#	src/components/Search/SearchList/ListItem/ExpenseReportListItem.tsx
#	src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/ExpenseReportListItemRowWide.tsx
#	src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/index.tsx
#	src/components/Search/SearchList/ListItem/ExpenseReportListItemRow/types.ts
#	src/components/Search/SearchList/ListItem/ReportListItemHeader.tsx
#	src/components/Search/SearchList/ListItem/TransactionListItem/TransactionListItemNarrow.tsx
#	src/components/Search/SearchList/ListItem/TransactionListItem/TransactionListItemWide.tsx
#	src/components/Search/SearchList/ListItem/TransactionListItem/index.tsx
#	src/components/Search/SearchList/ListItem/TransactionListItem/types.ts
#	src/components/Search/SearchRouter/SearchRouterContext.tsx
#	src/components/Search/index.tsx
#	src/components/SelectionList/components/Footer.tsx
#	src/components/SelectionList/types.ts
#	src/components/SubStepForms/AddressStep.tsx
#	src/components/Table/TableHeader.tsx
#	src/components/Table/TableRow.tsx
#	src/components/Table/middlewares/selection.ts
#	src/components/Table/types.ts
#	src/components/Tables/WorkspaceListTable/WorkspaceTableRow.tsx
#	src/components/TransactionItemRow/TransactionItemRowWide.tsx
#	src/components/TransactionItemRow/index.tsx
#	src/components/TransactionItemRow/types.ts
#	src/hooks/useExportActions.ts
#	src/hooks/useLifecycleActions.tsx
#	src/hooks/useMarkAsRead.ts
#	src/hooks/useProactiveAppReview.ts
#	src/hooks/useReportActionsVisibility.ts
#	src/hooks/useReportSubmitToPopover.tsx
#	src/hooks/useSearchBulkActions.ts
#	src/hooks/useSelectionModeReportActions.ts
#	src/hooks/useTransactionInlineEdit.ts
#	src/languages/de.ts
#	src/languages/en.ts
#	src/languages/es.ts
#	src/languages/fr.ts
#	src/languages/it.ts
#	src/languages/ja.ts
#	src/languages/nl.ts
#	src/languages/pl.ts
#	src/languages/pt-BR.ts
#	src/languages/zh-hans.ts
#	src/libs/API/parameters/SubmitReportParams.ts
#	src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx
#	src/libs/Navigation/NavigationRoot.tsx
#	src/libs/Navigation/linkingConfig/OldRoutes.ts
#	src/libs/Navigation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts
#	src/libs/Navigation/linkingConfig/config.ts
#	src/libs/Navigation/types.ts
#	src/libs/OptionsListUtils/index.ts
#	src/libs/PersonalDetailsUtils.ts
#	src/libs/PolicyUtils.ts
#	src/libs/ReportUtils.ts
#	src/libs/SearchUIUtils.ts
#	src/libs/SidebarUtils.ts
#	src/libs/actions/App.ts
#	src/libs/actions/IOU/ReportWorkflow.ts
#	src/libs/actions/IOU/UpdateMoneyRequest.ts
#	src/libs/actions/OnyxDerived/ONYX_DERIVED_VALUES.ts
#	src/libs/actions/Search.ts
#	src/libs/actions/Task.ts
#	src/pages/DynamicReportDetailsPage.tsx
#	src/pages/OnboardingInterestedFeatures/BaseOnboardingInterestedFeatures.tsx
#	src/pages/ReportSubmitToContent.tsx
#	src/pages/Search/SearchPage.tsx
#	src/pages/Search/SearchTransactionsChangeReport.tsx
#	src/pages/inbox/HeaderView.tsx
#	src/pages/inbox/report/ReportActionCompose/useEditMessage.ts
#	src/pages/inbox/report/ReportActionsList.tsx
#	src/pages/inbox/report/ReportActionsView.tsx
#	src/pages/iou/request/IOURequestStartPage.tsx
#	src/pages/iou/request/step/IOURequestStepConfirmation.tsx
#	src/pages/iou/request/step/IOURequestStepDate.tsx
#	src/pages/iou/request/step/IOURequestStepDistanceRate.tsx
#	src/pages/iou/request/step/IOURequestStepReport/hooks/useReportSelectionActions.ts
#	src/pages/settings/InitialSettingsPage.tsx
#	src/pages/tasks/NewTaskPage.tsx
#	src/pages/workspace/WorkspaceMembersPage.tsx
#	src/pages/workspace/deleteWorkspace/DeleteWorkspaceFlow.tsx
#	src/pages/workspace/expensifyCard/WorkspaceExpensifyCardDetailsPage.tsx
#	src/pages/workspace/expensifyCard/issueNew/spendRules/SetSpendRulesStep.tsx
#	src/pages/workspace/rules/AgentRulesSection.tsx
#	src/pages/workspace/rules/SpendRules/SpendRulePageBase.tsx
#	src/pages/workspace/tags/DynamicWorkspaceEditTagsPage.tsx
#	src/pages/workspace/tags/WorkspaceTagsPage.tsx
#	src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx
#	src/selectors/Policy.ts
#	src/selectors/ReportAction.ts
#	src/styles/index.ts
#	tests/actions/IOUTest/ReportWorkflowTest.ts
#	tests/actions/ReportTest.ts
#	tests/ui/AgentRulesSectionTest.tsx
#	tests/ui/MoneyRequestReportPreview.test.tsx
#	tests/ui/ReportActionItemMessageEditTest.tsx
#	tests/ui/WorkspaceMembersTest.tsx
#	tests/unit/DateUtilsTest.ts
#	tests/unit/PolicyUtilsTest.ts
#	tests/unit/ReportUtilsTest.ts
#	tests/unit/Search/SearchUIUtilsTest.ts
#	tests/unit/hooks/useSelectionModeReportActions.test.ts
@wildan-m

wildan-m commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@inimaga Thanks! Applied the Polyglot Parrot translations and merged latest main — conflicts resolved and CI is green. cc @eh2077 for a re-review. 🙏

wildan-m added 2 commits July 6, 2026 14:26
…t-switch-button

# Conflicts:
#	src/pages/settings/InitialSettingsPage.tsx

@eh2077 eh2077 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 good

@melvin-bot
melvin-bot Bot requested a review from inimaga July 7, 2026 16:01
@inimaga
inimaga merged commit e30e1e0 into Expensify:main Jul 8, 2026
36 checks passed
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Jul 8, 2026

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

OSBotify commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/inimaga in version: 9.4.32-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — yes, one doc update is needed 📝

This PR replaces the pressable avatar/name at the top of the Account page with a dedicated Switch button for opening the account switcher. One help article documented that old interaction, so it's now inaccurate:

  • Act as a CopilotHow to exit a Copilot account and return to your own account told users to "select the account owner's name to open the account switcher." That's no longer possible — the name is now plain, non-pressable content.

I created a draft help-site PR that updates that step to use the Switch button:

➡️ #95684Docs updates for E/A#93393 Copilot account switcher uses Switch button (labeled HelpDot)

What I checked and left unchanged
  • How to switch to a Copilot account (via Account > Copilot > Copilot: Delegated Access > Switch) is a separate flow on the Copilot settings page and is not affected by this PR, so I left it as-is.
  • The Copilot access tooltip, first-time educational tooltip copy, and the productTrainingTooltip.accountSwitcher string changes are UI-only and aren't reflected in help articles.
  • Other Copilot articles (Manage-Copilot-Access, Delegate-when-out-of-office) cover granting/managing access, not switching, so no changes were needed.
  • The Expensify Classic Copilot article describes the OldDot flow and is unaffected.

Note: I couldn't auto-assign the draft PR to you — wildan-m currently has read access on Expensify/App, so GitHub doesn't allow assignment. Please self-assign #95684 when you pick it up.

@wildan-m, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@mitarachim

Copy link
Copy Markdown

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

@mitarachim

Copy link
Copy Markdown

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

@lanitochka17

Copy link
Copy Markdown

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.4.32-3 🚀

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

Bundle Size Analysis (Sentry):

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.

10 participants