Skip to content

feat(web): open pull request images in a gallery - #8990

Closed
SunkenInTime wants to merge 5 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/fullscreen-image-overlay
Closed

feat(web): open pull request images in a gallery#8990
SunkenInTime wants to merge 5 commits into
pingdotgg:mainfrom
SunkenInTime:t3code/fullscreen-image-overlay

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Pull request screenshots were static in T3 Code, so inspecting one required leaving the app or opening the asset separately. The existing expanded-image preview also received only one image at a time, which meant it could not navigate a pull request's image set.

This marks standalone markdown images as expandable, lets the pull request renderer derive an ordered gallery from the images that actually rendered, and reuses the existing expanded preview for navigation. Linked images remain links. The gallery uses each image's resolved currentSrc, opens at the clicked image, wraps at both ends, and supports the existing buttons, arrow keys, and Escape behavior.

Evidence

Before: inline pull request image After: full-screen gallery
Pull request image before opening the gallery Expanded pull request image with previous and next controls and a 1 of 7 counter

Verification

  • vp test run on the six affected markdown and expanded-image test files: 92 tests passed
  • vp run --filter @t3tools/web typecheck
  • Scoped lint and format checks on all four changed files
  • git diff --check upstream/main...HEAD
  • Real web client against PR feat(settings): add open source license notices #8962: seven-image gallery, correct initial index, button and ArrowLeft/ArrowRight navigation, wraparound, Escape close, and full-viewport dialog

Built with GPT-5.6-SOL in the Codex harness through T3 Code.

Note

Open pull request images in a gallery view

  • Adds buildExpandedImagePreviewFromElements and buildExpandedImagePreviewFromContainer to collect all marked images in a container and build a gallery, selecting the clicked image by DOM element identity rather than source URL
  • Updates PullRequestMarkdown to render ExpandedImageDialog with the full gallery when an expandable image is clicked, falling back to the single-image preview when container aggregation is unavailable
  • Changes the markdown image expansion callback to MarkdownMediaExpandHandler, which receives both the preview item and the rendered HTMLImageElement; images are marked with data-expanded-image and registered in a WeakMap for gallery discovery
  • Fixes ExpandedImageDialog keyboard handling to use event capture and guards createPortal for environments without document
  • Risk: MarkdownMediaExpandHandler replaces the previous single-preview callback type; any out-of-tree consumers of the old callback signature in ChatMarkdown, ChatMarkdownVideo, or the asset-backed media renderer must update their prop types
📊 Macroscope summarized d613b08. 4 files reviewed, 1 issue evaluated, 1 issue filtered, 0 comments posted

🗂️ Filtered Issues

apps/web/src/components/pullRequest/PullRequestMarkdown.tsx — 0 comments posted, 1 evaluated, 1 filtered
  • line 42: expandedImageState is only hidden when text changes, not cleared. If a user has a gallery open for body A, the component receives body B (which unmounts the dialog), and then later receives the exact text A again, line 42 revives the old preview without another image click. This can happen while switching/reloading pull-request content and unexpectedly reopens a modal with stale gallery metadata. [ Already posted ]

Note

Low Risk
UI-only markdown preview changes; onImageExpand gains an optional second argument, which remains compatible for handlers that only use the preview object.

Overview
Pull request bodies can now open standalone markdown images in the existing full-screen preview and step through every expandable image in that PR view, instead of previewing a single image in isolation.

Gallery discovery: Expandable images get data-expanded-image, register preview metadata on mount, and onImageExpand now receives the clicked HTMLImageElement so PullRequestMarkdown can collect all marked images in document order (using currentSrc, alt fallbacks, and registered actions) and open the dialog at the right index, with a single-image fallback when gallery construction fails.

Dialog behavior: ExpandedImageDialog registers arrow/Escape handlers in the capture phase and portals to document.body only when document exists.

Tests: New unit coverage for buildExpandedImagePreviewFromElements (ordering, duplicate src, registered actions, invalid selection).

Reviewed by Cursor Bugbot for commit d613b08. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 1, 2026
Comment thread apps/web/src/components/pullRequest/PullRequestMarkdown.tsx
@SunkenInTime

Copy link
Copy Markdown
Contributor Author

cursor review

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Sep 1, 2026

@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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit b32c839. Configure here.

@macroscopeapp

macroscopeapp Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR adds a production pull-request image gallery with modal state, document-wide image collection, keyboard navigation, and shared dialog behavior changes. The capability changes existing image interactions across multiple web components and is broader than a small isolated adjustment.

Not approved because:

  • Monthly spending limit reached (workspace setting). Approvability relies on correctness review in order to determine eligibility

Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more.

Comment thread apps/web/src/components/pullRequest/PullRequestMarkdown.tsx
SunkenInTime and others added 3 commits September 1, 2026 21:09
…mage-overlay

# Conflicts:
#	apps/web/src/components/ChatMarkdown.tsx
#	apps/web/src/components/chat/ExpandedImageDialog.tsx
#	apps/web/src/components/chat/ExpandedImagePreview.tsx
#	apps/web/src/components/pullRequest/PullRequestMarkdown.tsx
@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by #10625 (merged) — markdown images in chat and PR bodies now open as navigable galleries on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants