GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): image preview no longer closes when a press is dragged across its edge by iamshadmantaqi · Pull Request #45051 · pingdotgg/t3code

Conversation

@iamshadmantaqi

@iamshadmantaqi iamshadmantaqi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Problem

The expanded image preview closes when a mouse drag starts or ends on the image.

Steps (web app, no sign-in):

  1. In any thread, paste or attach an image in the composer, or open a Markdown image, and click it to open the preview.
  2. Press the mouse on the image, drag a little onto the dark area beside it and release. The preview closes.
  3. Or press on the dark area beside the image, drag onto the image and release. The preview closes too.

Expected: it stays open in both cases. A plain click on the dark area still closes it.

Cause

The popup in ExpandedImageDialog.tsx closes in onClick when event.target === event.currentTarget. When the press and the release land on different elements, the browser sends the click to their nearest common ancestor, which is the popup itself, so the check passes. This is the flaw #45032 fixed for Settings and Usage.

Change

This applies the #45032 fix to the image preview. The popup remembers whether the press began on its empty area (onPointerDown), forgets that if the release lands on another element (onPointerUp), and closes in onClick only when both hold. Eleven lines added and two changed in one file, using the same three handlers as AppRouteModal.tsx.

Scope

Small fix of an obvious bug, steps reproduce it, so it needs no issue.

Verification

New cases in ExpandedImageDialog.browser.test.tsx press, move and release the mouse through CDP at 1280x800: backdrop to image and image to backdrop must stay open, and backdrop to backdrop must close (a control that shows the coordinates hit the empty area).

Test commit alone, on main eec21fa:

FAIL  a press dragged from the backdrop to image closes the preview: false
FAIL  a press dragged from the image to backdrop closes the preview: false
AssertionError: expected "vi.fn()" to not be called at all, but actually been called 1 times

The backdrop to backdrop case passes.

With the fix: 10 of 11 tests in the file pass, including the three new ones. The one failure is the existing "scrolling pans the image while Ctrl+wheel zooms around the pointer" (expected 1 to be +0), which fails the same way on unmodified main on this Mac.

vp run check:changed: format, lint, knip, typecheck (2 packages) and React Compiler pass. The test step fails only on that one existing test.

Not verified: I did not drag the mouse in the running app by hand, and the existing Ctrl+wheel test fails on unmodified main on my macOS headless Chromium, so I did not see it pass here; CI on Linux should show it. Touch input on mobile web keeps the press-start target, as in #45032.

Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
iamshadmantaqi added 2 commits November 28, 2026 23:33
@iamshadmantaqi
test(web): image preview stays open when a press is dragged across th…
6edc605
…e image edge
@iamshadmantaqi
fix(web): image preview no longer closes when a press is dragged acro…
1e81d5b
…ss its edge
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 28, 2026
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: f03c315
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 71316d5f-e8ce-4b73-a117-e1d8f90546e6
Commits

Reviewing files that changed from the base of the PR and between 1e81d5b and e850006.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The expanded image dialog now closes only when a pointer press and release both occur on the empty area, while drawing is inactive. Browser tests cover drags between the empty area and the image.

Changes: Expanded image dialog dismissal

Layer / File(s) Summary
Track backdrop pointer presses
apps/web/src/components/chat/ExpandedImageDialog.tsx, apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx
The dialog tracks whether a press began on its empty area and closes only when the release also ends there while drawing is inactive. Browser tests check a backdrop-to-backdrop drag and drags crossing between the backdrop and image.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: maria-rcks

Merge Risk: Minimal · previous review 1e81d

This change keeps the expanded image preview open when a drag starts or ends on the image and still closes it on a plain backdrop click. Impact is limited to this dialog's dismissal behavior, and no concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(web): image preview no longer closes when a press is dragged across its edge" matches the main change. The PR stops the expanded image preview from closing when a press starts on one ar…
Description check Passed The description covers the required template sections. Problem: it explains the bug and gives reproduction steps. Change: it describes the press and release tracking fix in ExpandedImageDialog.tsx and…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(web): image preview no longer closes when a press is dragged across its edge" matches the main change. The PR stops the expanded image preview from closing when a press starts on one area and ends on the other. The title is specific, uses a conventional commit prefix, and names the affected component area (web image preview).

Full details: Description check

Explanation

The description covers the required template sections. Problem: it explains the bug and gives reproduction steps. Change: it describes the press and release tracking fix in ExpandedImageDialog.tsx and its reference to #45032. Scope: it explains why no issue is needed for a small obvious bug, and it cites the steps as the reproduction. Verification: it lists the new CDP browser tests with before and after results, the check:changed outcome, and what was not verified. The template asks for before/after screenshots for UI changes, and the description has none. It also does not include a link to a bug issue. These gaps are minor because the description gives a clear reason for the omission and a recording is not strictly required for this fix.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: eec21fa
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53a4e66d-f3cd-4a06-904c-94747186e270
Commits

Reviewing files that changed from the base of the PR and between eec21fa and 1e81d5b.

Files selected for processing: 2

  • apps/web/src/components/chat/ExpandedImageDialog.browser.test.tsx
  • apps/web/src/components/chat/ExpandedImageDialog.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 28, 2026
@juliusmarminge @claude
Merge remote-tracking branch 'origin/main' into fix/image-preview-dra…
e850006
…g-release

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge
juliusmarminge force-pushed the fix/image-preview-drag-release branch from baa5ce1 to e850006 Compare November 28, 2026 17:45
@juliusmarminge

juliusmarminge commented Nov 28, 2026

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×800, light theme, fresh isolated databases and identical synthetic attachment. Open composer thumbnail; drag image centre to empty popup area and release; repeat in reverse; check plain empty-area and image clicks. Both drags dismiss on base and remain open on head. Both ordinary click controls behave correctly on both commits.

Gesture Before f03c315a3e After e85000659a
Image → empty, before release Before: preview open during drag After: preview open during drag
Image → empty, after release Before: preview incorrectly closed After: preview remains open
Empty → image, before release Before: preview open during reverse drag After: preview open during reverse drag
Empty → image, after release Before: preview incorrectly closed After: preview remains open
Plain empty-area click Before: closes correctly After: closes correctly
Plain image click Before: stays open correctly After: stays open correctly
Recording Before interaction recording After interaction recording

Scenario and synthetic image seed

The base assertion recorded both drag results as false; head passed with both true. Combined proof was assembled using the runner's exported buildProof function from its saved completed side results after the parent command terminated.

Not shown:

  • Timeline-thumbnail entry point, desktop shell, and mobile were not exercised; this proof covers the reported composer-thumbnail web flow.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 28, 2026
@juliusmarminge
juliusmarminge merged commit 0d38e65 into pingdotgg:main Nov 28, 2026
57 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@iamshadmantaqi @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.