Skip to content

[Due for payment 2026-11-14] [Category Visibility] 1.6 [EC][App] Add Category visibility row and category picker to member details, behind the beta #105081

Closed

Description

@chiragsalian

Here is the,

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[] to CategoryUtils.ts. It returns the enabled categories whose visibleTo is null or contains accountID.
  • In WorkspaceMemberDetailsPage.tsx, add a "Category visibility" row below Role:
    • Shown only when isBetaEnabled(CONST.BETAS.CATEGORY_VISIBILITY), isControlPolicy(policy) and policy.areCategoriesEnabled are 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 like WORKSPACE_MEMBER_DETAILS_ROLE.
  • Add WorkspaceMemberCategoryVisibilityPage.tsx, a searchable multi-select of the workspace's enabled categories, built like AddCategoryToMatchPage.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[]) to actions/Policy/Category.ts, which calls WRITE_COMMANDS.SET_POLICY_MEMBER_CATEGORY_VISIBILITY:
    • Optimistically merges each category's new visibleTo with pendingFields.visibleTo. A category whose visibleTo is null becomes every member in policyMemberAccountIDs except those being restricted away from it.
    • On failure, restores the previous visibleTo and sets errors on the affected categories.

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 WorkspaceMemberCategoryVisibilityPage first renders its list, using startSpan and endSpan from libs/telemetry/activeSpans.ts. Cancel it if the admin leaves before then.
  • Add it to the P95 Vital Metrics dashboard.
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. self-assigned this
    on Oct 26, 2026
  2. self-assigned this
    on Oct 27, 2026
  3. nkdengineer commented on Oct 27, 2026

    @nkdengineer
    Contributor

    Assigned myself here as I'm implementer on this.

  4. self-assigned this
    on Oct 27, 2026
  5. daledah commented on Oct 27, 2026

    @daledah
    Contributor

    I'm assigning myself as the C+ reviewer for this one

  6. mitarachim commented on Nov 6, 2026

    @mitarachim

    Deploy Blocker #106206 was identified to be related to the PR #105184 that attempted to fix this issue.

  7. mitarachim commented on Nov 6, 2026

    @mitarachim

    Deploy Blocker #106213 was identified to be related to the PR #105184 that attempted to fix this issue.

  8. 5 remaining items

  9. daledah commented on Nov 9, 2026

    @daledah
    Contributor

    Deploy Blocker #106206 was identified to be related to the PR #105184 that attempted to fix this issue.

    Feature is behind a beta. I think the auth command to save category wasn't live yet. Either way, we'll test this all at the end. I'll close this issue since we'll test the full flow at the end and fix any issues that we notice.

    Not a blocker, since the RCA is that the auth command to save the category wasn’t live yet.

    Deploy Blocker #106213 was identified to be related to the PR #105184 that attempted to fix this issue.

    If it was the main issue here then yes i agree its not a bug.

    Not a bug because we can’t scroll from the Select all label

  10. daledah commented on Nov 9, 2026

    @daledah
    Contributor

    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:

    1. As a Control workspace admin on the beta, open a member's details and confirm the "Category visibility" row shows "All categories".
    2. Open it, uncheck all but two categories, save, and confirm the row shows "2 categories".
    3. Reopen it, check every category, save, and confirm the row shows "All categories" again.
    4. Uncheck every category, save, and confirm the "Members must have at least one category" modal shows and nothing is saved.
    5. Sign in as an admin not on the beta and confirm the row isn't shown.
    6. Repeat step 2 offline, and confirm the change shows as pending and saves when back online.
    7. Restrict a member to one category, turn that category's Enabled toggle off on the Categories page, and confirm the modal lists the member's email and the category stays enabled.
    8. Repeat from the category's settings page, and with the bulk Disable action, and confirm the same modal.
    9. Restrict 4 members to the same single category, disable it, and confirm the modal lists 3 emails and "and 1 more".
    10. Restrict a member to two categories, disable one, and confirm it's disabled with no modal.
    11. Go offline, restrict a member to one category, then try to disable that category, and confirm the same modal shows without any network request.

    Do we agree 👍 or 👎

  11. mallenexpensify commented on Nov 12, 2026

    @mallenexpensify
    Contributor

    Proposing to pay here cuz the PR is linked to this issue and the above (and the above has an earlier pay date)

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Nov 13, 2026
  13. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  15. mallenexpensify commented on Nov 15, 2026

    @mallenexpensify
    Contributor

    Closing, paid here

  16. melvin-bot commented on Nov 16, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringImprovementItem broken or needs improvement.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions