Skip to content

PM-4954: Hide copilot billing details modal when flag is off#1802

Merged
jmgasper merged 1 commit into
devfrom
PM-4954-2
May 4, 2026
Merged

PM-4954: Hide copilot billing details modal when flag is off#1802
jmgasper merged 1 commit into
devfrom
PM-4954-2

Conversation

@jmgasper

@jmgasper jmgasper commented May 4, 2026

Copy link
Copy Markdown
Collaborator

What was broken
The previous PM-4954 fix added the project displayMemberPaymentDetailsToCopilots flag and hid copilot payment amounts when the flag was off.
QA reported on 2026-05-04 that in dev, flag-off copilot users could still see the button that opens the billing account details modal.

Root cause
The amount display used the project-level visibility gate, but the billing account details modal buttons still only checked the global modal feature flag and the presence of a billing account id.

What was changed
Gate the billing account details modal buttons in both project rows and project detail notices with the same project-level copilot payment visibility decision.
Prevent those hidden modal entry points from fetching or rendering billing account details when the flag is off for restricted copilot users.
Keep admin, manager, and flag-enabled copilot behavior unchanged.

Any added/updated tests
Updated ProjectsTable and ProjectBillingAccountExpiredNotice coverage so flag-off copilots no longer see or open the billing account details modal.

Validation
Passed: yarn lint
Passed: yarn test --watchAll=false src/apps/work/src/lib/components/ProjectBillingAccountExpiredNotice/ProjectBillingAccountExpiredNotice.spec.tsx src/apps/work/src/lib/components/ProjectsTable/ProjectsTable.spec.tsx
Passed: yarn run build
Full suite note: yarn test --watchAll=false is blocked by existing ChallengeEditorForm.spec.tsx launch/budget-approval failures, and the same spec reproduces those failures when run by itself.

What was broken
Copilot users with displayMemberPaymentDetailsToCopilots disabled no longer saw inline member payment balances, but the billing account details icon still rendered on project rows and project detail pages.

Root cause
The prior PM-4954 fix gated payment amounts with the project flag, but the modal entry points still only checked the global billing details feature flag and a billing account id.

What was changed
Gate both project-list and project-detail billing account details buttons with the same per-project payment visibility decision used for copilot amounts.
Prevent hidden modal entry points from fetching or rendering billing account details when the project flag is off for restricted copilot users.
Leave admin, manager, and flag-enabled copilot visibility unchanged.

Any added/updated tests
Updated ProjectsTable and ProjectBillingAccountExpiredNotice coverage so flag-off copilots no longer see or open the billing account details modal.
@jmgasper jmgasper requested a review from kkartunov as a code owner May 4, 2026 06:30
@jmgasper jmgasper merged commit 63bcfd8 into dev May 4, 2026
8 checks passed
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.

1 participant