Skip to content

[Submit] Add editor role to the filter for submit workspace - #93022

Merged
iwiznia merged 5 commits into
Expensify:mainfrom
hungvu193:chore-92828
Jun 17, 2026
Merged

iwiznia merged 5 commits into
Expensify:mainfrom
hungvu193:chore-92828

Conversation

@hungvu193

Copy link
Copy Markdown
Contributor

Explanation of Change

Add Editor filter to the dropdown of WorkspaceMemberPage for Submit workspace.

Fixed Issues

$ #92828
PROPOSAL: N/A

Tests

Same as QA steps.

  • Verify that no errors appear in the JS console

Offline tests

Same as QA steps.

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  1. Create a submit workspace and invite some members.
  2. Go to Workspace > Members
  3. Check the filter dropdown.
  4. Verify there's Editor role.
  5. Verify that you can filter Editor with that option.
  • 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

MacOS: Chrome / Safari
Screen.Recording.2026-06-09.at.16.21.02.mov

@hungvu193
hungvu193 marked this pull request as ready for review June 9, 2026 09:28
@hungvu193
hungvu193 requested review from a team as code owners June 9, 2026 09:28
@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and eh2077 and removed request for a team June 9, 2026 09:28
@melvin-bot

melvin-bot Bot commented Jun 9, 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 removed the request for review from a team June 9, 2026 09:28
@hungvu193

Copy link
Copy Markdown
Contributor Author

Sorry for the ping @eh2077. @abzokhattab will handle it.

@codecov

codecov Bot commented Jun 9, 2026 •

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
src/pages/workspace/WorkspaceMembersPage.tsx 61.04% <50.00%> (-0.16%) ⬇️
... and 20 files with indirect coverage changes

@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: 85a6f13322

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

Comment on lines +611 to +612
case WORKSPACE_MEMBER_FILTER_VALUES.EDITORS:
return employee?.role === CONST.POLICY.ROLE.EDITOR;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset editor filter when leaving Submit workspaces

When the reused Members screen switches from a Submit workspace to another workspace after the user selected the new Editor filter, selectedRoleFilter is not reset, but this predicate still applies EDITORS even though the new roleFilterOptions no longer include Editor. In that context the non-Submit member list is filtered to editor-role employees (usually none) and shows an unexpected empty state until the user manually changes the hidden stale filter; reset the role filter on policyID/policy type changes or ignore role values that are not valid for the current options.

Useful? React with 👍 / 👎.

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 is an edge case, after upgrading it will look like this, let me know if we want to fix it:

Screen.Recording.2026-06-09.at.17.07.51.mov

@hungvu193 hungvu193 Jun 9, 2026 •

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.

Similar case when we select Auditor filter and downgrade from Control to collect.

JmillsExpensify
JmillsExpensify previously approved these changes Jun 9, 2026

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

Part of an existing product initiative.

@abzokhattab

Copy link
Copy Markdown
Contributor

I think we should filter out all other types. The list should contain only the editor record, as in a submit workspace, the only role we have is the editor

Copy link
Copy Markdown
Contributor

That's a good point. I agree with that.

@hungvu193

Copy link
Copy Markdown
Contributor Author

I think we should filter out all other types. The list should contain only the editor record, as in a submit workspace, the only role we have is the editor

Which option should we keep? Because Approver also makes sense to me.

Copy link
Copy Markdown
Contributor

Is Approver a special role for the Submit plan? It's not a role on any other plan.

@hungvu193

Copy link
Copy Markdown
Contributor Author

Is Approver a special role for the Submit plan? It's not a role on any other plan.

No. It appears with every plan. The only special role for submit is Editor.

Copy link
Copy Markdown
Contributor

There is no Approver role for any plan.

Copy link
Copy Markdown
Contributor

I think you're just talking about the filter though, right? e.g. in the dropdown we show Approvers even though it's not a role. We're just looking for anyone that is the submitsTo?

@hungvu193

Copy link
Copy Markdown
Contributor Author

We're just looking for anyone that is the submitsTo?

Yep. I believe so.

Screen.Recording.2026-06-11.at.17.40.43.mov

Since Submit workspace will also have submitsTo, do you want to keep it as a filter option?

Copy link
Copy Markdown
Contributor

Ok thanks! Sorry to dig in on that, just wanted to make sure I understand.

Copy link
Copy Markdown
Contributor

All good on my end to add Approver

@garrettmknight
garrettmknight requested review from abzokhattab and iwiznia and removed request for eh2077 June 13, 2026 09:54

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

@abzokhattab

abzokhattab commented Jun 14, 2026 •

Copy link
Copy Markdown
Contributor

Just noticed an issue

The new filter label uses translate('common.editor') → "Editor" (singular), while every other filter in this dropdown uses a pluralized workspace.people.* key: "Admins", "Approvers", "Auditors". For consistency the editor option should use a dedicated workspace.people.editors: 'Editors' key rather than borrowing common.editor.

image

cc @hungvu193

@hungvu193

Copy link
Copy Markdown
Contributor Author

@abzokhattab You're right

@hungvu193

Copy link
Copy Markdown
Contributor Author

@MelvinBot Can you address this comment? Let's add plural version for "Editor"

@MelvinBot

Copy link
Copy Markdown
Contributor

Addressing abzokhattab's comment: the Editor filter option now uses a dedicated pluralized workspace.people.editors key instead of borrowing the singular common.editor, matching the other filters (Admins, Approvers, Auditors).

I've prepared and verified the change locally (lint, prettier, and typecheck all pass — the only remaining typecheck errors are pre-existing in src/libs/API/types.ts and unrelated to this change), but I can't push it (see note at the bottom).

Changes

src/pages/workspace/WorkspaceMembersPage.tsx — use the new plural key for the Submit-policy filter option:

     if (isSubmitPolicy(policy)) {
         roleFilterOptions.push({
-            text: translate('common.editor'),
+            text: translate('workspace.people.editors'),
             value: WORKSPACE_MEMBER_FILTER_VALUES.EDITORS,
         });
     }

src/languages/*.ts — add the new workspace.people.editors key to every locale (alongside auditors):

Locale Value
en Editors
es Editores
de Bearbeiter
fr Éditeurs
it Editori
ja 編集者
nl Bewerkers
pl Edytorzy
pt-BR Editores
zh-hans 编辑者

Note: the English/Spanish strings are authoritative; the non-English strings are my best-effort translations. The generateTranslations GitHub Action will regenerate the non-English locales with the official translator on this PR, so they'll be verified/corrected automatically.


⚠️ I can't push changes to this PR because I didn't open it and I'm not listed as an assignee. To have me make this fix, add me to the PR assignees and then retry your request. Alternatively, you can apply the diff above directly.

@hungvu193

Copy link
Copy Markdown
Contributor Author

@MelvinBot Please try again.

Add a dedicated workspace.people.editors translation key and use it for the
Submit-policy Editor filter option, replacing the singular common.editor so the
filter label matches the other pluralized options (Admins, Approvers, Auditors).

Co-authored-by: Hans Vu <hungvu193@users.noreply.github.com>
@melvin-bot

melvin-bot Bot commented Jun 15, 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

@MelvinBot

Copy link
Copy Markdown
Contributor

Pushed a fix addressing abzokhattab's comment in 1cb189b.

The Editor filter option now uses a dedicated pluralized workspace.people.editors key instead of borrowing the singular common.editor, so it's consistent with the other filters (Admins, Approvers, Auditors). I added the new workspace.people.editors key to all 10 locale files.

Verified locally: lint, prettier, and typecheck pass (the only remaining typecheck errors are pre-existing in src/libs/API/types.ts, unrelated to this change).

Note: the English/Spanish strings are authoritative; the other locales are best-effort translations and will be regenerated by the generateTranslations Action with the official translator.

@abzokhattab

Copy link
Copy Markdown
Contributor

Lgtm

@iwiznia
iwiznia merged commit 6630ce8 into Expensify:main Jun 17, 2026
38 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify OSBotify mentioned this pull request Jun 17, 2026
67 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

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

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — docs update required

This PR adds an Editors option to the role filter dropdown on the Workspace Members page, shown for Submit workspaces. The help article Managing Workspace Members in New Expensify documents the available role filters but was missing this new option.

I created a draft help site PR adding the Editors filter to the "Filter Workspace Members by Role" section, following the existing pattern used for the Auditors and Card Admins entries and matching the live UI label:

➡️ Draft PR: #93867

No other docs reference this filter dropdown, so no further help site changes are needed.

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

@OSBotify

Copy link
Copy Markdown
Contributor

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

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review — no docs changes required

I reviewed this PR's changes against the help site articles under docs/articles.

What this PR does: Adds an Editors option to the role filter dropdown on the Workspace Members page, and adjusts which filters appear per workspace type — for Submit workspaces the dropdown now shows All members, Approvers, and Editors (and no longer shows Admins).

Why no docs update is needed (yet): The new Editors filter only renders for Submit workspaces, and the Editor role is the Submit‑workspace default member role. Both the Submit workspace type and the Editor role are gated behind the SUBMIT_2026 beta and are not generally available. The public help site does not currently document Submit workspaces or the Editor role anywhere, so adding a single "Editors" line to the Managing Workspace Members article would introduce undefined concepts and prematurely expose a beta feature.

The right time to document the Editors filter is when Submit workspaces are documented holistically as part of that feature's GA launch — not as an isolated filter line now.

Evidence
  • Filter is conditional on isSubmitPolicy(policy) — src/pages/workspace/WorkspaceMembersPage.tsx
  • isSubmitPolicy matches CONST.POLICY.TYPE.SUBMIT — src/libs/PolicyUtils.ts
  • Submit access is beta-gated: "We only allow users to access Submit feature if they have the SUBMIT_2026 beta enabled." — src/libs/PolicyUtils.ts
  • In Submit workspaces the default member role is EDITOR — src/libs/actions/Policy/Member.ts, src/pages/workspace/DynamicWorkspaceInviteMessageRolePage.tsx
  • No existing help article references "Submit workspace" or the "Editor" role.

If you'd like me to go ahead and add an Editors entry to the role-filter section anyway (or pre-stage Submit-workspace docs), reply with @MelvinBot create the docs PR and I'll draft it.

@OSBotify

Copy link
Copy Markdown
Contributor

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

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

Bundle Size Analysis (Sentry):

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review — docs PR already exists (superseding my earlier comment)

Correcting my previous comment: a draft help site PR for this change already exists and is the right call, so I did not create a new one.

➡️ Draft docs PR: #93867

It adds an Editors – Shows only members with the Editor role (Submit workspaces only) entry to the "Filter Workspace Members by Role" section of Managing Workspace Members in New Expensify, following the same workspace-type-scoped pattern the article already uses for Auditors and Card Admins (Control workspaces only). That keeps the documented filter list complete and matches the live UI label Editors. No other help articles reference this dropdown.

I withdraw the "no docs changes required" conclusion — it was based on the feature being SUBMIT_2026-beta-gated, but the article already documents scoped, type-specific filters, so a single scoped line for Editors is consistent and low-risk.

@MelvinBot, 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 #93933 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.4.14-1 🚀

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.

8 participants