Skip to content

feat(git): AI-draft issues/PRs against repo templates; fix Git page pickers & image rendering - #39

Merged
imrj05 merged 8 commits into
mainfrom
feat/git-issues-pr-ui
Sep 28, 2026
Merged

imrj05 merged 8 commits into
mainfrom
feat/git-issues-pr-ui

Conversation

@rj05xdev

Copy link
Copy Markdown
Collaborator

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

  • New issue_message.rs: a Generate button on the New issue / New pull request forms drafts a title + Markdown body with a one-shot, tool-free pi -p call (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.
  • New gh_templates.rs: discovers the repo's templates (.github/ISSUE_TEMPLATE/ Markdown + YAML issue forms, legacy single-file locations, .github/PULL_REQUEST_TEMPLATE.md and 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 its labels: ride along on Create.
  • The Generate prompt hands the model the selected template and asks it to fill every heading faithfully while preserving sections/checkboxes.

UI fixes

  • Pickers (Template, Base branch, Issue Label) are now anchored to the chip/button that opens them, open in the right direction, and paint above the form/list via 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.
  • Issue/PR lists tightened for scanning: label +N chips, 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.
  • Markdown images stored as raw <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

  • New feature
  • Bug fix
  • Refactor / performance
  • Documentation

Checklist

  • cargo build --workspace is clean
  • cargo test -p orbit-pi passes (798 passed, 0 failed)
  • cargo clippy -p orbit-pi --all-targets has no new warnings (only the pre-existing section_header arg-count lint)
  • No web UI reintroduced (GPUI only)
  • pi remains the only agent runtime
  • No new dependency
  • No unsafe
  • INTENT.md → Implementation status updated
  • README.md features/roadmap and CHANGELOG.md [Unreleased] updated
  • docs/git-page.md updated

Notes

  • New i18n strings are registered in en.yml and generated into all locales; non-English locales fall back to English where no glossary entry exists yet.
  • Screenshots/recordings: not attached — changes are GPUI-only and verified via unit tests + manual run.

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
imrj05 self-requested a review September 28, 2026 14:29
@imrj05
imrj05 merged commit bacf675 into main Sep 28, 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.

2 participants