Skip to content

feat(admin): minimize a floating window instead of dismissing it - #660

Open
mostafasadeghidev wants to merge 1 commit into
CoreBunch:mainfrom
mostafasadeghidev:feat/floating-window-minimize
Open

mostafasadeghidev wants to merge 1 commit into
CoreBunch:mainfrom
mostafasadeghidev:feat/floating-window-minimize

Conversation

@mostafasadeghidev

Copy link
Copy Markdown
Contributor

Split out of #501, per review: minimize alone, on main.

What

A minimizable prop on FloatingWindow adds a collapse control beside Close that folds the window to its title bar. Header actions fold with the body they act on. The upload queue and the bulk edit window opt in.

The media viewer builds its own shell rather than FloatingWindow, so it wires the same control itself.

Why

The upload queue mid-transfer, a bulk edit mid-review, the viewer beside the grid: closing loses the panel, and keeping it covers the grid.

Details

  • The viewer's height is a fixed length, so hiding the body alone left a full-size empty pane under the title bar. data-minimized collapses the height as well, while the top offset still clamps against the full height, so a window folded near the bottom edge doesn't jump.
  • Minimized state is per-session, and a folded window stays where it sits. The position is the user's own, and folding to a corner would discard it.

Tests

minimizeWindow.test.tsx renders the real FloatingWindow and MediaViewerWindow and presses the real control. Each was checked against a window that hides nothing or keeps its height.

Overlaps

This touches the same lines as #500 (FloatingWindow: its useTopmostEscape call sits beside the new state) and as #497/#507 (MediaViewerWindow's header). Each overlap is a line or two, and whichever lands second is a trivial rebase. I'll do it.

Verification

bunx tsc -b                                       clean
bunx eslint src/admin/shared/FloatingWindow src/admin/pages/media   clean
bun test src/__tests__/media                      all pass

Docs: docs/features/media.md, Floating windows.

A floating window that stays useful while the user works around it — the
upload queue mid-transfer, a bulk edit mid-review, the viewer — offered
two choices: close it and lose it, or let it cover the grid. A
`minimizable` FloatingWindow now gets a collapse control beside Close that
folds it to its title bar; its header actions fold with the body they act
on. The upload queue and the bulk edit window opt in.

The media viewer builds its own shell rather than FloatingWindow, so it
wires the same control itself. Its height is a fixed length, so hiding the
body alone left a full-size empty pane: `data-minimized` collapses the
height too, while the top offset still clamps against the full height so a
window folded near the bottom edge does not jump.

Minimized state is per-session, and a folded window stays where it sits —
the position is the user's own, and folding to a corner would discard it.

The tests render the real windows and press the real control; each was
checked against a window that hides nothing or keeps its height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mostafasadeghidev added a commit to mostafasadeghidev/Instatic that referenced this pull request Oct 16, 2026
…tests

The stack already carried CoreBunch#501's minimize code, identical to CoreBunch#660's; the
two conflicts were lines CoreBunch#660 does not have (CoreBunch#500's useTopmostEscape, the
viewer's purge-confirmation state from CoreBunch#497/CoreBunch#507), kept as they were, and
the merge's second `minimizable` attribute on two windows is dropped. What
this adds is CoreBunch#660's docs and its tests, which render the real windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mostafasadeghidev added a commit to mostafasadeghidev/Instatic that referenced this pull request Oct 16, 2026
…ch#501 is now three PRs

CoreBunch#335 and CoreBunch#499 move to the landed table (shipped in v0.0.21). CoreBunch#501 was
closed in review and asked to come back split: its rows become CoreBunch#658
(select-all), CoreBunch#659 (upload queue stays closed) and CoreBunch#660 (minimize). The
three parts of CoreBunch#501 that are in none of them — the Uploads progress label,
the queue's bottom-left default, and the Dialog body size — are listed as
carried-but-not-proposed, so the README still says what a server runs.

Also: what an installation needs before moving to plain upstream, since
upstream's 031 repeats an ALTER this branch ran as 025.

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

This branch has not been deployed

No deployments
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