Skip to content

[Payment due @nkdengineer] Add Guest workspace role - #97644

Merged
mountiny merged 56 commits into
Expensify:mainfrom
ShridharGoel:feat/guest-workspace-role
Oct 8, 2026
Merged

mountiny merged 56 commits into
Expensify:mainfrom
ShridharGoel:feat/guest-workspace-role

Conversation

@ShridharGoel

@ShridharGoel ShridharGoel commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds Guest as a Control workspace role. Guests can submit and approve reports, use #announce, open public rooms by direct link, and use chats shared with them. Guests cannot browse workspace members or participant details in #announce. The Rooms page shows guests only the chats shared with them and does not load the full room directory.

Guest appears only in Control workspace role selectors. This PR also adds translated role text, optimistic role updates, FullStory typing, navigation guards, participant UI guards, and regression tests.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/666136
PROPOSAL:

Tests

  1. Sign in as an admin of a Control workspace.
  2. Open the workspace Members page and invite a member.
  3. Verify Guest appears in the role selector with the correct name and description.
  4. Change an existing member to Guest and verify the role updates without stale member data.
  5. Sign in as the Guest and verify the workspace overview opens.
  6. Verify Members does not appear in workspace settings.
  7. Sign in as the Guest and open the Rooms page. Verify it loads and lists only chats shared with the Guest (for example, their expense chat).
  8. Open #announce and verify participant avatars, count, and participant navigation are hidden.
  9. Open a room or group chat shared with the Guest and verify its participants are visible.
  10. Open a public room by direct link and verify the room opens.
  11. Search for an unshared workspace room or policy-only member and verify no result appears.
  12. Enter the email address of an user when creating a new chat, and verify it can still be selected.
  13. Open a Collect workspace role selector and verify Guest does not appear.
  14. Verify the same steps when adding a new user directly as a guest (instead of changing an existing user to guest).
  15. Verify a guest sees only the profile and Rooms items in the workspace.
  16. Verify that for a guest, the Create button is hidden on Rooms in the workspace settings.
  17. Guest workspaces don't appear under FAB > Start chat > Room.
  • Verify that no errors appear in the JS console

Offline tests

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 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 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)
  • 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)
  • 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 the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • 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-09-29.at.6.35.29.PM.mov
Screen.Recording.2026-09-29.at.6.36.15.PM.mov

@melvin-bot

melvin-bot Bot commented Aug 2, 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

@ShridharGoel ShridharGoel changed the title [CFI] Add Guest workspace role [HOLD] Add Guest workspace role Sep 7, 2026
@melvin-bot

melvin-bot Bot commented Sep 29, 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 bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Sep 29, 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/CONST/index.ts 95.86% <ø> (ø)
src/components/RoomHeaderAvatars.tsx 35.41% <100.00%> (ø)
src/components/WorkspaceMemberRoleList.tsx 21.42% <ø> (ø)
src/libs/Fullstory/utils.ts 89.53% <100.00%> (+3.01%) ⬆️
src/libs/PolicyUtils/getHighestPolicyRole.ts 100.00% <100.00%> (ø)
src/libs/PolicyUtils/index.ts 88.77% <100.00%> (-0.30%) ⬇️
src/libs/PolicyUtils/permissions.ts 100.00% <100.00%> (ø)
src/libs/ReportUtils.ts 88.03% <100.00%> (+<0.01%) ⬆️
src/libs/telemetry/TelemetrySynchronizer.ts 100.00% <100.00%> (ø)
...tailsPage/ReportDetailsMenuMembersOrInviteItem.tsx 95.55% <100.00%> (+0.20%) ⬆️
... and 12 more
... and 188 files with indirect coverage changes

@ShridharGoel
ShridharGoel marked this pull request as ready for review September 29, 2026 15:03
@ShridharGoel
ShridharGoel requested review from a team as code owners September 29, 2026 15:03
@melvin-bot
melvin-bot Bot requested review from nkdengineer and removed request for a team September 29, 2026 15:03
@ShridharGoel ShridharGoel changed the title [HOLD] Add Guest workspace role Add Guest workspace role Sep 29, 2026
@melvin-bot

melvin-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

@nkdengineer 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 September 29, 2026 15:03
Comment thread src/libs/Fullstory/utils.ts Outdated
@nkdengineer

Copy link
Copy Markdown
Contributor

@ShridharGoel please check AI review comment and ask someone to run translation workflow.

Comment thread src/libs/PolicyUtils.ts Outdated
Comment thread src/libs/PolicyUtils.ts Outdated
Comment thread src/pages/DynamicReportParticipantsPage.tsx Outdated
Comment thread src/pages/DynamicReportDetailsPage.tsx Outdated
@OSBotify

This comment has been minimized.

@nkdengineer

Copy link
Copy Markdown
Contributor

Test is failing.

@nkdengineer

Copy link
Copy Markdown
Contributor

@ShridharGoel, the Member row is showing again in the #announce room for Guest. Look like a mistake when resolving conflicts.

Screenshot 2026-10-08 at 11 44 15

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

Thanks for following through with this!! 👏 :shipit:

@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Just noticed a bug with our scoped admins project while testing this PR.

CleanShot 2026-10-08 at 12 02 57@2x

We need to update these templates so we're not passing the code.

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

Everything else looks good! Thanks

@mountiny

mountiny commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Looks like everything is ready to merge this one and Flo is out sick. Nice job @nkdengineer @ShridharGoel !

@mountiny
mountiny merged commit 2f59d1f into Expensify:main Oct 8, 2026
37 of 39 checks passed
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Oct 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 mentioned this pull request Oct 8, 2026
90 tasks done
@OSBotify

OSBotify commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.6-0 🚀

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

@MelvinBot

MelvinBot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

A help site update is needed. I opened a draft PR: Docs updates for E/A#97644 Add Guest role to Managing Workspace Members article.

Guest is a new role, and it isn't behind a beta. Its People admin rules also made four sentences in Managing Workspace Members in New Expensify wrong. For example: "People admins can only invite members as Members or Auditors." People admins can now also invite, remove, and assign Guests.

The docs PR makes these edits:

  • Adds Guest to the role list, using the in-app description "Submit reports with limited visibility."
  • Adds Guests to the role filter list.
  • Adds Guests to the four People admin sentences.

I took the labels from the merged English strings. I couldn't check them in the live UI because the test session couldn't sign in.

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


view run · no recording available

@nlemma

nlemma commented Oct 8, 2026

Copy link
Copy Markdown

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

@nlemma

nlemma commented Oct 8, 2026

Copy link
Copy Markdown

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

@jponikarchuk

Copy link
Copy Markdown

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

@mountiny mountiny mentioned this pull request Oct 9, 2026
38 tasks
@OSBotify

OSBotify commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.6-6 🚀

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

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #103658

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.