Skip to content

Add PR viewer UI app with diff and details tabs#2110

Draft
olaservo wants to merge 1 commit intogithub:mainfrom
olaservo:feature/pr-read-ui
Draft

Add PR viewer UI app with diff and details tabs#2110
olaservo wants to merge 1 commit intogithub:mainfrom
olaservo:feature/pr-read-ui

Conversation

@olaservo
Copy link
Contributor

Summary

Adds a new MCP App UI for the pull_request_read tool that provides a visual PR viewer with tabbed Diff and Details views.

Why

The existing UI apps (get-me, issue-write, pr-write) cover user info and write operations, but there's no rich UI for reading pull request data. This adds a visual diff viewer and PR details view attached to the pull_request_read tool.

What changed

  • Added ui/src/apps/pr-read/ with vanilla TypeScript app (App.ts, diff-parser.ts, diff-renderer.ts, pr-details-renderer.ts, styles.css, index.html)
  • Diff view supports unified and split modes with file collapsing, progressive rendering, and fullscreen toggle
  • Details view renders PR state, metadata, labels, branches, stats, and body
  • Method-driven tab selection with ability to switch views via tabs (each tab triggers a callTool call)
  • Added PullRequestReadUIResourceURI constant and Meta field to pull_request_read tool in pullrequests.go
  • Registered pr_read_ui resource in ui_resources.go
  • Made Vite React plugin conditional in vite.config.ts for non-React apps
  • Added build:pr-read script to ui/package.json
  • Updated pull_request_read.snap toolsnap

MCP impact

  • Tool schema or behavior changed — Added _meta.ui with resourceUri to the existing pull_request_read tool. No schema or behavioral changes to the tool itself; the UI metadata is stripped when InsidersMode is off.

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact — Read-only UI rendering of existing tool data. No new API calls or auth changes.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Tested locally with ./script/test — All Go tests pass including updated toolsnap
  • Linted locally with ./script/lint

Docs

  • Not needed

Integrates the diff viewer UI into the MCP server as a general-purpose
PR viewer attached to the pull_request_read tool. Supports two views:
- Diff: unified/split diff rendering with file collapsing
- Details: PR metadata, state, labels, branches, and stats

Uses method-driven tab selection with the ability to switch between
views via tab navigation, fetching data through callTool.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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