Skip to content

[Submit] Editor role + invite flows (Wave 2) - #90995

Merged
iwiznia merged 32 commits into
Expensify:mainfrom
abzokhattab:akhattab/87865-editor-role-invite-flows
Jun 5, 2026
Merged

iwiznia merged 32 commits into
Expensify:mainfrom
abzokhattab:akhattab/87865-editor-role-invite-flows

Conversation

@abzokhattab

@abzokhattab abzokhattab commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Wires up the Editor role + invite flows task from Wave 2 of the Bottom-Up Submit Plan:

  • Force the Editor role on every invite to a Submit workspace via the FE override in addMembersToWorkspace (matches the backend's Policy::shareWithEmployees behavior).
  • Add Editor to WorkspaceMemberRoleList, shown only on Submit workspaces. Admin stays gated behind isPolicyAdmin, so editors cannot escalate roles.
  • Add new editors to the #admins room in buildAddMembersToWorkspaceOnyxData.
  • Default the invite role to Editor on Submit workspaces in WorkspaceInviteMessageComponent and DynamicWorkspaceInviteMessageRolePage.
  • Submit-specific behavior is gated on the policy type (isSubmitPolicy), consistent with the rest of the Submit codebase (tryNavigateToSubmitWorkspaceUpgrade, useRedirectSubmitWorkspaceFeatureUpgrade, etc.). The SUBMIT_2026 beta only gates creating a Submit workspace — once one exists, every member (including invitees who don't have the beta) gets the correct Editor behavior.

Fixed Issues

$ #87865
PROPOSAL: N/A (internal Expensify project — design doc tracked in #87865)

Tests

Same as QA Steps.

  • Verify that no errors appear in the JS console

Offline tests

N/A — the editor role override is applied optimistically and the existing offline / optimistic-data behavior of addMembersToWorkspace is preserved.

QA Steps

Pre-requisites: User A needs the SUBMIT_2026 beta to create a Submit workspace.

  1. As User A, create a Submit workspace.
  2. From the Members page, invite User B. On the invite screen, verify the Role row shows Editor by default.
    • Note: tapping the Role row opens the Roles upgrade modal
  3. Send the invite and verify User B appears with the Editor badge on the Members page.
  4. Verify User B was added to the workspace #admins room.
  5. Sign in as User B. Verify they have editor access to workspace settings (e.g. add a Category/Tag), and that there is no "Make admin" bulk action and member role changes are paywalled (i.e. editors cannot escalate roles).

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: Non-en translations intentionally deferred — will be added in a follow-up.
    • 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
Screen.Recording.2026-05-19.at.06.05.36.mov
Android: mWeb Chrome
Screen.Recording.2026-05-19.at.06.08.23.mov
iOS: Native
Screen.Recording.2026-05-19.at.05.52.26.mov
iOS: mWeb Safari
Screen.Recording.2026-05-19.at.05.54.55.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-19.at.05.39.32.mov

- Force editor role for new members on Submit workspaces in addMembersToWorkspace (FE override)
- Add Editor to WorkspaceMemberRoleList (only shown on Submit workspaces)
- Add new editors to the #admins room in buildAddMembersToWorkspaceOnyxData
- Default the invite role to Editor on Submit workspaces in the invite message + role pages
- All Submit-specific behavior is gated behind the SUBMIT_2026 beta, threaded as a parameter
- Add common.editor and workspace.common.editorAlternateText (en only; other locales to follow)
- Add unit tests covering the editor override, beta gating, and #admins room membership
@melvin-bot

melvin-bot Bot commented May 18, 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

@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index d47ee109..7d948f43 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -494,6 +494,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: 'Vorheriges Jahr',
         nextYear: 'Nächstes Jahr',
         avatar: 'Avatar',
+        editor: 'Editor',
     },
     socials: {
         podcast: 'Folgen Sie uns auf Podcast',
@@ -4321,6 +4322,8 @@ ${amount} für ${merchant} – ${date}`,
                         return 'Admin';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Prüfer';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Editor';
                     case CONST.POLICY.ROLE.USER:
                         return 'Mitglied';
                     default:
@@ -4356,6 +4359,7 @@ ${amount} für ${merchant} – ${date}`,
             travelInvoicingPayableAccount: 'Reiseverbindlichkeitskonto',
             hr: 'Personalwesen',
             rooms: 'Räume',
+            editorAlternateText: 'Arbeitsbereichseinstellungen konfigurieren, ohne die Ausgaben anderer Mitglieder zu sehen.',
         },
         createdForClient: {
             title: 'Du hast einen Workspace für deinen Kunden erstellt!',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 2fce892d..79874074 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -446,6 +446,7 @@ const translations: TranslationDeepObject<typeof en> = {
         expensifyLogo: 'Logo de Expensify',
         approver: 'Aprobador',
         enterDigitLabel: ({digitIndex, totalDigits}: {digitIndex: number; totalDigits: number}) => `introducir dígito ${digitIndex} de ${totalDigits}`,
+        editor: 'Editor',
     },
     socials: {
         podcast: 'Síguenos en Podcast',
@@ -4199,12 +4200,14 @@ ${amount} para ${merchant} - ${date}`,
                 [CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_NO]: 'Ninguno',
                 [CONST.POLICY.REIMBURSEMENT_CHOICES.REIMBURSEMENT_MANUAL]: 'Indirecto',
             },
-            roleName: (role) => {
+            roleName: (role?: string) => {
                 switch (role) {
                     case CONST.POLICY.ROLE.ADMIN:
-                        return 'Administrador';
+                        return 'Admin';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Auditor';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Editor';
                     case CONST.POLICY.ROLE.USER:
                         return 'Miembro';
                     default:
@@ -4242,6 +4245,7 @@ ${amount} para ${merchant} - ${date}`,
             travelInvoicing: 'Exportar Viajes de Expensify por Pagar a',
             travelInvoicingVendor: 'Proveedor de viajes',
             travelInvoicingPayableAccount: 'Cuenta por pagar de viajes',
+            editorAlternateText: 'Configura los ajustes del espacio de trabajo sin ver los gastos de otros miembros.',
         },
         createdForClient: {
             title: '¡Has creado un espacio de trabajo para tu cliente!',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 3c89403e..f7552eec 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -494,6 +494,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: 'Année précédente',
         nextYear: 'L’an prochain',
         avatar: 'Avatar',
+        editor: 'Éditeur',
     },
     socials: {
         podcast: 'Suivez-nous sur Podcast',
@@ -4330,6 +4331,8 @@ ${amount} pour ${merchant} - ${date}`,
                         return 'Administrateur';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Auditeur';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Éditeur';
                     case CONST.POLICY.ROLE.USER:
                         return 'Membre';
                     default:
@@ -4365,6 +4368,7 @@ ${amount} pour ${merchant} - ${date}`,
             travelInvoicingPayableAccount: 'Compte fournisseur déplacements',
             hr: 'RH',
             rooms: 'Salons',
+            editorAlternateText: 'Configurer les paramètres de l’espace de travail sans voir les dépenses des autres membres.',
         },
         createdForClient: {
             title: 'Vous avez créé un espace de travail pour votre client !',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 1edee698..99aeadf5 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -494,6 +494,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: 'Anno precedente',
         nextYear: "L'anno prossimo",
         avatar: 'Avatar',
+        editor: 'Editor',
     },
     socials: {
         podcast: 'Seguici su Podcast',
@@ -4307,6 +4308,8 @@ ${amount} per ${merchant} - ${date}`,
                         return 'Amministrazione';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Revisore';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Editor';
                     case CONST.POLICY.ROLE.USER:
                         return 'Membro';
                     default:
@@ -4342,6 +4345,7 @@ ${amount} per ${merchant} - ${date}`,
             travelInvoicingPayableAccount: 'Conto debiti per viaggi',
             hr: 'Risorse umane',
             rooms: 'Stanze',
+            editorAlternateText: 'Configura le impostazioni dello spazio di lavoro senza vedere le spese degli altri membri.',
         },
         createdForClient: {
             title: 'Hai creato uno spazio di lavoro per il tuo cliente!',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 1dc8f623..4b1b743b 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -493,6 +493,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: '前年',
         nextYear: '来年',
         avatar: 'アバター',
+        editor: '編集者',
     },
     socials: {
         podcast: 'ポッドキャストでフォロー',
@@ -4273,7 +4274,9 @@ ${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの'
                     case CONST.POLICY.ROLE.ADMIN:
                         return '管理者';
                     case CONST.POLICY.ROLE.AUDITOR:
-                        return '監査人';
+                        return '監査担当者';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return '編集者';
                     case CONST.POLICY.ROLE.USER:
                         return 'メンバー';
                     default:
@@ -4309,6 +4312,7 @@ ${integrationName === CONST.ONBOARDING_ACCOUNTING_MAPPING.other ? 'あなたの'
             travelInvoicingPayableAccount: '旅費未払金勘定',
             hr: '人事',
             rooms: 'ルーム',
+            editorAlternateText: '他のメンバーの経費を表示せずに、ワークスペース設定を構成できます。',
         },
         createdForClient: {
             title: 'クライアントのワークスペースを作成しました!',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 9737a63f..6c02fe96 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -493,6 +493,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: 'Vorig jaar',
         nextYear: 'Volgend jaar',
         avatar: 'Avatar',
+        editor: 'Editor',
     },
     socials: {
         podcast: 'Volg ons op Podcast',
@@ -4299,9 +4300,11 @@ ${amount} voor ${merchant} - ${date}`,
             roleName: (role?: string) => {
                 switch (role) {
                     case CONST.POLICY.ROLE.ADMIN:
-                        return 'Beheerder';
+                        return 'Beheer';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Auditor';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Editor';
                     case CONST.POLICY.ROLE.USER:
                         return 'Lid';
                     default:
@@ -4337,6 +4340,7 @@ ${amount} voor ${merchant} - ${date}`,
             travelInvoicingPayableAccount: 'Reiscrediteurenrekening',
             hr: 'HR',
             rooms: 'Kamers',
+            editorAlternateText: 'Configureer werkruimte-instellingen zonder de onkosten van andere leden te zien.',
         },
         createdForClient: {
             title: 'Je hebt een werkruimte voor je klant aangemaakt!',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index fb15ccba..70a4868e 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -493,6 +493,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: 'Poprzedni rok',
         nextYear: 'W przyszłym roku',
         avatar: 'Avatar',
+        editor: 'Edytor',
     },
     socials: {
         podcast: 'Śledź nas na Podcast',
@@ -4295,6 +4296,8 @@ ${amount} dla ${merchant} - ${date}`,
                         return 'Administrator';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Audytor';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Edytor';
                     case CONST.POLICY.ROLE.USER:
                         return 'Członek';
                     default:
@@ -4330,6 +4333,7 @@ ${amount} dla ${merchant} - ${date}`,
             travelInvoicingPayableAccount: 'Konto zobowiązań z tytułu podróży',
             hr: 'HR',
             rooms: 'Pokoje',
+            editorAlternateText: 'Konfiguruj ustawienia przestrzeni roboczej bez podglądu wydatków innych członków.',
         },
         createdForClient: {
             title: 'Utworzyłeś przestrzeń roboczą dla swojego klienta!',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 018d4b28..c7832bf5 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -492,6 +492,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: 'Ano anterior',
         nextYear: 'Ano que vem',
         avatar: 'Avatar',
+        editor: 'Editor',
     },
     socials: {
         podcast: 'Siga-nos no Podcast',
@@ -4297,6 +4298,8 @@ ${amount} para ${merchant} - ${date}`,
                         return 'Admin';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return 'Auditor';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return 'Editor';
                     case CONST.POLICY.ROLE.USER:
                         return 'Membro';
                     default:
@@ -4332,6 +4335,7 @@ ${amount} para ${merchant} - ${date}`,
             travelInvoicingPayableAccount: 'Conta a pagar de viagens',
             hr: 'RH',
             rooms: 'Salas',
+            editorAlternateText: 'Configure as configurações do espaço de trabalho sem ver as despesas de outros membros.',
         },
         createdForClient: {
             title: 'Você criou um espaço de trabalho para seu cliente!',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 7f51cc44..10041e4f 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -489,6 +489,7 @@ const translations: TranslationDeepObject<typeof en> = {
         previousYear: '上一年',
         nextYear: '明年',
         avatar: '头像',
+        editor: '编辑器',
     },
     socials: {
         podcast: '在播客上关注我们',
@@ -4206,6 +4207,8 @@ ${amount},商户:${merchant} - 日期:${date}`,
                         return '管理员';
                     case CONST.POLICY.ROLE.AUDITOR:
                         return '审计员';
+                    case CONST.POLICY.ROLE.EDITOR:
+                        return '编辑器';
                     case CONST.POLICY.ROLE.USER:
                         return '成员';
                     default:
@@ -4240,6 +4243,7 @@ ${amount},商户:${merchant} - 日期:${date}`,
             travelInvoicingPayableAccount: '差旅应付账户',
             hr: '人力资源',
             rooms: '房间',
+            editorAlternateText: '在不查看其他成员报销的情况下配置工作区设置。',
         },
         createdForClient: {
             title: '您已为客户创建了工作区!',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

… Profile

WorkspaceMembersPage previously bailed to ROUTES.PROFILE whenever the policy
was not isPaidGroupPolicy. Submit (submit2026) workspaces are intentionally
excluded from isPaidGroupPolicy, which made editors unable to reach the
member-details page (and therefore the Role row) for other members.

Add a canManageMembers check that includes Submit workspaces (gated on the
SUBMIT_2026 beta) so editors land on WORKSPACE_MEMBER_DETAILS like they do
on Collect/Control.
The Editor description ("Configure workspace settings without seeing other
members' expenses.") was being truncated to a single line. Match the role
list pattern used elsewhere (e.g. UpdateDelegateRolePage, SelectionScreen)
by setting alternateNumberOfSupportedLines={2}.
Previously the role list on a Submit workspace showed Editor + Member as
options. Picking Member was misleading: the FE override in
addMembersToWorkspace and the backend both force the role back to Editor
on submit2026 policies, so the user got Editor regardless.

Filter Member out alongside Admin/Auditor when the policy is Submit and
the SUBMIT_2026 beta is on — Editor is the only valid role for invites
and role-changes there.
Editor is the only valid role on a Submit workspace, so there's nothing
for the user to choose. Mark the (filtered) Editor item as
isInteractive: false so the row stays visible and informative but no
longer responds to taps.
@abzokhattab

Copy link
Copy Markdown
Contributor Author

@MelvinBot review the changes find regressions or breaking issues

@MelvinBot

Copy link
Copy Markdown
Contributor

PR Review — Potential Regressions & Issues

1. Missing canUseSubmit2026 in two buildAddMembersToWorkspaceOnyxData call sites

Report/index.ts:7686 and IOU/TrackExpense.ts:2229 both call buildAddMembersToWorkspaceOnyxData without passing canUseSubmit2026. They default to false, so members added to Submit workspaces through these paths (e.g. adding a submitter via report action, or adding an accountant during expense tracking) will not get the Editor role override.

The Report/index.ts call is the higher-risk one — it passes CONST.POLICY.ROLE.USER, so on a Submit workspace with the beta enabled, the optimistic data would briefly show the member as "Member" instead of "Editor" until the server corrects it, causing a role flash.

2. Admin role is visible but non-interactive on Submit workspaces

On Submit workspaces (isPolicySubmit2026 = true), the .map() at the end of the filter chain sets isInteractive: false on all remaining items. If the current user is a policy admin (canAssignAdminRole = true), the Admin role passes the filter, so an admin user would see both Admin and Editor — both greyed out / unselectable. This is confusing: either Admin should be filtered out on Submit workspaces, or the list should remain interactive so admins can choose.

3. Unrelated translation changes (not beta-gated)

These rename existing roles for all users, not just Submit workspaces:

  • es.ts: 'Administrador' → 'Admin'
  • nl.ts: 'Beheerder' → 'Beheer'
  • ja.ts: Auditor '監査人' → '監査担当者'

If intentional, they should be called out separately. If accidental, they'll change visible role names for Spanish, Dutch, and Japanese users across all workspace types.

4. zh-hans.ts uses "编辑器" (software editor) instead of "编辑" (person role)

编辑器 means a software editing tool (like a text editor). For a workspace role, the correct term is 编辑 or 编辑者. This affects both common.editor and the roleName switch case.

5. Redundant double role override (minor, not a bug)

addMembersToWorkspace computes effectiveRole and overrides the role to EDITOR, then passes both the already-overridden role and canUseSubmit2026 to buildAddMembersToWorkspaceOnyxData, which computes shouldForceEditorRole and overrides again (no-op). Similarly, shouldAddToAdminsRoom checks shouldForceEditorRole && effectiveRole === CONST.POLICY.ROLE.EDITOR — the second condition is always true when the first is. Not a regression, but makes the code harder to reason about.


Items #1 and #2 are the ones most likely to cause visible regressions. The rest are polish / correctness issues worth addressing before merge.

@codecov

codecov Bot commented May 19, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
src/libs/PolicyUtils.ts 71.60% <ø> (+2.76%) ⬆️
src/libs/actions/Policy/Member.ts 75.62% <87.50%> (+0.94%) ⬆️
src/pages/workspace/MemberRightIcon.tsx 94.44% <50.00%> (+0.69%) ⬆️
...s/workspace/members/WorkspaceMemberDetailsPage.tsx 0.00% <0.00%> (ø)
...orkspace/DynamicWorkspaceInviteMessageRolePage.tsx 0.00% <0.00%> (ø)
src/pages/workspace/WorkspaceMembersPage.tsx 61.03% <50.00%> (+61.03%) ⬆️
...kspace/members/WorkspaceInviteMessageComponent.tsx 0.00% <0.00%> (ø)
... and 332 files with indirect coverage changes

…2026 through changeReportPolicyAndInviteSubmitter

- buildAddMembersToWorkspaceOnyxData is now the single source of truth
  for the editor-role override on Submit workspaces; it returns the
  effective role so addMembersToWorkspace can use it for API params
  without duplicating the conditional.
- Simplify shouldAddToAdminsRoom: shouldForceEditorRole already implies
  effectiveRole === EDITOR, so drop the redundant equality check.
- Thread canUseSubmit2026 from ReportChangeWorkspacePage through
  changeReportPolicyAndInviteSubmitter so moving a report into a
  Submit workspace shows the correct optimistic role (no Member->Editor
  flash).
Admin doesn't exist on Submit workspaces per design — only Editor does.
Previously, if a user's role on a Submit policy happened to be Admin
(e.g. an inconsistent server response), the Admin row would still render
in the role list (just non-interactive after the read-only map). Filter
it out unconditionally on Submit so the list only ever shows Editor.
…; fix zh-hans Editor

The auto-translation diff accidentally renamed pre-existing role names
across other locales. Revert these so this PR only adds the new Editor
strings and doesn't change what existing users see for other roles:
- es: Administrador (keep — was renamed to Admin)
- nl: Beheerder (keep — was renamed to Beheer)
- ja: 監査人 (keep — was renamed to 監査担当者)

Also fix the zh-hans Editor translation:
- common.editor 编辑器 -> 编辑 (编辑器 is a software 'editor', not the
  person role)
- workspace.common.roleName(EDITOR) 编辑器 -> 编辑
- Add EDITOR case to MemberRightIcon so the role badge renders on
  the members list for Submit workspace editors.
- Simplify openMemberDetails routing in WorkspaceMembersPage: use
  canEditWorkspaceSettings (already true for editors) instead of the
  beta-gated canManageMembers, fixing the regression where clicking a
  member row opened the public Profile page instead of
  WORKSPACE_MEMBER_DETAILS.
The beta gates Submit workspace creation; it should not affect the
role list UI of an existing submit2026 workspace. Derive isPolicySubmit2026
directly from isSubmitPolicy(policy) so the Editor-only role list renders
correctly even when the SUBMIT_2026 beta is not active in the current session.
… details

The role is locked to Editor on Submit workspaces — there is nothing
to select. Marking the row as non-interactive (no chevron, no onPress)
prevents accidental navigation to WorkspaceMemberDetailsRolePage.
The full paywall/upgrade redirect for Roles is handled separately in
the Wave 2 paywall-gating issue.
@abzokhattab

abzokhattab commented May 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Observation: workspace creator role on Submit workspaces

Per the design doc, the workspace creator should be an editor (owner), not an admin — the Admin role does not exist on Submit workspaces. Everyone including the creator should have the Editor role.

I noticed that the backend returns:

Screen.Recording.2026-05-19.at.05.43.10.mov

If the backend is returning admin for the creator, this is a backend bug that needs to be fixed in the Wave backend work (CreateWorkspace should set the creator's role to editor for submit2026 workspaces).

@abzokhattab

Copy link
Copy Markdown
Contributor Author

@MelvinBot Review the PR find other issues if any

@MelvinBot

Copy link
Copy Markdown
Contributor

Additional Review Findings

Following up on my earlier review, here are additional issues found on a deeper pass:

6. Missing Editor role badge in members list

WorkspaceMembersPage.tsx:456-463 computes roleBadgeText for Owner, Admin, and Auditor — but has no branch for CONST.POLICY.ROLE.EDITOR. On a Submit workspace, members with the Editor role will show no badge next to their name.

QA step 4 says "verify User B is shown as Editor" — but there's no visual indicator on the members list to confirm this (only the member detail page would show it via roleName).

If this is intentional (matching how USER/Member shows no badge), consider updating the QA steps. If not, add:

} else if (policyEmployee.role === CONST.POLICY.ROLE.EDITOR) {
    roleBadgeText = translate('common.editor');
}

7. No "Editors" option in the role filter dropdown

WorkspaceMembersPage.tsx:559-570 builds roleFilterOptions with All Members, Admins, and Approvers (plus Auditors for Control). There's no Editors filter added for Submit workspaces. The rolePreFilter switch (line 590) also has no case for filtering by Editor.

If all Submit members are Editors, this filter may be unnecessary — but it's a gap if admins exist alongside editors on a Submit workspace and the user wants to filter.

8. updateWorkspaceMembersRole has no Submit workspace guard

Policy/Member.ts:707-718 — unlike addMembersToWorkspace which forces the Editor role on Submit workspaces, updateWorkspaceMembersRole has no equivalent guard. This is mitigated by two UI-level blocks: (a) WorkspaceMemberRoleList sets isInteractive: false on Submit workspaces, and (b) bulk role actions are gated behind isPaidGroupPolicy. But the action itself is unguarded — any programmatic call or future UI path could bypass it.

Things that checked out fine

  • isInteractive: false is properly respected — press, keyboard, and hover are all blocked in BaseGenericPressable and BaseListItem
  • alternateNumberOfSupportedLines={2} is safe — all four role items have alternateText
  • Role draft leaking between workspaces is prevented by policyID-scoped Onyx keys + clearInviteDraft on flow start + cleanup on unmount
  • No stale closure risk with isBetaEnabled in BaseOnboardingWorkspaceInvite — the callback is not memoized
  • Failure handling is fine — failed add-member entries are removed via OfflineWithFeedback, so the role doesn't need explicit reversion

@abzokhattab

abzokhattab commented May 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Backend bug: invited editors' roles reset to Member on re-login

After inviting a member to a Submit workspace (role correctly shows as Editor optimistically), logging out and back in causes the backend to return those members with role: user (Member) instead of role: editor.

Screen.Recording.2026-05-19.at.05.56.55.mov

Looks like its part of the Wave 1 backend task — "Update Policy::shareWithEmployees — always invite users to submit2026 policies as the editor role" — was it already implemented?

#6 — Add Editor case to roleBadgeText in WorkspaceMembersPage so the
accessibility label includes 'Editor' for Submit workspace members
(the visual badge was already correct via MemberRightIcon).

#8 — Guard updateWorkspaceMembersRole against Submit workspaces.
The UI already blocks role changes via isInteractive:false and
isPaidGroupPolicy checks, but the action itself was unguarded.
This closes the gap against future programmatic call sites.
@hungvu193

Copy link
Copy Markdown
Contributor

on it 👀

@hungvu193 hungvu193 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.

NAB comment

const isPolicyAdmin = canEditWorkspaceSettings(policy);
// Paid (Collect/Control) and Submit workspaces allow member management. Submit is gated on the policy type —
// the SUBMIT_2026 beta only controls whether a Submit workspace can be created, not behavior on existing ones.
const canManageMembers = isPaidGroupPolicy(policy) || isSubmitPolicy(policy);

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.

Can we reuse isGroupPolicy?

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.

Yes, let's use that

@hungvu193

hungvu193 commented Jun 5, 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
Screen.Recording.2026-06-05.at.11.06.27.mov
Android: mWeb Chrome
Screen.Recording.2026-06-05.at.11.06.27.mov
iOS: HybridApp
Screen.Recording.2026-06-05.at.11.02.59.mov
iOS: mWeb Safari
Screen.Recording.2026-06-05.at.11.04.24.mov
MacOS: Chrome / Safari
Screen.Recording.2026-06-05.at.10.48.46.mov

@melvin-bot
melvin-bot Bot requested a review from carlosmiceli June 5, 2026 04:05
// invite/manage members but must not be able to escalate anyone to admin.
// Only strict admins can assign the ADMIN role.
const canAssignAdminRole = isPolicyAdmin(policy, currentUserEmail);
const availableRoleItems: ListItemType[] = workspaceRoles.filter((item) => {

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.

NAB what a weird way of doing things: first assemble all options, then filter them out. Would be simpler to conditionally add the roles to the OG array

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.

Good call — I went further and reverted WorkspaceMemberRoleList to main entirely. On Submit workspaces, Roles is paywalled (design doc 2.4.1): both the member-details Role row (tryNavigateToSubmitWorkspaceUpgrade) and the role page (useRedirectSubmitWorkspaceFeatureUpgrade) redirect to the upgrade modal before this list ever renders. So the Editor row here was unreachable dead code. Removed it (and the now-unused editorAlternateText translations). The Editor role is still enforced where it matters — forced in addMembersToWorkspace and the invite default.

const isPolicyAdmin = canEditWorkspaceSettings(policy);
// Paid (Collect/Control) and Submit workspaces allow member management. Submit is gated on the policy type —
// the SUBMIT_2026 beta only controls whether a Submit workspace can be created, not behavior on existing ones.
const canManageMembers = isPaidGroupPolicy(policy) || isSubmitPolicy(policy);

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.

Yes, let's use that

@iwiznia

iwiznia commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

I noticed that the backend returns:

BTW I submitted a PR to fix that https://github.com/Expensify/Web-Expensify/pull/53467

- WorkspaceMembersPage: use isGroupPolicy(policy) for canManageMembers
  (per hungvu193 & iwiznia) instead of isPaidGroupPolicy || isSubmitPolicy.
- WorkspaceMemberRoleList: build the role list by conditionally pushing
  items instead of assemble-then-filter (per iwiznia).
@abzokhattab

Copy link
Copy Markdown
Contributor Author

handled all of the comments @iwiznia

Per review (iwiznia): on Submit the only base role is Editor, so push
Member only in the else branch instead of always.
…lled)

Roles are paywalled on Submit workspaces (doc 2.4.1) — both the member
details and invite Role entry points redirect to the upgrade modal before
the role list renders, so the Editor row was unreachable dead code.
Revert WorkspaceMemberRoleList to main's version and remove the now-unused
editorAlternateText translation from all locales.
@abzokhattab

Copy link
Copy Markdown
Contributor Author

cleaned the unreached code ... rn if the user clicks on the role the upgrade modal would open up then the user has to upgrade the workspace, so the role list would never contain the editor record because it would be upgraded

@iwiznia
iwiznia merged commit 2f14b64 into Expensify:main Jun 5, 2026
35 checks passed
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Jun 5, 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 Jun 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/iwiznia in version: 9.4.0-0 🚀

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

Bundle Size Analysis (Sentry):

@mitarachim

Copy link
Copy Markdown

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

@jponikarchuk

Copy link
Copy Markdown

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

@OSBotify

OSBotify commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.4.0-7 🚀

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.

9 participants