Skip to content

feat: make object preview dialogs resizable - #223

Merged
cxymds merged 1 commit into
mainfrom
cxymds/feat-resizable-object-preview
Sep 7, 2026
Merged

feat: make object preview dialogs resizable#223
cxymds merged 1 commit into
mainfrom
cxymds/feat-resizable-object-preview

Conversation

@cxymds

@cxymds cxymds commented Sep 7, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

File previews previously used a fixed dialog size. This change lets users drag the preview corner on desktop or use Expand/Collapse to choose a comfortable reading area.

  • Keep the dialog anchored while dragging, constrain it to the viewport, and restore its previous manual size after collapsing an expanded view.
  • Make text, image, PDF, Parquet, TIFF, and sandbox previews follow the available space; refit images when the preview container changes size.
  • Preserve compact defaults for audio and unsupported files, with keyboard-accessible scrolling, localized controls, and touch-friendly buttons.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed

All required checks passed in an isolated worktree based on main:

nvm use v22
pnpm install --frozen-lockfile
pnpm type-check
pnpm lint
pnpm format:check
pnpm test:run
git diff --check
  • Full suite: 489 passed, 0 failed, including 13 preview dispatch/source checks.
  • Chromium interaction testing with synthetic fixtures covers pointer resizing, viewport bounds, keyboard Expand/Collapse with manual-size restoration, PageDown scrolling, image refitting, and mobile layout.
  • At a 1280×720 viewport, the dialog resized from 896×612 to 1036×640, expanded to 1248×688, and collapsed back to 1036×640. At 390×844, it remained within the viewport with 44×44 touch controls.
  • Independent correctness, testing, UX/accessibility, and simplification reviews completed.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

Related Issues

Implements the requested resizable file-preview window. No linked GitHub issue.

Screenshots (if applicable)

All captures use the English UI and synthetic English fixture content rendered by the actual preview component. The temporary fixture routes are not included in this PR.

Desktop: before and after (1280×720)

Before: fixed dialog After: resizable dialog
Before: fixed file preview window in the English UI After: English file preview with corner resizing and Expand control

Desktop: resizing controls

After dragging the corner After keyboard Expand
English file preview after dragging the native resize corner English file preview expanded with the keyboard

Mobile: before and after (390×844)

Before After After Expand
Before: English mobile preview After: English mobile preview with touch-friendly controls After: expanded English mobile preview
Desktop dark mode Resizable English file preview in dark mode
Image refitting after resizing
Default dialog size Smaller dialog after dragging
Image preview at the default dialog size Image automatically refitted inside the smaller preview dialog

The screenshots are hosted at an immutable commit on the separate evidence branch. They are not included in this PR's changed files.

Additional Notes

  • Native corner resizing is enabled for desktop fine-pointer devices; Expand/Collapse is also available on touch and narrow screens.
  • No new dependencies, backend changes, or edits to the shared UI primitives.
  • Automated preview checks cover dispatch and source structure; Safari/Firefox and end-to-end loading of real PDF, Parquet, and TIFF files were not tested.
  • The image fixture displayed correctly and refitted after resizing; the development console reported Next Image initial-height and LCP warnings during loading. Live S3 integration was not tested.

Let users choose a comfortable preview size with pointer resizing and keyboard-accessible expand/collapse controls. Keep media and scrolling content within viewport bounds and preserve the previous size when collapsing an expanded dialog.
@cxymds
cxymds merged commit 786d4f4 into main Sep 7, 2026
10 checks passed
@cxymds
cxymds deleted the cxymds/feat-resizable-object-preview branch September 7, 2026 01:56
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