Skip to content

Overview: show minimized windows in grid to fix badge count mismatch - #452

Merged
AllTerrainDeveloper merged 6 commits into
WordPress:trunkfrom
KarunyaChavan:fix/overview-minimized-window-count
Jul 30, 2026
Merged

Overview: show minimized windows in grid to fix badge count mismatch#452
AllTerrainDeveloper merged 6 commits into
WordPress:trunkfrom
KarunyaChavan:fix/overview-minimized-window-count

Conversation

@KarunyaChavan

@KarunyaChavan KarunyaChavan commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the window count badge in Overview mode including minimized windows while the grid filtered them out, causing a mismatch between the badge number and the visible thumbnail tiles. Instead of filtering minimized windows from the grid, they now render as dimmed thumbnails (60% opacity) so the badge and grid stay consistent.

Closes #437

Why:

  • When entering Overview with partially minimized windows (e.g., 2 open, 1 minimized), the count badge displayed 2 but the grid only showed 1 thumbnail — a confusing mismatch that undermines Overview as a workspace overview tool.
  • The fix also removes the brittle "all-minimized" auto-restore path (Show Desktop → Overview), since the grid now renders minimized windows directly.

What Changed:

  • Overview: Minimized windows now appear in the Overview grid. Removed the "all minimized" auto-restore behavior, restored the selected minimized window before focusing it on exit, and added helper functions to keep thumbnails renderable while preserving fullscreen state.

  • src/window/index.ts: Updated the minimize() transition handler so Overview thumbnails don't accidentally hide their content during opacity transitions.

  • src/window-manager/desktops.ts: Updated Overview relayout to include minimized windows and reuse the new layout helper functions.

  • assets/css/window-overview.css: Dimmed minimized thumbnails (opacity: 0.6) so they're easy to distinguish, and removed a redundant pointer-events rule.

  • tests/vitest/desktops.test.ts: Updated existing tests for the new minimized-window behavior and added coverage for the badge count regression, thumbnail rendering, transition handling, and fullscreen restoration.

Steps for Testing:

  1. Open two windows (e.g. Dashboard and Posts).
  2. Minimize only the Dashboard window.
  3. Enter Overview.
  4. Verify: Both windows appear as grid tiles — Posts at full opacity, Dashboard at ~60% opacity.
  5. Verify: The count badge in .desktop-mode-overview-top-bar__tile-wrapper reads 2, matching the number of visible tiles.
  6. Click the minimized Dashboard tile to exit Overview.
  7. Verify: Dashboard restores to its normal (non-minimized) state and receives focus.
  8. Fullscreen edge case: Open a window, toggle fullscreen, minimize it, enter Overview. Select it. Verify: The window exits to fullscreen (not a thumbnail-sized layout).
  9. Regression — "Show Desktop → Overview": Minimize all windows on the active desktop. Enter Overview. Verify: All windows appear as dimmed thumbnails in the grid (not an empty grid), and the count badge matches the grid tile count.

…m out.

- Include minimized windows in the overview grid so the count badge and thumbnail grid are always consistent
- Render minimized thumbnails at 60% opacity as a visual cue, without auto-restoring the window (preserving user's minimization intent)
- Restore minimized windows on click before focusing, so landing on a minimized tile un-minimizes it
- Remove the "all-minimized" Show Desktop auto-restore path — it's no longer needed since the grid now renders minimized windows directly
…inimized case

- Replace the "all-minimized auto-restore" test — minimized windows now stay minimized in the grid instead of being restored
- Assert count badge textContent equals `.desktop-mode-window--overview` length when 1 of 3 windows is minimized, closing the original badge/grid mismatch regression
- Remove the "partial-minimize unchanged" assertion (minimized windows now get the `--overview` class like every other window)
- Guard minimize() transitionend listener with !--overview class check so a pending opacity transition can't re-hide content-visibility/iframe while the window is an active overview thumbnail
- Restore --fullscreen class before selected.restore() on the selection path so the element carries the class when restore flips the state to 'fullscreen' and calls updateFullscreenBodyClass()
- Centralize render-suppression and fullscreen-strip logic into prepareWindowForOverviewLayout / restoreWindowAfterOverviewLayout so enterOverview and relayoutOverviewForActiveDesktop stay in sync.
- Remove redundant pointer-events: auto from the minimized-overview CSS.
- Verifies enterOverview resets content-visibility and iframe visibility on completed-minimize windows so thumbnails render actual content
- Confirms transitionend listener does not re-hide content-visibility/iframe when the window is already in overview (overview-class guard)
- Confirms exitOverview re-applies --fullscreen class before win.restore() so the fullscreen resize path runs instead of leaving a thumbnail-sized layout
@KarunyaChavan

Copy link
Copy Markdown
Contributor Author

Note: These changes introduce a behavioral change.

Previously, if all open windows were minimized before entering Overview, they would all be restored automatically once user entered Overview.

With this change, minimized windows remain minimized when entering Overview. If the user selects a minimized window, only that window is restored. If no window is selected, all windows remain minimized, resulting in behavior similar to Show Desktop on Windows.

@KarunyaChavan
KarunyaChavan marked this pull request as ready for review July 30, 2026 07:55

@AllTerrainDeveloper AllTerrainDeveloper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and very happy with those improvements! Thank you!

Image

Comment on lines +305 to +309
test( 'enterOverview makes completed-minimize windows renderable for thumbnails', async () => {
// Regression guard for the "minimized thumbnail renders blank" bug.
// After the minimize transition fires, `content-visibility: hidden`
// and `iframe.style.visibility = 'hidden'` are set on the window.
// enterOverview must reverse these so the overview thumbnail shows

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome

@AllTerrainDeveloper
AllTerrainDeveloper merged commit 791ee3a into WordPress:trunk Jul 30, 2026
7 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.

Overview: window count badge includes minimized windows when they are not shown in the grid

2 participants