Repository navigation
feat(dashboard): Render links to known objects as cards - #3259
Merged
Merged
Conversation
A bare URL to an object that the Conversation saved as an Annotation shows as a compact chip in running text and as the full object card when it is alone in a paragraph. A labeled link keeps its text and previews the card on hover. Review item details hide the Subject card when the body already shows that card. Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 585e999. Configure here.
Contributor
|
17 screenshot changes — 15 changed · 2 added · 0 removed Review screenshots in Frameshift Show 9 more changed screenshots |
Four spaces or a tab of indent make a code block, so the body does not show the object card, and the Subject card must stay. Co-Authored-By: BYK <[email protected]>
BYK
approved these changes
Nov 12, 2026
BYK
added a commit
that referenced
this pull request
Nov 12, 2026
) ## Problem #3259 shows a link as an object card only when its URL is the same as an Annotation that a Conversation saved. No plugin or core module can claim a URL. Links to a Conversation, a person, or any other object stay plain text. ## Design A **link type** has static filters and a resolver. It works like an Android `<intent-filter>`: | Android | Junior | | --- | --- | | `<intent-filter>` in the manifest | `objectLinks` in `defineJuniorPlugin`, next to `userPages` | | `<data android:scheme>` | `scheme`: `https` (default), `http`, or `mailto` | | `<data android:host>` (`*.` wildcard) | `host`: exact, or `*.example.com` | | `android:path` / `pathPattern` / `pathPrefix` | `path` / `pathPattern` (a `*` segment matches one segment) / `pathPrefix` | | The component that handles the intent | `objectType` and `resolve(ctx, url)` | ```ts { objectType: "task", filters: [{ host: "linear.app", pathPattern: "/*/issue/*" }], resolve: (ctx, url) => readIssueAsViewer(ctx.viewer, url), } ``` - Junior matches filters without plugin code. The most specific filter wins: an exact host before a wildcard host, then an exact path before a pattern before a prefix, then the longer match. When two link types have equal filters for the same URLs, app startup fails. - Core uses the same shape for its link types. `conversation` claims `/conversations/*` and `person` claims `/people/*` on the configured dashboard origin. `person` also claims `mailto:` addresses of known people. - `GET /api/objects?url=…&url=…` resolves up to 20 links for the signed-in viewer. It uses the state cache for 60 seconds, with one key for each viewer and URL. A zod schema validates the response. A failed resolver logs `object_link.resolve.failed` and hides only its own card. - The dashboard asks for a card when a link scrolls into view or when the reader hovers it. Links that ask in one frame share one request, and React Query keeps the result. Until a card arrives, or when the request fails, the link stays a plain link. A resolved card uses the chip, block card, and hover card from #3259. It does not show "Latest saved state". - New object types: `conversation` (state, participants, last activity, Brief as the description) and `person` (email, Slack handle, avatar). The icons are Octicons `comment-discussion` and `person`, from the set that the generator already uses. - No database migration. ## Security - Each resolver uses only the access of the viewer. Resolution never saves an Annotation. - `conversation` uses `readConversationAccessFromSql`. It returns a card only when the viewer can see private content: a public Conversation, or a private Conversation that the viewer takes part in. For all other viewers, the response is the same as for a URL that names no Conversation. Thus, the response does not show that the Conversation exists, and its Brief stays hidden. - `person` shows only what the People pages show each signed-in viewer: name, email, Slack handle, and the Junior avatar path. The schema accepts only `/api/people/avatars/…` avatar URLs, so the browser never loads a provider photo URL. - The response has `cache-control: private, no-store`. The server cache key includes the viewer id. ## Tests - Integration (`tests/integration/api/objects.test.ts`): a private Conversation resolves for its participant with the Brief. A non-participant gets no card, and the response does not contain the title or the Brief. A dashboard people URL and a `mailto:` link resolve to a known person. Unknown links get nothing. - Unit (`tests/unit/api/object-link-types.test.ts`): filter matching, specificity order, core dashboard and `mailto:` matches, and the error for equal filters. - Dashboard e2e (`conversation-object-links.spec.ts`): a Conversation URL with no Annotation shows as a chip, and hover opens its card. This test fails on `main`. - `pnpm typecheck`, `pnpm lint`, dashboard unit tests, and the full dashboard e2e suite pass. ### Screenshots (1440, mock dashboard) Before: the links stay plain. | Dark | Light | | --- | --- | |  |  | After: chips. | Dark | Light | | --- | --- | |  |  | After: hover on the Conversation link. | Dark | Light | | --- | --- | |  |  | After: hover on the person link. | Dark | Light | | --- | --- | |  |  | ## Next types Each next type adds one object type to the registry, with its facts and icon, and one `objectLinks` entry in the plugin that owns the provider: - Slack `message`: the Slack plugin, `host: "*.slack.com"`, `pathPattern: "/archives/*/*"`. - `document`: Notion, Google Docs, and Figma filters in their plugins. - `post`: x.com through oEmbed. - Calendar links: the Google plugin, with the existing `calendar_event` type. The plugin docs have a short "Add a link type" section. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A3327eedcd48b4d0139d324d264a639d1 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A3327eedcd48b4d0139d324d264a639d1) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A3327eedcd48b4d0139d324d264a639d1/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
23 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Agent replies and Review item bodies contain many bare URLs, such as
https://github.com/getsentry/junior/pull/3245. The dashboard shows them as long raw links, also when the Conversation already has a saved Annotation for that object. A "Ready to merge" notice ends with the pull request URL, and the same pull request also shows as a separate subject.Fix
Display text now uses the Annotations that are already on the client. A link whose URL is the canonical URL of an Annotation renders as follows:
getsentry/junior#2201 · Draft). The chip opens the URL.ObjectCard.[text](url)keeps its text.ObjectCardin a Base UI preview card.URL matching is exact on the Annotation
url, with a trailing slash dropped. Links to a comment (#discussion_r1) or another page (/files) stay plain. The client does not parse provider URLs. Links to unknown objects do not change.Sources of known objects:
ConversationTranscriptView). This includes Review item excerpts.ReviewItemObjects). This does not start a fetch.annotationCardis now exported from@sentry/junior/api/schema, so resource links and objects map to one card shape.Limits
textHasStandaloneUrl) reads paragraphs from the text. The renderer reads the Markdown tree. The two agree for plain paragraphs. In rare cases, such as an indented code block, the Subject card stays visible.ReviewItemSubjectPreview). It can calluseTextShowsObjectCardto hide it.Tests
tests/displayText.test.tsx): a bare URL in a sentence, a list, and a quote becomes a chip. A bare URL alone in a paragraph, or as an autolink, becomes the card.[text](url)keeps its text. Unknown objects and other pages of a known object stay plain.textHasStandaloneUrlignores code fences and inline URLs.e2e/conversation-object-links.spec.ts): on the mock release Conversation, a bare PR URL in a sentence is a chip, a known PR URL on its own line is the card, and a hover on a labeled link opens the card.pnpm typecheck,pnpm lint,pnpm file-length:check, dashboard unit tests (451 passed), and the full dashboard e2e suite (158 passed, 1 skipped).Screenshots
Mock mode, desktop.
Inline chip and block card in a message
Hover card on a
[text](url)linkBefore, the link had no hover card.
"Ready to merge" notice (body from
pull-request-ready.ts)The bare URL is now a chip in the notice and in Details.
Notice with the URL in its own paragraph (Subject card hidden)
via @BYK.
--
View Session [Sentry]