Skip to content

PM-4988: Hide project header edit for copilots#1803

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

PM-4988: Hide project header edit for copilots#1803
jmgasper merged 1 commit into
devfrom
PM-4988-1

Conversation

@jmgasper

@jmgasper jmgasper commented May 4, 2026

Copy link
Copy Markdown
Collaborator

What was broken
The earlier PM-4988 fix hid project edit affordances in the projects list and blocked the edit route, but copilot users could still see the pencil edit link in project-scoped page headers such as Challenges, Users, and Assets.

Root cause
Those header title actions still used the broader project management permission check. Copilot project membership is allowed by that helper for other write flows, but project detail editing requires the narrower Full Access edit check.

What was changed
Updated the project header edit links on the Challenges, Users, and Assets tabs to render only when the loaded project passes checkCanEditProjectDetails. Kept the existing broader manage permission for non-detail workflows such as member, asset, challenge, and billing notice behavior.

Any added/updated tests
Added page coverage for hiding the project header edit link when a copilot can manage the project but cannot edit project details, and for keeping the link visible when detail editing is allowed.

Validation run
PASS: yarn test:no-watch src/apps/work/src/pages/challenges/ChallengesListPage/ChallengesListPage.spec.tsx src/apps/work/src/pages/assets/ProjectAssetsPage/ProjectAssetsPage.spec.tsx src/apps/work/src/pages/users/UsersManagementPage/UsersManagementPage.spec.tsx
PASS: yarn lint
PASS: yarn run build
FAIL: yarn test:no-watch still fails in the existing src/apps/work/src/pages/challenges/ChallengeEditorPage/components/ChallengeEditorForm.spec.tsx suite. The repeated failures are budget-approval launch expectations, for example launch tests now receive "Challenge launch is blocked until budget approval is Approved." instead of calling patchChallenge or returning the older billing/AI workflow messages. This suite also fails when run by itself and is outside the PM-4988 project header edit scope.

What was broken
The earlier PM-4988 fix hid project edit affordances in the projects list and blocked the edit route, but copilot users could still see the pencil edit link in project-scoped page headers such as Challenges, Users, and Assets.

Root cause
Those header title actions still used the broader project management permission check. Copilot project membership is allowed by that helper for other write flows, but project detail editing requires the narrower Full Access edit check.

What was changed
Updated the project header edit links on the Challenges, Users, and Assets tabs to render only when the loaded project passes checkCanEditProjectDetails. Kept the existing broader manage permission for non-detail workflows such as member, asset, challenge, and billing notice behavior.

Any added/updated tests
Added page coverage for hiding the project header edit link when a copilot can manage the project but cannot edit project details, and for keeping the link visible when detail editing is allowed.
@jmgasper jmgasper requested a review from kkartunov as a code owner May 4, 2026 06:44
@jmgasper jmgasper merged commit 369f1e9 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