Skip to content

feat(seer): Show Ask Seer's changes and push them from the PR bar - #129323

Closed
joseph-sentry wants to merge 4 commits into
masterfrom
joey--ask-seer-pr-bar-changes
Closed

joseph-sentry wants to merge 4 commits into
masterfrom
joey--ask-seer-pr-bar-changes

Conversation

@joseph-sentry

Copy link
Copy Markdown
Contributor

When Seer edits code in an Ask Seer run, you can now see those changes and ask Seer to push them, from the PR bar above the chat input.

PR bar

  • Each repo the run touched gets its own row. It shows the PR as a link, or just the repo name before there's a PR.
  • A +N −M button on each row opens the run's changes for that repo.
  • Update PR or Create PR appears while some of the repo's changes aren't on its PR. It sends Seer a message asking it to push that repo's changes, or to open a PR with them. It's disabled while Seer is working.
  • All rows share one grid, so the diff buttons line up in one column and the push buttons are the same width.

Changes view

  • It replaces the chat until you go back with the back button or Escape. The chat stays mounted underneath, so its scroll position and draft survive.
  • All changes shows the PR's diff, from feat(seer): Look up a pull request's files by repo name and number #129322, with Seer's unpushed edits on top. The diff is fetched again after each push.
  • Unpushed shows only what the next push would add. It's measured from the last push the same way Seer's get_diffs_since_last_push does it, so it matches what Seer will commit.
  • A repo without a PR just shows everything the run changed.
  • Expand all / Collapse all. Files over 300 changed lines start collapsed.

It's gated behind ask-seer-create-pr, like the PR bar.

Stacked on #129322 for the new endpoint and its generated URL type. Merge after that one deploys.

Screenshots

These are simulated runs with made-up repos.

PR bar
Three repos: two PRs and one repo without a PR One PR with unpushed changes
Push buttons disabled while Seer is working
Changes view
All changes: the PR's diff with unpushed edits on top Unpushed changes only A repo without a PR

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-gs1lb2sod.sentry.dev

@sentry

sentry Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 780 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 95.87% 95.88% 🟢 +0.01%
Typed 142,494 142,755 🟢 +261
Untyped 6,131 6,139 🔴 +8
🔍 8 new type safety issues introduced

any-typed symbols (1 new)

File Line Detail
static/app/views/seerExplorer/runChanges.tsx 245 repoName (var)

Non-null assertions (!) (5 new)

File Line Detail
static/app/views/seerExplorer/hooks/usePullRequestDiffs.tsx 43 states[index]!
static/app/views/seerExplorer/runChanges.tsx 449 ops[i]!
static/app/views/seerExplorer/runChanges.tsx 452 ops[i]!
static/app/views/seerExplorer/runChanges.tsx 499 ops[j]!
static/app/views/seerExplorer/runChanges.tsx 513 ops[start]!

Type assertions (as) (2 new)

File Line Detail
static/app/views/seerExplorer/runChanges.tsx 203 `as Record<string, unknown>
static/app/views/seerExplorer/runChanges.tsx 224 as Record<string, unknown> — shas as Record<string, unknown>

This is informational only and does not block the PR.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6d67af6. Configure here.

Base automatically changed from joey--pr-files-by-repo-and-number to master November 3, 2026 15:20
@joseph-sentry
joseph-sentry requested review from a team as code owners November 3, 2026 15:20
joseph-sentry and others added 4 commits November 3, 2026 10:20
When Seer edits code in an Ask Seer run, the PR bar above the chat input
now lists each repo on its own row: the PR as a link (or the repo name
before there is one), a +N -M button that opens the run's changes, and
an Update PR or Create PR button while some changes aren't on the PR.
The push button sends Seer a message asking it to push that repo's
changes or open a PR with them, and is disabled while Seer is working.
The rows share one grid, so the buttons line up in columns.

The changes view replaces the chat until you go back, which keeps the
chat's scroll position and draft. It shows either the PR's diff with
Seer's unpushed changes on top, or only the unpushed changes, measured
from the last push the way Seer's own get_diffs_since_last_push does.
The PR's diff comes from the new repos/pull-request-files endpoint, and
is fetched again after each push.

Gated behind ask-seer-create-pr, like the PR bar.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A push clears the unpushed changes at once, but invalidating the PR files
query kept serving the cached diff until the refetch landed, so All changes
briefly dropped the just-pushed edits. Reset the query instead, so the diff
shows as loading until the new one arrives.

Co-Authored-By: Joseph Sawaya <[email protected]>
The approval and question shortcuts listen on the document, so inert didn't
stop them, and Enter or Escape in the changes view could approve or reject a
prompt the user couldn't see. Turn them off while the view is open. Also make
the view focusable, so clicking the diff keeps focus there and Escape still
goes back to the chat.

Co-Authored-By: Joseph Sawaya <[email protected]>
Resetting the query when commit_sha changed only worked while the hook stayed
mounted. After a remount, the diff cached before the push was still fresh, so
All changes dropped the pushed edits. Put commit_sha in the query instead, so
each push gets its own cache entry and the reset effect goes away.

Co-Authored-By: Joseph Sawaya <[email protected]>
joseph-sentry added a commit that referenced this pull request Nov 3, 2026
…129322)

Adds `GET
/organizations/{org}/repos/pull-request-files/?repo=<owner/name>&number=<n>`,
which returns a pull request's files from its provider, found by the
repository's name and the PR's number.

The existing `pull-requests/{id}/files/` endpoint needs our
`PullRequest` row, and Seer runs open and push to PRs we may have no
record of. Ask Seer's PR bar needs each of the run's PRs' diffs to show
the run's changes on top of them, so it looks PRs up the way Seer knows
them.

- Each file also has its `status` and `previousPath`, so renames show
correctly.
- Only active repositories with an integration match, scoped to the
organization.
- Both endpoints share the provider fetch, with the same errors: 404
when the PR is gone, 429 when rate limited, and 502 when the provider
fails.

The frontend that uses it is #129323, which should merge after this
deploys.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
@joseph-sentry
joseph-sentry force-pushed the joey--ask-seer-pr-bar-changes branch from 1749ba4 to 88b840a Compare November 3, 2026 15:20
sentry-junior Bot added a commit that referenced this pull request Nov 3, 2026
Reuse the Ask Seer run-changes logic from #129323, copied verbatim so that PR
rebases cleanly, to show each PR's diff with Seer's unpushed edits on top.

Co-Authored-By: Joseph Sawaya <[email protected]>
sentry-junior Bot added a commit that referenced this pull request Nov 3, 2026
knip flags it as unused here; #129323's changes view is its only importer.

@alexsohn1126 alexsohn1126 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works and I have minimal complaints, but perhaps worth considering moving some parts of the frontend to the backend, especially when it partially mirrors an existing backend function.

can be done as a follow-up though — or not since there are downsides to moving some of the parsing to the backend. the frontend would have to wait for the backend to respond before the diff can be shown 😕

* The run's file changes per repo: the PR's diff with the unpushed changes on top of it, and the
* unpushed changes alone.
*
* The unpushed part mirrors Seer's `get_diffs_since_last_push`: a push marks `pr_commit_shas` on

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider moving this part to the backend?

This branch was successfully deployed

1 active deployment
Preview — 88b840a1 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants