Skip to content

fix: stop the preview Expand button from covering Close - #302

Merged
cxymds merged 2 commits into
rustfs:mainfrom
joeyshi12:fix/preview-dialog-header-buttons
Nov 14, 2026
Merged

cxymds merged 2 commits into
rustfs:mainfrom
joeyshi12:fix/preview-dialog-header-buttons

Conversation

@joeyshi12

@joeyshi12 joeyshi12 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Description

In the object preview dialog, the Expand button is drawn on top of the Close button. Expand sits inside the header, which is padded to end 32px from the right edge on desktop ([@media(hover:hover)_and_(pointer:fine)]:pe-8). Close is placed 16px from the right edge by the shared .console-dialog [data-slot="dialog-close"] rule in styles/console.css. Both buttons are 32px, so they overlapped by 16px horizontally and 28px vertically (measured in Chromium at 1440x900: Expand x 1104 to 1136, Close x 1120 to 1152).

This moves both buttons into one positioned row at the shared 1rem close-button offset. Close stays exactly where it is in every other console dialog, and Expand sits 4px to its left. The header reserves 112px on mobile for both 44px touch targets, their gap and end offset, and 96px on desktop. Long translated words can wrap inside that space, so the Russian title remains clear of Expand at 320px.

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
pnpm install --frozen-lockfile   # exit 0
pnpm type-check                  # exit 0
pnpm lint                        # exit 0
pnpm format:check                # exit 0
pnpm test:run                    # 1061 passed, 0 failed
  • New source test in tests/lib/object-preview-source.test.js: "object preview dialog places Expand next to Close instead of underneath it". Negative control: run against the main version of preview-modal.tsx, it fails (1059 passed, 1 failed).
  • Chromium against a local RustFS 1.0.5, previewing a PNG. Button positions after the change: desktop 1440x900, Expand x 1084 to 1116 and Close x 1120 to 1152 on the same row; touch 820x1180, Expand x 720 to 752 and Close x 756 to 788; expanded state, Collapse x 1340 to 1372 and Close x 1376 to 1408. Close is at the same position as before in all three.

The header regression test also checks enough mobile space for both touch targets and long-word wrapping. Against the previous PR head, this new check fails; with the fix, all 16 preview tests pass.

Focused browser verification used the actual preview component with local sample content: English at 1440x900, Russian and Arabic RTL at 320x812, light/dark themes, keyboard expand/collapse/close, and empty/error previews. Desktop controls remain at x1084–1116 (Expand) and x1120–1152 (Close). In the 320px Russian view, text ends at x184.25 and Expand starts at x196. The ten CI checks, including the production build, pass for the final head.

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

No linked issue. The overlap appeared after the header redesign in #270, which moved Close to the shared offset while the Expand padding from #223 stayed at 32px.

Screenshots (if applicable)

Before (Expand covers Close):

Preview dialog header before

After:

Preview dialog header after

Full dialog, before and after:

Preview dialog before
Preview dialog after

Mobile Russian title and keyboard focus, before/after the mobile correction (same viewport and theme):

Mobile preview header before and after

Arabic RTL, 320px:

Arabic mobile preview

Final English desktop preview:

Desktop preview

Additional Notes

The additional screenshots show an isolated instance of the real preview component with local sample content. They validate layout and interaction without exercising a RustFS deployment.

joeyshi12 and others added 2 commits November 13, 2026 18:01
The Expand button sat inside the dialog header, which ends 32px from the right edge on desktop, while Close is positioned at 16px from the right edge by the shared console-dialog rule. The two 32px buttons overlapped by 16px and Expand was drawn over Close. Both buttons now sit in one positioned row at the shared close-button offset, so Close stays where it is in every other dialog and Expand sits 4px to its left.
Reserve room for both mobile touch targets and allow long translated words to wrap instead of drawing under Expand. Preserve the desktop offsets and strengthen the header regression coverage.
@cxymds
cxymds merged commit 9aa3456 into rustfs:main Nov 14, 2026
10 checks passed
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.

2 participants