Skip to content

Fix: hide merge section for users without push access#122

Merged
stylessh merged 3 commits intomainfrom
stylessh/hide-merge-no-access
Apr 14, 2026
Merged

Fix: hide merge section for users without push access#122
stylessh merged 3 commits intomainfrom
stylessh/hide-merge-no-access

Conversation

@stylessh
Copy link
Copy Markdown
Owner

Summary

When a user doesn't have push/admin permissions on a repository, the merge button section was shown disabled with a "You don't have permission" message. This hides the entire merge footer instead, reducing noise for read-only users.

Changes

  • Return null early from MergeFooter when canMerge is false, hiding the merge button, strategy dropdown, and bypass option entirely
  • Remove the now-unreachable "no permission" text message

Test Plan

  • Open a PR in a repo where you have push access — merge section should render normally
  • Open a PR in a repo where you only have read access — merge section should not appear at all

Screenshots

Before After
Disabled merge button with "You don't have permission to merge this pull request." message Merge footer section hidden entirely

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 14, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
diffkit 816e9a3 Apr 14 2026, 10:03 PM

- Add inline commit message form when merging (title + extended description, pre-filled from first commit)
- Add close/reopen PR button next to send in comment box
- Add updatePullState server function
- Pass commitTitle and commitMessage through to GitHub merge API
- Add empty state in reviews section when no reviewers added
- Style commit form with surface background to match other sections
Remove client-side guesswork from bypass logic. Now only uses
server-derived isMergeBlocked, canBypassProtections, and hasConflicts.
No auto-bypass — user must explicitly opt in. Bypass hidden for
conflicts since GitHub rejects those regardless of permissions.
@stylessh stylessh merged commit 863b941 into main Apr 14, 2026
4 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