Repository navigation
Conversation
The `Attachment` component took `expanded` only as a prop with no way to toggle it. On the event Context tab it is rendered without that prop, so the preview stayed collapsed forever and the download link (whose URL is only built when expanded) was inert too — the "Expand to preview attachment." hint did nothing. Let the component manage its own expanded state, seeded from the prop, and make the hint a button that toggles the preview open and closed. Previews stay lazily rendered (collapsed by default), so nothing is decoded until requested. `EnvelopeDetails`, which passes `expanded`, is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Coverage Results 📊✅ Patch coverage is 100.00% (4 of 4 changed executable lines covered; target 80%). Changed files with executable lines (1)
Generated by Coverage Action |
antonis
marked this pull request as ready for review
October 1, 2026 13:12
9 of 11 tasks
antonis
requested review from
BYK and
MathurAditya724
and
a balanced review from Copilot
October 16, 2026 10:39
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The toggle replaces the focused button, causing keyboard focus loss.
1 open finding
What changed in this PR
Makes attachment previews expandable and collapsible in the event Context tab while preserving lazy rendering.
Changes:
- Adds local expansion state initialized from the
expandedprop. - Adds preview toggle buttons and a test covering expansion, download URL creation, and collapse.
| File | Description |
|---|---|
| packages/spotlight/src/ui/telemetry/components/insights/envelopes/Attachment.tsx | Adds expansion state and preview controls. |
| packages/spotlight/src/ui/telemetry/components/insights/envelopes/Attachment.test.tsx | Tests toggling and lazy download URL creation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

Description
While testing getsentry/sentry-react-native#6818 I noticed that the
Attachmentcomponent takesexpandedonly as a prop, with no way to toggle it.This makes the component manage its own expanded state (seeded from the
expandedprop) and turns the hint into a button that toggles the preview open and closed. Previews stay lazily rendered — collapsed by default, nothing decoded until requested — so the perf intent of lazy rendering is preserved.EnvelopeDetails, which passesexpanded, is unaffected.How tested
Attachment.test.tsx): added a case that expands on click (content renders, download URL built on demand) and collapses again. 15/15 pass (vitest run).image/pngscreenshot attachment now expands to render the image on the Context → Attachments section, and collapses back.