Move Copilot to its own top-level menu under Account#89422
Move Copilot to its own top-level menu under Account#89422wildan-m wants to merge 6 commits intoExpensify:mainfrom
Conversation
Move the Copilot UI out of the Security page into a dedicated central pane, positioned between Preferences and Security. The new page leads with the "Accounts you have access to" list (delegators) and adds a per-row Switch button that mirrors the AccountSwitcher's connect flow, so users can switch into a delegated account without going through the avatar menu. The Security page is reduced to genuine security controls (2FA, MFA revoke, merge, lock, close).
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
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 --helpTypically, you'd want to translate only what you changed by running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
The empty-state ('You don't have access to any accounts yet.') under
a 'You can access these accounts:' title read as a contradiction.
Drop the noAccountsToAccess key and only render the top section when
delegators exist. The bottom 'These members can access your account'
card remains visible so users can still add a copilot.
Explanation of Change
Customers were having a hard time finding Copilot settings: they were nested deep under Account → Security, and the list of accounts a user can copilot into was only reachable via the avatar account-switcher. This was less intuitive than Classic and led some users to assume they had lost access.
This PR addresses the three changes agreed in the issue:
SecuritySettingsPageand lives in a newsrc/pages/settings/Copilot/CopilotPage.tsxregistered as a central-pane settings screen atsettings/copilot.connect({email, delegatedAccess, credentials, session, activePolicyID})action the avatar account-switcher uses today, with the existing offline / GPS-in-progress guards reused fromAccountSwitcher. The button is disabled while the row has apendingAction, and connect errors render inline via the existingclearDelegatorErrorsmechanism.Three small new translation keys were introduced under the existing
delegatenamespace:delegate.copilot(menu title),delegate.switch(button label), anddelegate.noAccountsToAccess(empty-state subtitle for the top card). All other strings (youCanAccessTheseAccounts,membersCanAccessYourAccount,addCopilot,removeCopilot,copilotDelegatedAccessDescription, etc.) are reused from the existing Security page. TheyouCanAccessTheseAccountsvalue was tightened to drop the trailing "via the account switcher" phrasing now that the Switch action is inline.Fixed Issues
$ #89113
PROPOSAL: #89113 (comment)
Tests
Test data setup
To exercise the delegator (top) card, you'll need an account that has been added as a copilot to at least one other account. From the delegator account, accept the invite via the magic-code flow once — that populates
account.delegatedAccess.delegators, which the new top card reads from. The delegate (bottom) card is populated by adding copilots from your own account using "Add copilot".1. New top-level menu placement
/settings/copilotand the central pane shows a screen titled "Copilot".2. Top card — Accounts you have access to
/settings/copilot.3. Top card — empty state
/settings/copilot.4. Bottom card — Accounts that can access your account
/settings/security/delegate/addflow) that exists today.5. Switch button — offline guard
6. Switch button — GPS-in-progress guard
/settings/copilot.7. Security page no longer contains Copilot
8. Pending state and inline error
clearDelegatorErrorsaction.pendingAction(mid-add optimistic state), verify the Switch button on that row is disabled.9. Direct deep link
https://new.expensify.com/settings/copilotdirectly (or paste it in the URL bar after signing in).Offline tests
Same as Tests step 5: with the network turned off, tapping Switch on a delegator row shows the "You appear to be offline" confirmation modal instead of issuing a connect call. Reading the page itself (delegators / delegates lists) works offline — both lists are sourced from the cached
account.delegatedAccessOnyx value.QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari