ref:main

fix(pr): make draft observable and echo edit results; drop clippy suppression #31

merged colechristensen cole.christensen@gmail.com wants to merge fix/316-pr-edit-review-fixes into main

Closes #316 (fangorn/anvil)

Follow-up review fixes for the merged `anvil pr edit` work (#315 CLI).

🟠 Draft was write-only

The CLI could set `is_draft` but never read it back. Now:

  • The `PullRequest` struct carries `is_draft` (and `mergeable`).
  • `pr view` prints a `Draft: yes/no` detail.
  • `pr list` appends a `[draft]` marker to the title cell.

Echo what changed

`edit` now deserializes the PATCH response (was `let _resp`) and echoes:

  • `Draft: yes` / `no — marked ready for review`
  • after a base repoint, the server’s recorded `Base` + the recomputed `Mergeable`
  • honors `–json` by printing the raw response

DX — clippy

Replace `edit()`’s seven positional args with an `EditArgs` struct and drop `#[allow(clippy::too_many_arguments)]`. Adds `parse_pr` unit tests (bare object, `pull_request`/`data` envelopes, missing fields).

Dependency

The `pr list` `[draft]` marker depends on the server list serializer exposing `is_draft` — companion PR fangorn/anvil #180.

Local: `cargo test` → 131 passed; `cargo fmt –check` clean; `cargo clippy –all-targets – -D warnings` clean.

🤖 Generated with Claude Code

Created Jun 07, 2026 at 01:16 UTC | Merged Jun 10, 2026 at 04:00 UTC by colechristensen cole.christensen@gmail.com