Skip to content

feat(api): Review item sort, status filter and bundle counts, and Automations owner filter - #3445

Merged
BYK merged 3 commits into
mainfrom
feat/api-review-item-sort-status-counts
Nov 14, 2026
Merged

BYK merged 3 commits into
mainfrom
feat/api-review-item-sort-status-counts

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Server API for the new Inbox in the dashboard rewrite (#3035). The current dashboard sends none of the new params, so it sees no change.

What it adds

  • GET /api/review-items?sort=waiting: the items that wait on the viewer first, then the rest, each group newest first.
  • GET /api/review-items?status=done,dismissed: closed items, newest closed first.
  • Item subject.objectType, such as code_change.
  • GET /api/review-items/count: decisions, codeChanges and snoozed (from ?snoozed=<ids>). automations is present only with include=automations.
  • GET /api/automations?owner=me: only the viewer's own Automations, inside any scope.

Code change detection

Core has no pull request URL rule. readLinkObjectType(url) asks the registered object-link types which one claims a URL. The GitHub plugin's githubPullRequestLinks filter (/*/*/pull/*) answers code_change.

Query cost

The badge and both bundle counts share one GROUP BY subject_url query, so a count with no params stays 1 query at the same cost as main (12.7 ms for a user with 3,192 assignments). include=automations adds 1 query (5.6 ms), and snoozed ids add 1 (5.7 ms).

reviewItemVisibleTo keeps false out of its or, so Postgres turns a lone assignee EXISTS into a semi-join. A closed list takes 46 ms for that user and 3.7 ms for a typical one, against 98 ms and 91 ms with the old shape. sort=waiting costs the same as the default order. owner=me adds nothing measurable. No schema change.

Numbers are EXPLAIN (ANALYZE, BUFFERS) medians on bench data with 100k Review items, 3,000 Automations and 300k runs.

Compatibility

The dashboard parses responses with .strict() schemas from this package. A tab that still runs a bundle from before this deploy rejects the new count fields until it reloads. #3439 has the same caveat.

The new UI in #3035 must read codeChanges, send include=automations, and use subject.objectType === "code_change".

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 3 commits November 14, 2026 20:39
…omations owner filter

Review items take sort=waiting and status=done,dismissed, and each item
subject carries the objectType of the plugin link type that claims its URL.
The count adds decisions, codeChanges and snoozed from one grouped query;
Automations come only with include=automations. Automations take owner=me.

The visibility filter no longer puts false inside its or, so Postgres can
semi-join a lone assignee exists.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested a review from BYK November 14, 2026 21:02
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 14, 2026 9:02pm UTC

Request Review

@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

31 screenshot changes — 31 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Show 12 more changed screenshots
Conversation Event Log Virtual · Desktop
Conversation Event Log Virtual · Desktop
Changed
Conversation Event Log Virtual · Mobile
Conversation Event Log Virtual · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Memory List Jump · Desktop
Conversation Memory List Jump · Desktop
Changed
Conversation Memory List Jump · Mobile
Conversation Memory List Jump · Mobile
Changed
Conversation Question Picks And Text · Desktop
Conversation Question Picks And Text · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Sidebar Review Chip · Desktop
Conversation Sidebar Review Chip · Desktop
Changed
Conversation Sidebar Review Chip Light · Desktop
Conversation Sidebar Review Chip Light · Desktop
Changed
Conversation Sidebar Review Chip Tooltip · Desktop
Conversation Sidebar Review Chip Tooltip · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed

13 more changed screenshots in Frameshift.

@BYK
BYK merged commit ba1899e into main Nov 14, 2026
46 checks passed
@BYK
BYK deleted the feat/api-review-item-sort-status-counts branch November 14, 2026 21:12
sentry-junior Bot added a commit that referenced this pull request Nov 14, 2026
Take main's Review item count, sort and status API from #3445, which
ports this branch's server side. The dashboard now reads `codeChanges`
and sends `include=automations`. Drop this branch's duplicate count
helpers in store.ts.

Co-Authored-By: BYK <[email protected]>
BYK pushed a commit that referenced this pull request Nov 14, 2026
Follow-up to review feedback on #3445: on the first page
of `GET /api/review-items` with a search or `include=archived`, the
archived matches do not depend on the open page. This runs both reads
with `Promise.all` instead of one after the other, so the first page
waits for the slower read instead of the sum. Responses do not change.

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A8541f171a3af567a3e793732efc8684f -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A8541f171a3af567a3e793732efc8684f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A8541f171a3af567a3e793732efc8684f/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
BYK pushed a commit that referenced this pull request Nov 14, 2026
#3441 renamed a link type's `objectType` to an
`objectTypes` list. `readLinkObjectType`, added in
#3445, still reads `objectType`. The two merged close
together, so `main` no longer builds, the Inbox count finds no pull
requests, and review item subjects lose their `objectType`.

`readLinkObjectType` now names a type only when the link type that
claims the URL has exactly one. A `/pull/` URL is still a `code_change`.
A GitHub issue URL can open an issue or a pull request (`["task",
"code_change"]`), so it names no type from the URL alone.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A8541f171a3af567a3e793732efc8684f -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A8541f171a3af567a3e793732efc8684f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A8541f171a3af567a3e793732efc8684f/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — b4e526cb Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant