Repository navigation
fix: stop the preview Expand button from covering Close - #302
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 instyles/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
Testing
tests/lib/object-preview-source.test.js: "object preview dialog places Expand next to Close instead of underneath it". Negative control: run against themainversion ofpreview-modal.tsx, it fails (1059 passed, 1 failed).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
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):
After:
Full dialog, before and after:
Mobile Russian title and keyboard focus, before/after the mobile correction (same viewport and theme):
Arabic RTL, 320px:
Final English 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.