Skip to content

refactor(profile): use shared ImageView lightbox for workspace photos#6227

Merged
tsahimatsliah merged 1 commit into
claude/elegant-sammet-973b0afrom
claude/workspace-photos-imageview
Jun 21, 2026
Merged

refactor(profile): use shared ImageView lightbox for workspace photos#6227
tsahimatsliah merged 1 commit into
claude/elegant-sammet-973b0afrom
claude/workspace-photos-imageview

Conversation

@tsahimatsliah

@tsahimatsliah tsahimatsliah commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

Replace the bespoke inline image lightbox in ProfileUserWorkspacePhotos with the shared LazyModal.ImageView (ImageModal), so the workspace-photos viewer and the post image lightbox share one implementation and can't drift.

The shared modal is strictly more capable: FLIP zoom-from-thumbnail entrance, capture-phase Escape handling, body scroll-lock with scrollbar compensation, and an onError fallback.

Changes

  • Open the lightbox via useLazyModal().openModal({ type: LazyModal.ImageView, props: { src, alt, originRect: getImageOriginRect(el) } }) so it expands from the clicked photo.
  • Thread the click event through WorkspacePhotoItem's onClick to capture the thumbnail bounds.
  • Remove the selectedPhoto state, the inline dialog markup, the Esc listener, and the now-unused CloseButton / useEventListener imports.
  • Update the spec to assert the click delegates to LazyModal.ImageView (the lightbox's own close/Esc behavior is covered by ImageModal.spec.tsx).

Notes

Verification

  • node ./scripts/typecheck-strict-changed.js ✅ · eslint on changed files ✅ · updated spec ✅

🤖 Generated with Claude Code

Preview domain

https://claude-workspace-photos-imagevie.preview.app.daily.dev

Replace the bespoke inline lightbox in ProfileUserWorkspacePhotos with the
shared LazyModal.ImageView (ImageModal), so both surfaces share one
implementation and can't drift. The shared modal adds a FLIP zoom-from-thumbnail
entrance, capture-phase Escape handling, body scroll-lock with scrollbar
compensation, and an onError fallback.

- Open the lightbox via useLazyModal().openModal with the clicked thumbnail's
  bounds (getImageOriginRect) so it expands from the photo.
- Thread the click event through WorkspacePhotoItem's onClick to capture those
  bounds.
- Drop the selectedPhoto state, the inline dialog markup, the Esc listener, and
  the now-unused CloseButton/useEventListener imports.
- Update the spec to assert the click delegates to LazyModal.ImageView (the
  lightbox's own close/Esc behavior is covered by ImageModal.spec).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Jun 21, 2026 11:06am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Jun 21, 2026 11:06am

Request Review

@tsahimatsliah tsahimatsliah merged commit 130f522 into claude/elegant-sammet-973b0a Jun 21, 2026
12 checks passed
@tsahimatsliah tsahimatsliah deleted the claude/workspace-photos-imageview branch June 21, 2026 12:08
@tsahimatsliah

Copy link
Copy Markdown
Member Author

Folded into #6224 (the workspace-photos refactor commit now lives on that branch), so there's a single PR for the team to review. Closing this one.

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