Skip to content

feat(github): send pull request comments to the agent as citations - #594

Merged
nixuuu merged 1 commit into
feat/inline-citationsfrom
feat/pr-comment-citations
Nov 12, 2026
Merged

nixuuu merged 1 commit into
feat/inline-citationsfrom
feat/pr-comment-citations

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Change

Pull request comments, published and pending inline review comments, review summaries, failed checks/jobs and displayed log excerpts now offer Send to agent. The action adds a PR citation at the thread composer's saved caret and focuses the composer, so the user can write around it before sending. Web also offers Cite for a selected passage. Mobile uses the existing JS text badge and editable-excerpt sheet, with Cite in the item menu.

Tokens show a PR mark, author and excerpt. Their preview includes the full quoted passage, repository/PR number, source URL, time and review file/line. Sent bubbles retain the inline source. The gateway resolves source metadata from the owner's selected account cache and current access revision, requires the PR to remain linked to the destination thread, and includes up to 8,000 characters of cached diff hunk context. Sending or editing a queued message never fetches from GitHub. Proto changes are additive.

Stacked on #591 using gh stack; the bottom PR targets dev. Both branches were rebased onto dev at cafed16af, retaining #589's composer coverage and motion changes plus #592/#593's PR header and compact picker.

Verification

  • Generated contracts with bun run gen; changed files formatted and linted individually on the local host.
  • Added gateway → real worker → fake Claude/Codex/Grok CLI integration coverage for text position, source metadata, bounded cached diff context, persistence and no GitHub requests on send. Additional cases cover failed checks/jobs/log excerpts, foreign-owner sources, missing resources, unlinked PRs and revoked access revisions.
  • Passed remotely: bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check and the web build. Final focused gateway integration across both PRs: 12 tests pass, 122 assertions, no temp leftovers. Full GitHub CI is green: static checks, all four test shards and web/Linux builds. One shard needed a retry after a computer-move fixture connectivity failure; those cases also passed in the full remote run.
  • Remote monolithic check:tmp: 2,540 pass, 166 opt-in skips, one existing import memory-budget failure late in the long-lived process. The unchanged 160 MB import test passed in isolation at +127 MB against its 400 MB budget (11 ms scan). The full CI shards pass it too. Both remote runs left no test temp directories.
  • Manual Chromium review with fixtures: failed check, failed job, log excerpt, review summary, selected comment and inline code comment; icon and item-menu actions; insertion between surrounding text; source metadata; edit, atomic delete/undo; sending multiple source types in order and inline sent bubbles. Reviewed light/dark, desktop/narrow/phone widths with long titles and multiline quotes. The phone action closes the PR sheet and keeps composer focus after navigation. Native device interactions are unverified.
  • Mobile changes are JS-only. Final development-profile EAS fingerprints, generated with nice -n 19, match the bottom PR exactly on both platforms: iOS 86872d18eade9d3c6e0c54b0c328bccd5e5d226c, Android d67c35d4de5511168d4b7c568c1f42c5df4f293d. The iOS fingerprint JSON comparison is empty. Native project generation and both Android/iOS JS exports pass. Expo Doctor passes 19/20 checks; its only finding is newer patch versions for 13 unchanged dependencies. No native configuration or dependency changes.

Copy audit

  • Actions: Send to agent, Cite, Item actions, Open on GitHub. Sentence case, verb-led, shared across surfaces. Send to agent adds a draft citation and does not submit a message.
  • Citation tokens keep Citation: <excerpt> accessibility labels. The preview names the repository, author, time and file/line without relying on the icon or color.
  • Recovery: Citation source unavailable. Refresh the pull request and add it again. and Quote limit reached. Remove a quote, then retry. Each explains the state and gives the next action.
  • Reused existing edit/cancel/save copy and compact kit components. No new empty states or marketing copy. Short, typical and worst-case excerpts, long PR titles and multiline quotes reviewed at desktop/narrow/phone widths in light/dark themes.

@nixuuu
nixuuu added this pull request to stack #595 November 12, 2026 22:25
@nixuuu
nixuuu force-pushed the feat/pr-comment-citations branch 2 times, most recently from 8d78b5d to ad910bd Compare November 12, 2026 22:30
@nixuuu
nixuuu force-pushed the feat/pr-comment-citations branch 3 times, most recently from 9d1e104 to e9ac28e Compare November 12, 2026 22:42
@nixuuu
nixuuu force-pushed the feat/pr-comment-citations branch from e9ac28e to 3d67c73 Compare November 12, 2026 22:51
@nixuuu
nixuuu force-pushed the feat/pr-comment-citations branch from 3d67c73 to 0c29dd9 Compare November 12, 2026 22:57
@nixuuu
nixuuu marked this pull request as ready for review November 12, 2026 23:32
@nixuuu
nixuuu merged commit 968757a into dev Nov 12, 2026
20 of 22 checks passed
@nixuuu
nixuuu deleted the feat/pr-comment-citations branch November 12, 2026 23:39
nixuuu added a commit that referenced this pull request Nov 12, 2026
)

Working sidebar threads gained a neutral fill in #545 that looks too
close to the selected thread, especially in dark mode. Remove that fill
on web and mobile: an unselected working thread now uses its spinner and
Working label, while the current thread retains the selected background
regardless of activity.

Only unselected web thread and Bots conversation rows receive the
lighter hover fill. Keyboard focus keeps its separate outline. Bots
already have no working-only fill; selected bot/group conversations now
retain their selected fill on hover. Keep the normal title/metadata
contrast from #545 and the action swaps, reduced-motion behavior,
reserved slots and gutters from #576. Update the related Polish
documentation; UI copy is unchanged.

Fixes: #545

Validation:
- Rebased onto `dev` at `968757a4c`, including #591 and #594. Reviewed
head: `070efea27b73c7fec7049b1be061c42258e7f17e`. Blame and patches
identify #545 (`1c65b9317`) as introducing the working fill on both
clients. Reviewed #549, #576 and #583; they did not introduce it.
- On the assigned review server, `bun install --frozen-lockfile`, `bun
run gen:check`, full `bun run typecheck`, `bun run lint`, `bun run
format:check` and the production web build pass after the rebase. Svelte
reports zero errors and warnings. Changed-file mobile ESLint, repository
formatting, commitlint and `git diff --check` also pass. No web UI tests
were added or run.
- A single Chromium browser reviewed the production build against a
disposable gateway/database: light/dark at 1440px desktop and 1100px
narrow widths, 288px and 220px sidebars, plus the 393px phone drawer.
Checked working-only, selected-only, selected+working, hover and
keyboard focus in Threads and Bots, including a working side thread and
short/long labels. Working-only rows are transparent; hover uses 4%,
selection uses 6% light / 8% dark, and keyboard focus retains its
separate 2px outline. Selected rows keep their fill on hover. Row bounds
remain fixed and labels do not overflow. Reduced motion gives
zero-duration action swaps. Final navigation reports no console errors.
- The mobile change only removes the `busy ? c.well` background branch
from a TSX file. Native dependencies, configuration, fingerprint
configuration, assets and lockfile are unchanged. Base/head fingerprints
generated on the assigned server with `nice -n 19`, using `expo-updates
fingerprint:generate` and the production/nightly environment, are
identical: iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. This uses Expo's underlying
runtime fingerprint engine. The maintainer confirmed that this local
comparison is sufficient for the JS-only change; authenticated EAS
verification is not required. No build or OTA publication was started.
- Browser, gateway, web and disposable database are stopped. Assigned
ports are free. Verification artifacts remain outside the repository.
Ready for review; the maintainer will merge once CI is green.

Copy audit: no UI text changes; no copy audit required.
nixuuu added a commit that referenced this pull request Nov 13, 2026
nixuuu added a commit that referenced this pull request Nov 13, 2026
nixuuu added a commit that referenced this pull request Nov 13, 2026
Failing checks and jobs displayed separate citation and CI menus. Each
row now uses one menu, with Canopy actions first and GitHub actions
after a labelled separator. Comments, review summaries, review threads
and logs use the same composition on web and mobile.

Removed the paper-airplane shortcut: the single, always-present menu
gives long names more space, keeps touch and pointer interactions
consistent and prevents hover layout shifts. View logs stays at the
trailing edge. Empty pagination controls and empty job responses no
longer leave space above the provider link. CI permission checks,
receipts and confirmation dialogs remain in place.

Fixes: #594

### Verification

- Passed with nice: bun install, gen:check, full typecheck, lint,
format:check and the production web build. Final-commit static checks
and build passed on the isolated second-computer checkout.
- Full check:tmp passed with nice: 2,674 passed, 167 opt-in skips, 0
failures across 501 files; 34,798 assertions. No test temp files
remained.
- Manual Chromium review passed in light/dark at 1440, 760 and 390 px.
Reviewed failing/passing/running checks, long check/job/file names,
timeline comments, review summaries, review threads and logs. Verified
citation delivery, keyboard navigation, stale-state explanations,
request receipts and empty groups. All five check rows had one menu. All
three View logs buttons had identical positions before/after hover and
focus. Empty job responses left no gap above the provider link. Existing
kit motion and reduced-motion handling are reused.
- Review browser and server stopped; remote clone removed. No containers
were needed for the browser fixture.
- No UI test suites added. Native device interactions remain unverified.
- GitHub CI is green: static checks, all four test shards, web/Linux
build, aggregate check and commitlint. The PR is mergeable.

### Copy audit (§8)

- Separate Item actions / Check actions → one contextual menu. Canopy →
separator → GitHub labels distinguish local drafting from remote
actions.
- Send to agent, Cite, Edit comment, Delete comment, Check CI request
and Open on GitHub retain short, sentence-case, verb-led wording. Labels
and group names have no terminal punctuation. No new glossary terms.
- Existing errors, recovery steps, empty states and destructive
confirmations are unchanged. Empty groups are omitted; action labels are
not repeated in adjacent controls. No humour or marketing copy.
- Icon buttons retain accessible labels; group names explain ownership
without relying on colour or icon shape.
- Short, typical and long names checked in light/dark at desktop, narrow
and phone widths. Labels truncate cleanly, comments wrap, logs scroll
horizontally and the phone menu opens as the existing sheet.
nixuuu added a commit that referenced this pull request Nov 13, 2026
Cite inserts an inline citation at the saved composer caret and
immediately opens its existing editor, focused on the optional comment.
The same insertion path covers the floating action, selection menu,
keyboard shortcut and PR panel citations. Restored drafts and pasted
citations do not open the editor.

Enter saves from the comment field; Shift+Enter adds a line, and
Cmd/Ctrl+Enter also saves from the passage field. Escape, Cancel and
outside dismissal keep the citation and discard unsaved edits. Closing
returns the caret after the citation; Jump to source keeps its
navigation behavior. Saving the note does not submit the enclosing
message form.

The editor stays horizontally anchored to the new chip and clears the
whole composer text field vertically. An opt-in Popover motion follower
keeps it attached while the composer grows or moves. The existing
top-layer surface, motion tokens and reduced-motion behavior remain in
use.

Fixes: #591

The parent of `5af512dbe` opened `QuoteCommentPopover` from Cite and
saved with unmodified Enter. #591 removed that opening step when
introducing inline tokens. #594 added PR citations afterwards. Mobile
still opens `QuoteEditor` before insertion for transcript and PR
citations; it did not lose the note editor, so no native change is
needed.

## Verification

- Passed with `nice -n 19`: install, generated-code check, final-head
typecheck, lint, formatting and web build. CI is green on
`78bba15c98c8800019224c908c21bef348e2cebe`, including all four test
shards and their temporary-directory checks. The local full `check:tmp
--timeout 60000` finished with **2687 pass, 166 skip, 12 fail** across
505 files; its temporary-directory check passed. All 12 failures are in
the unchanged `tests/integration/computer-moves.test.ts` (peer
reachability/synchronization and HTTP/2 connection errors). The same
file passed completely in CI, including all 20 repeated thread-move
cases; the local cause is not established. The first default-timeout
test run hit 5-second release-script timeouts under host load; it was
stopped and its temporary directory was clean.
- Manual Chromium review: light/dark, 1440×900 desktop and 390×844 phone
widths; short (2 characters), typical (173 characters), long multiline
(~2,000 characters) and maximum (20,000 characters) passages; 1–6
citations in the same message. Verified floating Cite, Alt+Q and the
desktop selection menu; comment autofocus, Enter/Shift+Enter/Cmd+Enter,
Escape/outside dismissal, editing an existing note and the Save button
without sending the message. Outside dismissal retains the citation and
restores the composer caret after it.
- A 25-frame opening sample kept exactly 6 px between the popover and
the text field throughout the composer animation. The panel starts at
opacity 0 in its positioned location. No horizontal overflow at phone
width. Reviewed the existing reduced-motion token and CSS path; no new
animation timings.
- The requested review host already had two review environments, so
review used a private local gateway/database/BFF on non-reserved ports.
The private servers and database were removed and the browser tab
closed. Mobile transcript and PR paths were inspected in code; no native
device review or PR panel account fixture was used.
- No UI test suite added. No user-facing text changed; the copy audit is
not applicable. Documentation describes the restored note editor and
keyboard behavior.
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