feat(git): AI-draft issues/PRs against repo templates; fix Git page pickers & image rendering - #39
Merged
Merged
Conversation
Add a Generate action to the Git page's New issue and New pull request forms. An optional Notes field plus the branch, its commits (against the chosen base for a PR), and its changed-file stat feed a one-shot, tool-free `pi -p` call (new `issue_message.rs`), falling back to a local heuristic when pi is missing, unauthenticated, or times out. The draft fills the editable title and Markdown body; Create stays a separate deliberate press. Tighten the Issues and Pull requests lists for scanning: labels collapse to a `+N` chip, every row ends in a fixed relative-time column, closed titles de-emphasize, and the PR row drops its duplicated state pill. Give the pull-request detail the issue detail's reading-column + metadata-rail layout, with a rail summarizing review, checks, changes, branches, and the timeline. Update INTENT.md implementation status, README features/roadmap, docs/git-page.md, and the CHANGELOG [Unreleased] entry; register the new strings in en.yml and the generated locales.
Discover the repository's own templates and use them in the Git page's New issue / New pull request forms. `gh_templates.rs` mirrors GitHub's lookup: `.github/ISSUE_TEMPLATE/` (Markdown with YAML front matter, and YAML issue forms, `config.yml` skipped) plus the legacy single-file locations, and `.github/PULL_REQUEST_TEMPLATE.md` plus its variants. YAML issue forms are flattened into a Markdown skeleton (field labels as headings, descriptions as guidance comments, dropdown/checkbox options as comments and checkboxes). A form with exactly one template applies it automatically; with several, a new Template chip opens a picker including Blank. Selecting a template prefills the title prefix (`bug: `) and the body, and its `labels:` are passed to `gh` on Create. The Generate prompt now hands the model the selected template and instructs it to fill every heading faithfully while preserving checkboxes and sections; the offline heuristic drops the notes (or branch commit subjects) into the template's first section instead. Update docs/git-page.md, INTENT.md, README.md, and the CHANGELOG [Unreleased] entry; add the three new strings to en.yml and the generated locales. Tests cover Markdown/front-matter/issue-form parsing, the legacy lookup, and this repository's own templates.
The template menu was positioned relative to the form card's top-left, so it floated over the title/notes fields far from the chip — and the PR form's chip sits at the bottom, where a downward menu would be clipped anyway. Wrap each template chip in a relative container so the menu anchors to the chip, opening downward for the issue form (chip near the top) and upward for the pull-request form (chip at the bottom). The chip now toggles its menu.
The New-PR Base branch picker rendered at the page's top-right (the Merge/Rebase anchor), far from the chip that opened it, and the template pickers used the plain context-menu chrome. Both now anchor to their chip and share the top branch selector's picker language. - Base branch: a chip-owned popover with a search row, list inset, and picker rows, opening upward (the chip sits at the bottom of the form), focusing the search field on open with the same gesture guard the branch chip uses. The page-level ref picker now serves only Merge/Rebase. - Template: picker surface, list inset, and picker rows (label + source path), still opening down on the issue form and up on the PR form.
…h selector The template and base-branch menus were rendered inside the form card before later fields, so the Notes/title/body inputs painted over them. Wrap each menu in `deferred` (the trick the top branch menu uses) so its layout stays anchored to the chip but it paints after the rest of the form. Also switch the Template and Base branch chips to the branch selector's dropdown chip — glyph, current value, chevron, filled while open — in place of the flat filter chip, so the two forms read like the top branch picker.
The Issues tab's label picker was rendered at the page's top-right (`.top(42).right(12)`), so it opened over the issue list instead of under the control that opened it — true for both the filter bar's Label chip and the detail view's Edit labels button. Wrap each trigger in a relative container that owns the popup, wrap the popup in `deferred` so it paints above the list/detail, and position it directly beneath the trigger (right-aligned for the filter chip, left for the rail button). Restyle the menu to the picker surface and rows used by the branch selector, matching the other pickers.
GitHub stores a pasted screenshot as a raw `<img src="…">` line, which the markdown parser turns into an image block — but only at the top level. A blockquote or list item rendered each line as plain text, so a quoted bug report (a `> <img …>` comment) showed the whole tag as text with its URL autolinked instead of the screenshot. Route quote, alert, and list-item lines through the same image check the top-level parser uses, rendering a standalone image line as an image and falling back to text otherwise. `render_markdown_image` now takes a sub index so each nested image gets a unique element id. Tests: a quoted `<img>` line is recognized (the real GitHub private-user-images tag shape), plus the existing top-level tag test.
imrj05
self-requested a review
September 28, 2026 14:29
imrj05
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds AI-drafted GitHub issues and pull requests that follow the repository's own templates, and fixes a set of positioning/rendering bugs across the Git page's Issues/Pull requests surfaces.
Generator
issue_message.rs: a Generate button on the New issue / New pull request forms drafts a title + Markdown body with a one-shot, tool-freepi -pcall (off the UI thread, never touches the working tree), falling back to a local heuristic built from the branch's commits + changed files when pi is unavailable.gh_templates.rs: discovers the repo's templates (.github/ISSUE_TEMPLATE/Markdown + YAML issue forms, legacy single-file locations,.github/PULL_REQUEST_TEMPLATE.mdand variants). A lone template applies automatically; several are picked from a Template dropdown (including Blank). Selecting one prefills the title prefix + body skeleton (YAML forms are flattened to Markdown), and itslabels:ride along on Create.UI fixes
deferred— previously they floated at the page's top-right or were painted over by the fields. All use the top branch selector's dropdown chip + picker surface/rows.+Nchips, a fixed relative-time column, de-emphasized closed titles, no duplicated state pill; the PR detail now shares the issue detail's reading-column + metadata-rail layout.<img src="…">tags now render when inside a blockquote, alert, or list item (a quoted bug report was showing the tag as text).Related issue
None.
Type of change
Checklist
cargo build --workspaceis cleancargo test -p orbit-pipasses (798 passed, 0 failed)cargo clippy -p orbit-pi --all-targetshas no new warnings (only the pre-existingsection_headerarg-count lint)piremains the only agent runtimeunsafeINTENT.md→ Implementation status updatedREADME.mdfeatures/roadmap andCHANGELOG.md[Unreleased]updateddocs/git-page.mdupdatedNotes
en.ymland generated into all locales; non-English locales fall back to English where no glossary entry exists yet.