Repository navigation
feat(inbox): Snooze an Inbox item until an Event on its subject - #3851
Conversation
`POST /api/inbox/snoozes` now takes `triggers`, each an Event type and a `wake` or `resolve` outcome, with or without `wakeAt`. The server aims each trigger at the resource that the item's subject names, so a viewer cannot wait on a resource that no item they see names. A `resolve` needs a viewer who can dismiss every item. A plugin's Event source can name the resource of a web page with `resourceForUrl`, the inverse of `resourceUrl`. GitHub names the repository, pull request or issue of a github.com link. A Review item's subject lists that resource and its Event types, and the snooze menu shows them under Event…, to wake or dismiss the row.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bab27c5. Configure here.
…ggers # Conflicts: # design/inbox.md
BYK
left a comment
There was a problem hiding this comment.
Good start but we should also allow these on other cards too by stating which PR or issue we're watching. Even for a PR we should be able to make it wake up etc by an event happening on a different PR.
This can be a follow up or you can build it here if it changes your design and architecture fundamentally
|
Thanks. I've kept this PR as it is, because snoozing on another resource adds to the current design rather than changing it. That makes it a good separate follow-up:
The triggers table, matching and the first-to-fire race would stay the same. |
…ggers # Conflicts: # packages/junior-dashboard/src/client/conversations/ConversationWatches.tsx
|
13 screenshot changes — 9 changed · 4 added · 0 removed Review screenshots in Frameshift |
…ggers # Conflicts: # packages/junior-dashboard/src/client/conversations/ConversationWatches.tsx
BYK
left a comment
There was a problem hiding this comment.
Let's do those follow ups once this PR merges.
…wer names (#3877) A snooze could only wait on Events of the item's own subject, so a card with no subject, or a PR card that depends on another PR, could not wake when that other work moved. Now a snooze can wait on Events of any pull request or issue the viewer can see, on a time, or on both. Builds on #3851. **API** - A snooze trigger takes an optional `resourceUrl`. The plugin that owns the page's Events reads it with `resourceForUrl`, and watchability is checked the same way as for a Watch. The plugin's link type must also let the viewer see the page now and read an object there: `viewerCanViewPluginLink` uses the link type's `canView` and `resolve`, never the web page card. For GitHub, that is the viewer's linked login plus repository permission, and the pull request or issue must exist. Without a URL, a trigger waits on each item's subject, as before. - A page the viewer cannot see, a missing page, or one without Events fails the snooze with 400. - New `GET /api/inbox/snoozes/resource?url=` returns the Events of a page, or 404. - A trigger with a named page applies to every item in the row. `resolve` still needs a viewer who can dismiss the item. - One snooze takes up to `INBOX_SNOOZE_MAX_TRIGGERS` (30) triggers, so every Event of one page fits. **Event phrases** - A plugin Event declaration can set `phrase`: how the Event reads after its resource's name, such as `is merged` or `gets a new comment`. Core stays free of provider wording. - The GitHub plugin sets phrases for its pull request and issue Events. The snooze resource payloads (`GET /resource` and an item subject's `resource`) carry them as `phrases`. **Dashboard** - The Snooze menu offers 15 and 30 minutes, then the other times, then Custom…. - Custom… opens one dialog for a time, conditions, or both. The first of them ends the snooze. - Conditions are built like Sentry alert conditions: Add condition adds a row with a page and one of its Events, such as "This pull request · is merged". A row starts on the item's own subject; on an item with no subject, it opens the page search at once. The page button opens the same search as the composer's `#` menu, which also takes a pasted pull request or issue link. Wake or Dismiss applies to every condition, and any of them ends the snooze. Rows are a list so that `AND` can join them later. - The search floats over the dialog, an Event select keeps its size while its link loads, and the dialog is pinned to the top, so it grows down without jumping. - A link that the viewer can't snooze on shows an error, and its Event select stays off. - The dialog loads on first use, so the Inbox bundle stays about the same size. Demo, from mock data:  | | Dark | Light | |---|---|---| | Desktop: menu |  |  | | Desktop: conditions on the row's PR |  |  | | Desktop: PR search |  |  | | Desktop: time and another PR |  |  | | Mobile: the row's PR and a pasted issue |  |  | <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A77b39812ae242b4588c9a0c8db5b1a8c --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A77b39812ae242b4588c9a0c8db5b1a8c) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A77b39812ae242b4588c9a0c8db5b1a8c/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

Follow-up to #3567 and #3392: a snooze can now end on any Event type that the item's subject supports, not only at a time.
API
POST /api/inbox/snoozestakestriggers: [{eventType, outcome: "wake" | "resolve"}](1–10), with or withoutwakeAt. One of them is required. The schema stays strict.resolvetrigger dismisses the item, so all the items must be ones the viewer can dismiss (canActOnReviewItem). Otherwise the request fails with a 400.junior_inbox_snooze_triggersas before. Matching and the first-to-fire race (publish/hasMatch) do not change. No migration.Resource from a subject URL (provider-neutral)
pluginEventsSchemagets an optionalresourceForUrl(url), the inverse ofresourceUrl. Core asks each Event source which resource a subject URL names. Core has no provider URL rules./files) and issue pages on github.com.subject.resourcegives{namespace, resourceType, events}.eventsis everysupportedEventsentry of that resource type, which follows the review ask to "add all event types we support". A resource type that cannot be watched gets nosubject.resource.Dashboard
ConversationWatchesto a sharedeventLabel.ts.Mock data, light and dark, at 1440:
via @BYK.
--
View Session [Sentry]