Skip to content

fix(mobile): PR list menu offers only the actions the host supports - #29873

Open
saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/mobile-pr-action-availability
Open

saphid wants to merge 1 commit into
pingdotgg:mainfrom
saphid:fix/mobile-pr-action-availability

Conversation

@saphid

@saphid saphid commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Problem

On mobile, a pull request row's menu offered Convert to draft, Mark ready for review, Close, and Reopen based only on the PR's state. Hosts support different actions. Bitbucket supports only merge and close. Forgejo has no ready/draft. So a Bitbucket PR offered Convert to draft, and a closed one offered Reopen. Picking either opened a confirm dialog, then failed with "This action isn't available for this pull request."

Web fixed this for its row quick actions in #17774. It reads the per-host actions the server already sends in PullRequestListResult.providers, and falls back to changeRequestActionsWhenUnreported when an older server doesn't report them. Mobile never got the same check.

Change

  • mergeEnvironmentPullRequestPages collects each environment's reported host actions. It does this next to the per-host search support it already collects.
  • New pullRequestListRowActions picks ready/draft/close/reopen from the PR's state, then keeps only what that host supports, with the same fallback web uses.
  • The row menu builds those items from it. Labels, icons, order, and Request review are unchanged.

What the menu offers before and after:

Row main this PR
Bitbucket, open Convert to draft, Close Close
Bitbucket, draft Mark ready, Close Close
Bitbucket, closed Reopen (none)
GitHub, open Convert to draft, Close Convert to draft, Close
GitHub, closed, older server with no reported actions Reopen Reopen

Scope and approval

Very small, focused fix for an obvious bug, so no prior issue: mobile was offering actions that the server rejects for that host, while web already hides them. Overlap search: the local index plus gh search prs for the menu and hook. #25761 also edits usePullRequestListActions.ts, but only the post-action handling in perform, not the menu. #29857 changes the merge method and doesn't touch the list menu.

Verification

  • Red: I swapped pullRequestListRowActions for main's state-only menu logic and ran the new test. It failed with AssertionError: expected [ 'draft', 'close' ] to deeply equal [ 'close' ]. On plain main the test can't run because the helper doesn't exist yet, so the table above shows what main's menu offered.
  • Green: vp test run src/features/pull-requests/pullRequestList.test.ts → 25 passed.
  • vp run check:changed: lint, knip, typecheck (2 packages), tests, and React Compiler passed. Format failed the first time. I fixed it with vp fmt, and vp fmt --check is now clean.
  • Not checked: I didn't drive the native menu on a device.

Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 3, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at ba685b4

Macroscope's review found this PR approvable — Mobile PR menus now hide actions the host does not support, with compatibility fallbacks for older servers. Permission checks, confirmation dialogs, and action execution safeguards remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

The pull request list now collects provider-reported actions by environment and host. The mobile row-action menu uses those reports, or a provider fallback when no report exists, to determine which actions to display.

Changes: Host-aware pull request actions

Layer / File(s) Summary
Collect provider actions and filter row actions
apps/mobile/src/features/pull-requests/pullRequestList.ts, apps/mobile/src/features/pull-requests/pullRequestList.test.ts
The list result includes reported actions keyed by environment and lowercased host. The row-action helper filters state-based actions against reported actions or the provider fallback. Tests cover environment-specific reports and fallback behavior.
Integrate filtered actions into the menu
apps/mobile/src/features/pull-requests/usePullRequestListActions.ts, apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx
The screen passes the host-action map to the hook. The hook uses filtered actions for writable environments, with provider labels and platform-specific icons; the close action is destructive.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested labels: 📱 Native Change, size:M

Suggested reviewers: juliusmarminge, maria-rcks

Merge Risk: Minimal · up to ba685

Mobile menus now use host-reported action support. No verified merge-blocking issue remains.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title names the main change: the mobile PR list menu now offers only the actions the host supports. This matches the raw summary, which adds host-filtered row actions through pullRequestListRowAct…
Description check Passed The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section gives the bug, the affected hosts, and the expected behavior…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the mobile PR list menu now offers only the actions the host supports. This matches the raw summary, which adds host-filtered row actions through pullRequestListRowActions and passes hostActions into usePullRequestListActions. The title is short, specific, and follows conventional commit style.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections. The Problem section gives the bug, the affected hosts, and the expected behavior. The Change section explains the fix and includes a before/after table. The Scope section explains why no prior issue exists and lists overlap checks. The Verification section gives the red/green test evidence and the check results, and it states what was not tested on a device. Minor gap: the template asks for a required approval link or explanation, and the author gives a qualifying explanation for a small obvious bug, which the template accepts. The description is mostly complete.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

ast-grep (0.51.1)

ast-grep could not parse rule config: /ast-grep-rules/ast-grep-essentials/rules/html/security/malformed-erb-end-modifier-html.yml

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between c0ec87a and ba685b4.

Files selected for processing: 4
  • apps/mobile/src/features/pull-requests/PullRequestsScreen.tsx
  • apps/mobile/src/features/pull-requests/pullRequestList.test.ts
  • apps/mobile/src/features/pull-requests/pullRequestList.ts
  • apps/mobile/src/features/pull-requests/usePullRequestListActions.ts

Limit details: You’ve used all 10 included reviews currently available.

This branch has not been deployed

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant