Skip to content

Turn a new commit into a /feature or /bug issue, as the web does - #22

Merged
simonhamp merged 1 commit into
mainfrom
feat/issue-commands
Oct 19, 2026
Merged

simonhamp merged 1 commit into
mainfrom
feat/issue-commands

Conversation

@simonhamp

@simonhamp simonhamp commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Brings the web's /feature and /bug commands to the compose sheet. On the web they turn a new commit's draft into a public issue on nunomaduro/dev-null.sh, opened by devnull's GitHub App and crediting you. Quotes and replies don't have them on the web, so they don't here either.

The API side is nunomaduro/dev-null.sh#653 (POST /api/v1/issues). Until that's on production, opening an issue fails, but nothing else changes.

What it does

  • Typing /feature or /bug and a space at the start of a new commit turns it into an issue, without the command. A badge with the command and an X goes over the field, with "Public issue on nunomaduro/dev-null.sh, crediting you" beside it. The field takes the web's Markdown template as its placeholder (# Bug title, ## Steps and so on; devnull takes a first # heading as the title) and Open issue takes Commit's place. The X turns it back into a commit, keeping what you wrote.
  • While the draft is only a slash and the start of a command, the web's menu lists the commands it could become. Tapping one starts that issue, empty.
  • A plain draft that mentions a bug or a feature gets the web's hint ("Found a bug in /dev/null?", Use /bug). Its X stops the hints on this phone, as the web stops them in that browser.
  • Open issue sends the draft in the background, with the button spinning. Once it's open the draft goes and the sheet says "Opened issue #123." with View issue and Done, which is what the web's toast says and offers. If the sheet was swiped away first, a toast says it instead.
  • If it isn't opened, the draft stays an issue with the reason under it. devnull's own message when it sends one (the hourly limit, GitHub refusing or not answering). Otherwise the web's wording, which says to check upstream before retrying, for a dropped connection or an error page with no code.
  • The Lightbulb and Bug icons are Lucide's, drawn like the others from resources/icons.

The matching rules (what counts as a typed command, which drafts get the menu or the hint) are ported from the web's issue-commands.ts, and IssueCommandTest runs the web's own test cases against them.

The menu without focus events

The web opens its command menu only while the composer has focus (#528 upstream), so a lone slash restored from the stash doesn't pop it open. EDGE doesn't tell PHP when a field gains or loses focus, so here the menu waits until you've typed in the sheet since it opened. The field is focused as soon as the sheet opens and it's the only place in the sheet to type, so in practice that's the same rule: a restored slash opens the menu at your next keystroke, not on its own.

Worth checking

  • Put Cancel and Commit in a bar at the top of the commit sheet #19 moves Commit into a bar at the top of this sheet. Whichever of the two lands second needs a rebase, and Open issue should go in that bar in Commit's place.
  • The web turns the commands off while a draft has images, a poll or a schedule, and hides those buttons while it's an issue. The app has none of those yet. DraftsIssues::canDraftIssue() is where that check goes when they arrive.
  • The web refuses to open an issue while its secret scanner flags something in the draft. The app has no secret scanner for commits either, so there's no such check here yet.
  • The web now sends browser and screen details with each issue (upstream #544), and its badge says so. #653 takes the same environment field, but the app doesn't send device details yet, so its badge still just says "crediting you".

Screenshots

From an iOS simulator against #653's branch, through a Cloudflare tunnel, with GitHub stubbed so no real issues were filed.

Menu /bug typed /feature picked
Hint GitHub said no Opened

Screenshots live on the issue-commands-screenshots branch. Delete it after merge.

Testing

Rebased onto main after Remotes (#25), the image cache (#27) and the dashed borders (#21). 951 tests pass and Pint is clean. New tests cover typing each command, the menu and when it opens, the hint and dismissing it, going back to a commit, quotes staying commits, the length limits, opening an issue with the spinner and the receipt, View issue, a swiped-away sheet, and each kind of failure.

On the simulator I checked the menu, typing /bug , picking /feature from the menu, the hint's Use /bug on a restored draft, opening both kinds of issue, View issue in the in-app browser, and GitHub refusing one. After the rebase it's also on Simon's iPhone, against the same API with the Remotes API merged in.

Closes the idea board's to-do #312.

🤖 Generated with Claude Code

Typing /feature or /bug and a space at the start of the compose sheet turns
the draft into an issue, with the web's badge, placeholders and Open issue.
A slash offers the web's command menu, and a draft that mentions a bug or a
feature gets the web's hint. Opening it sends POST /api/v1/issues
(nunomaduro/dev-null.sh#653) in the background, then the sheet says
"Opened issue #123." with View issue, as the web's toast does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@simonhamp
simonhamp force-pushed the feat/issue-commands branch from c728e50 to e9adceb Compare October 19, 2026 23:57
@simonhamp
simonhamp merged commit 7856f9c into main Oct 19, 2026
1 check 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