[Payment due @aimane-chnaif] Add removeDelegator action and three-dot menu on delegator rows#91989
Conversation
This comment has been minimized.
This comment has been minimized.
|
Fixed the two failing checks:
|
|
|
|
|
|
|
|
Fixed additional failing checks (typecheck and test job 7):
|
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.
|
|
@MelvinBot let's remove the usecallback introduced as we are using react compiler, let's also implement: #91989 (comment) |
|
Done — pushed 1. Removed the introduced
I left the pre-existing 2. Applied the Polyglot Parrot translations for Checks run
|
|
@MelvinBot we decreased coverage in here: #91989 (comment) |
|
🤖 Addressed the coverage decrease. The patch coverage drop came from the new All 9 tests in |
|
MelvinBot has made 5 consecutive commits trying to fix CI failures. Automatic CI fix dispatches are now paused for this PR. Next steps: A human should review the recent commits and resolve the conflicting CI errors manually. |
|
The failing test checks were flaky UI tests unrelated to this PR, and they have already passed on CI's automatic re-run. No code fix is needed. The only check still showing red is PR Author Checklist, which fails because the human-only What failed and why it's unrelatedOriginal test run
Neither file is in this PR's diff (which touches Next step: fill out the |
ec0584a to
afb4221
Compare
|
@mjasikowski 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: afb4221da7
ℹ️ 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".
|
@mjasikowski 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] |
…tor rows Allows users to remove themselves as a copilot from a delegator's account. Adds RemoveDelegator write command, a confirmation modal, and replaces the Switch button on delegator rows with a three-dot popover menu containing Switch and Remove copilot access options. Ref: Expensify/Expensify#638847 Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
- Run Prettier on Delegate.ts to fix formatting - Convert delegatorMenuItems from useMemo to inline computation to fix React Compiler 'Cannot access refs during render' error. The compiler flags two useMemo hooks capturing callbacks that mutate the same ref. React Compiler auto-memoizes the inline computation, so manual useMemo is unnecessary. Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
- Add removeDelegator field to DelegateErrors type - Add removeCopilotAccess/removeCopilotAccessConfirmation translations to de, fr, it, ja, nl, pl, pt-BR, zh-hans - Update CopilotPageTest to expect three-dot menu instead of Switch button in delegator rows - Add removeDelegator to Delegate action mock Co-authored-by: Daniel Gale-Rosen <dangrous@users.noreply.github.com>
- Update translations for remove copilot access in multiple languages (de, en, es, fr, it, ja, nl, pl, pt-BR, zh-hans) to include personalized confirmation messages. - Modify CopilotPage to utilize new confirmation modal structure, including delegator name in prompts. - Adjust icon usage in the delegator popover menu for improved UX.
- Add 'connect' and 'removeDelegator' fields to WithFieldName type for improved error tracking. - Update error handling in removeDelegator function to provide more informative error messages. - Modify CopilotPage to handle errors for both 'connect' and 'removeDelegator' actions, ensuring proper dismissal of errors on pending actions.
…ator row - Convert showRemoveDelegatorModal and showDelegatorPopoverMenu to plain functions (React Compiler auto-memoizes) - Remove role: CONST.ROLE.LINK from delegator row since it now opens a popover instead of navigating Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…belt baseline Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
…r delegator type additions Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
da5cb09 to
22f3c01
Compare
|
The "You can access these accounts:" delegators section was introduced by #89422 ("Move Copilot to its own top-level menu under Account", merged 2026-05-15). Per GitHub's blame, the whole block — including the |
|
🎯 @aimane-chnaif, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created. |
…r delegator type additions Co-authored-by: Nicolás Bonet <NicolasBonet@users.noreply.github.com>
|
Re-applied the ESLint check fix. My earlier baseline bump was wiped when the branch was reset/force-pushed (the latest commit I re-pushed the bump Heads up: this PR's legitimate type additions shift TS inference enough to flip 16 pre-existing test-mock |
|
@shawnborton if this is fine for Design, can you approve? |
|
Done! |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @mjasikowski has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mjasikowski in version: 9.4.6-0 🚀
Bundle Size Analysis (Sentry): |
Help site review — docs update required ✅This PR adds the ability for a copilot to remove themselves from another user's account, via a new three dots (⋮) menu on the delegator rows ("You can access these accounts:") of the Copilot page. The existing Copilot Access article already states in its FAQ that "a Copilot can remove themselves," but it never documented how. So a docs update is required to add the procedure. Draft help site PR: #93353 It adds a Remove Yourself as a Copilot section to
@NicolasBonet, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
Explanation of Change
Adds the ability for users to remove themselves as a copilot from another user's account. Previously, only the delegator could remove a delegate — now the delegate can also remove themselves.
Changes:
removeDelegator()action with optimistic/success/failure Onyx updates on thedelegatorsarrayREMOVE_DELEGATORwrite command andRemoveDelegatorParamstyperemoveCopilotAccessandremoveCopilotAccessConfirmationstrings (en + es)DELEGATOR_ITEMandDELEGATOR_REMOVEsentry labelsHolding for
Fixed issue
$ https://github.com/Expensify/Expensify/issues/638847
Tests
Offline tests
Repeat the process been offline, the delegate should see the copilot account gray while it is completed.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
MacOS: Chrome / Safari
Screen.Recording.2026-06-04.at.4.00.06.PM.mov