Skip to content

fix(attachment): dialog image fits between the chrome, one zoom clamp for wheel, pinch and buttons - #1153

Merged
flipvh merged 1 commit into
mainfrom
fix/attachment-dialog-chrome
Sep 9, 2026
Merged

fix(attachment): dialog image fits between the chrome, one zoom clamp for wheel, pinch and buttons#1153
flipvh merged 1 commit into
mainfrom
fix/attachment-dialog-chrome

Conversation

@flipvh

@flipvh flipvh commented Sep 9, 2026

Copy link
Copy Markdown
Member

Problem

In the attachment dialog a tall image at the default zoom spans the full viewport, so the fixed header and the zoom controls overlap it. Trackpad pinch (and mouse wheel) could not zoom out below 1, which is exactly the fit that collides with the chrome. The header and the viewer also shared z-10, so the image painted over the title bar.

Changes

  • Stage insets. attachmentDialogStageClassName (pt-12 sm:pb-14, hardcoded on purpose) pads the per-slide container in dialog mode so zoom 1 fits between the header and the controls. Overflow still clips at the padding edge, so a zoomed-in image can slide under the translucent chrome as before. The bottom inset only applies from sm up, where the pan/zoom controls render.
  • One zoom clamp. New render/image-zoom.ts holds the floor (0.25), ceiling (8), button step and wheel sensitivity. Buttons, mouse wheel and trackpad pinch all pass through it; wheel zoom is exponential on deltaY, so pinch is continuous and a mouse notch is roughly 20%.
  • Stacking. Header moves to z-20, the viewer loses its z-10.
  • Cleanups. Both entry points drop a headerClassName that never rendered (no title, so no DialogHeader), the dialog uses the shared wrapper class instead of an inline copy, the controls center with a translate instead of a 50vw calculation, PDF and video drop their ad hoc viewport offsets in favor of the padded stage.

Verification

  • Frontend typecheck, biome, style gate and SDK regeneration pass; a new vitest covers the clamp.
  • Not runtime-verified in a browser. Please check: portrait image at default zoom, trackpad pinch out, zoom buttons to the floor, rotate, caption toggle (it still overlays the image when open, as agreed), a PDF and a video in the dialog, and a mobile width.

Fork impact

Unpinned template files only; forks pick this up on the next sync without a migration.

🤖 Generated with Claude Code

… for wheel, pinch and buttons

The per-slide stage now reserves the fixed header and zoom-control heights, so
zoom 1 fits inside the chrome instead of behind it. Wheel and trackpad pinch
zoom exponentially and share the button clamp (0.25 to 8) instead of stopping
at 1. The header moves to z-20 so the viewer no longer paints over the title.
PDF and video drop their ad hoc viewport offsets, both entry points drop a
headerClassName that never rendered, and the dialog uses the wrapper class
from params.ts instead of an inline copy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@flipvh
flipvh merged commit a826b1f into main Sep 9, 2026
10 checks passed
@flipvh
flipvh deleted the fix/attachment-dialog-chrome branch September 9, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant