Repository navigation
Closed
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionDailyKSv2KSv2EngineeringImprovementItem broken or needs improvement.Item broken or needs improvement.
Description
Here is the,
- Parent GH tracking issue - https://github.com/Expensify/Expensify/issues/673366
- Design doc - https://docs.google.com/document/d/1FuiUnLfrGz4lrmnb2naCDMY0j-ghmQOklNVcyzkBzBI/edit?tab=t.0#heading=h.n3aq8gyvqnyb
Before starting: review your section of the design doc first. If it has any pending comments, let's discuss them before work begins so everyone is on the same page.
PURPOSE
Admins on the beta can restrict which categories a member can use, from that member's details page. See the mocks in the high-level Release 1, Step 1.
SOLUTION
- Add
CONST.BETAS.CATEGORY_VISIBILITY: 'categoryVisibility'. - Add
getMemberVisibleCategoryNames(policyCategories: PolicyCategories, accountID: number): string[]toCategoryUtils.ts. It returns the enabled categories whosevisibleToisnullor containsaccountID. - In
WorkspaceMemberDetailsPage.tsx, add a "Category visibility" row below Role:- Shown only when
isBetaEnabled(CONST.BETAS.CATEGORY_VISIBILITY),isControlPolicy(policy)andpolicy.areCategoriesEnabledare all true. - Subtitle: "All categories" when the member can see every enabled category, otherwise "N categories".
- Opens the new
ROUTES.WORKSPACE_MEMBER_DETAILS_CATEGORY_VISIBILITY(workspaces/:policyID/members/:accountID/category-visibility), registered likeWORKSPACE_MEMBER_DETAILS_ROLE.
- Shown only when
- Add
WorkspaceMemberCategoryVisibilityPage.tsx, a searchable multi-select of the workspace's enabled categories, built likeAddCategoryToMatchPage.tsx:- Pre-checks the member's visible categories, so every category is checked when they're unrestricted.
- Saving with nothing checked shows a "Members must have at least one category" modal, like
cannotDeleteOrDisableAllCategories, and doesn't call the API. - Saving otherwise calls the new action and goes back to the member details page.
- Add
setPolicyMemberCategoryVisibility(policyID: string, accountIDs: number[], categories: string[], policyCategories: PolicyCategories, policyMemberAccountIDs: number[])toactions/Policy/Category.ts, which callsWRITE_COMMANDS.SET_POLICY_MEMBER_CATEGORY_VISIBILITY:- Optimistically merges each category's new
visibleTowithpendingFields.visibleTo. A category whosevisibleToisnullbecomes every member inpolicyMemberAccountIDsexcept those being restricted away from it. - On failure, restores the previous
visibleToand setserrorson the affected categories.
- Optimistically merges each category's new
MANUAL TEST STEPS
- As a Control workspace admin on the beta, open a member's details and confirm the "Category visibility" row shows "All categories".
- Open it, uncheck all but two categories, save, and confirm the row shows "2 categories".
- Reopen it, check every category, save, and confirm the row shows "All categories" again.
- Uncheck every category, save, and confirm the "Members must have at least one category" modal shows and nothing is saved.
- Sign in as an admin not on the beta and confirm the row isn't shown.
- Repeat step 2 offline, and confirm the change shows as pending and saves when back online.
SENTRY METRIC
- Add
CONST.TELEMETRY.SPAN_OPEN_MEMBER_CATEGORY_VISIBILITY: 'ManualOpenMemberCategoryVisibility'. - Start it when the admin taps the "Category visibility" row, and end it when
WorkspaceMemberCategoryVisibilityPagefirst renders its list, usingstartSpanandendSpanfromlibs/telemetry/activeSpans.ts. Cancel it if the admin leaves before then. - Add it to the P95 Vital Metrics dashboard.
Issue Owner
Current Issue Owner: @mallenexpensifyMetadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionDailyKSv2KSv2EngineeringImprovementItem broken or needs improvement.Item broken or needs improvement.
Activity
nkdengineer commentedon Oct 27, 2026
Assigned myself here as I'm implementer on this.
daledah commentedon Oct 27, 2026
I'm assigning myself as the C+ reviewer for this one
mitarachim commentedon Nov 6, 2026
Deploy Blocker #106206 was identified to be related to the PR #105184 that attempted to fix this issue.
mitarachim commentedon Nov 6, 2026
Deploy Blocker #106213 was identified to be related to the PR #105184 that attempted to fix this issue.
5 remaining items
daledah commentedon Nov 9, 2026
Not a blocker, since the RCA is that the auth command to save the category wasn’t live yet.
Not a bug because we can’t scroll from the Select all label
daledah commentedon Nov 9, 2026
Contributor+ Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: N/A, new feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
mallenexpensify commentedon Nov 12, 2026
Proposing to pay here cuz the PR is linked to this issue and the above (and the above has an earlier pay date)
melvin-bot commentedon Nov 13, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Nov 13, 2026
Payment Summary
Resolving PRs:
feat: Add Category visibility row and category picker to member details and show an error when disabling a category would leave members without categories #105184
Reviewer: @nkdengineer owed $175 via NewDot
Reviewer: @daledah owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Nov 15, 2026
Closing, paid here
melvin-bot commentedon Nov 16, 2026
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.