Skip to content

CR-7: state menu, edits and reviewer requests through the gh login (#326) - #415

Closed
BunsDev wants to merge 1 commit into
cr7-mergefrom
cr7-pr-actions
Closed

BunsDev wants to merge 1 commit into
cr7-mergefrom
cr7-pr-actions

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Part of #326, the third of three increments: decisions 2–4, which Val put in scope on 2026-10-25. Stacked on #414 (cr7-merge).

What this adds

  • State menu (C21). The header's state pill becomes a keyboard menu: Close, Reopen, Convert to draft, Ready for review.
    • Each is offered only from a state GitHub allows. A merged PR changes no more.
    • Close and reopen use PATCH pulls/{n} with { state }.
    • Draft and ready use GitHub's two fixed GraphQL mutations, because REST can't change draft state. They are the only GraphQL Modex sends: the transport accepts them text for text, with the PR's node id as the one variable.
  • Edit pull request (C31, C35). One form for the title and description.
    • Only the changed fields are sent.
    • Main refuses the edit if GitHub's text differs from what it was made from, at preview and at submit. The pane then reads the PR again.
  • Request reviewers (C38, C43). Logins only. The PR's author and the signed-in account are refused, and GitHub's 422 is shown as a refusal.
  • Permission, read fresh at preview and again at submit: push, triage or authorship, as GitHub grants each. The head, target and gh login must be unchanged, and unreadable permission is a refusal.
  • Unclear outcomes stay unknown and block the PR. Check GitHub confirms one only if the PR shows exactly the requested state, text or reviewers. That proves the outcome, not who caused it.
  • capabilities() lets edit, request-reviewers and state follow the connection; only [CR-6][P1] Add native AI review, PR questions and scoped review instructions #325's controls stay unavailable.
  • The docs also correct CR-7: merge the reviewed head through the gh login (#326) #414's leftovers in the control inventory (C29, D10).

Validation

  • pnpm build && pnpm test && pnpm test:e2e: exit 0.
    • Desktop unit: 1,978 passed, 17 skipped.
    • Other unit suites: 180 passed, 5 skipped.
    • Desktop E2E: 464 passed, 7 skipped.
    • Site E2E: 7 passed.
  • Red first: the model test failed before the model change.
  • New tests:
    • 2 model tests;
    • 7 service unit tests;
    • a static guard pinning every mutation: the POST, PUT and PATCH allowlists, two fixed GraphQL mutations, the PATCH keys and the call counts. It forbids DELETE, labels, assignees and team reviewers.
    • 4 Electron journeys:
      • the state menu, with Escape, close (double click), reopen and draft;
      • an edit conflict, then a re-read and a title-only save;
      • reviewer rules and a request;
      • a 502 that stays in doubt until reconciled.
  • Found and fixed: a .cr-menu CSS class collision with the inbox header, caught by the 900×600 layout check.
  • Mock and synthetic gh only. No live action was run on any real PR.

Limits: GitHub has no precondition on a PATCH, so an edit made in the moment between main's check and its PATCH would still be overwritten. Reviewer requests can't be withdrawn, and team reviewers aren't offered.

Evidence: docs/reviews/2026-10-25-cr7-pr-actions.md. Design: docs/design/code-review.md (CR-7 state, edits and reviewers).

Please don't merge without Val's go-ahead.

🤖 Generated with Claude Code

)

Decisions 2-4, put in scope by Val on 2026-10-25, as the third write
increment on code-review:write.

- The state pill is a menu: close, reopen, convert to draft, ready for
  review, only from the states GitHub allows. Close and reopen PATCH the PR;
  draft and ready are GitHub's two fixed GraphQL mutations, the only GraphQL
  sent, matched text for text with the node id as the one variable.
- Edit pull request: the title and description in one form. Only changed
  fields are sent, and main refuses the edit if GitHub's text changed since
  it was read; the PR is then read again.
- Request reviewers by login; never the author or oneself.
- Permission (push, triage or authorship as GitHub grants it), head, target
  and login are read again at preview and at submit. An unclear change
  stays unknown until the PR shows it.
- Unit, IPC guard and Electron coverage against a synthetic gh. No live run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 25, 2026 11:59pm UTC

Request Review

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

cr7-merge a10fcc4 cr7-pr-actions 0befa33 +/-
65% 65% 0%
View coverage of the 10 most impacted files.
File cr7-merge a10fcc4 cr7-pr-actions 0befa33 +/-
apps/desktop/sr...ions/intents.ts 100% 99% -1%
apps/desktop/sr...ain/commands.ts 87% 87% 0%
apps/store-desk...rc/main/demo.ts 95% 95% 0%
apps/desktop/sr.../code-review.ts 100% 100% 0%
apps/desktop/sr...review/patch.ts 98% 98% 0%
apps/desktop/sr...ecovery-file.ts 100% 100% 0%
apps/desktop/sr...rite-service.ts 0% 96% +96%
apps/desktop/sr...review-write.ts 0% 100% +100%
apps/desktop/sr...ons/write-gh.ts 0% 100% +100%
apps/desktop/sr...ge-preflight.ts 0% 100% +100%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

BunsDev commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #416, now verified merged as b3aad0d85b91f479d5415abdec15d9f74a5dd61c. Protected queue run 40420085521 passed (468 desktop tests, 4 skips, 7 site tests). Git's clean merge of reviewed integration head fffd07ec7006347142453217e6bdf899373ff31d onto the squash parent produces the exact landed tree.

This PR's published head is an ancestor of the reviewed integration head. The integration includes the reviewed write-race and uncertainty repairs. This closure records supersession, not live-write or human acceptance of #326. Your source worktree remains protected; no owner release or deletion is performed here.

@BunsDev BunsDev closed this Oct 27, 2026

This branch was successfully deployed

1 active deployment
Preview — 0befa332 Deployed Oct 25, 2026 by vercel[bot]
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