Skip to content

fix: hide window immediately when no visible items (fixes #61)#62

Merged
jjeff merged 1 commit intomainfrom
fix/issue-61-empty-titlebar
Jan 27, 2026
Merged

fix: hide window immediately when no visible items (fixes #61)#62
jjeff merged 1 commit intomainfrom
fix/issue-61-empty-titlebar

Conversation

@jjeff
Copy link
Collaborator

@jjeff jjeff commented Jan 27, 2026

Summary

  • Fixed bug where window showed empty titlebar for up to 3 seconds after items were auto-removed
  • When using hideDelay + minimumDisplayMs together, the window now hides immediately if there are no visible items

Problem

When a progress item completed and auto-removed (the default behavior), the window would display an empty titlebar for up to 3 seconds (the default minimumDisplayMs) before hiding. This happened because #hideThenCloseIfEmpty() waited for minimumDisplayMs even when there were no visible items to display.

Solution

The fix checks if there are any visible items before applying the minimumDisplayMs delay:

  • If there are no visible items, the window now hides immediately and only waits for hideDelay before closing (to allow window reuse)
  • If there are visible items (completed but still displayed when autoRemove: false), it respects minimumDisplayMs as before

Test plan

  • Added test case should hide immediately when item is auto-removed with hideDelay + minimumDisplayMs (fixes #61)
  • All existing tests pass (158 tests)
  • Lint and type-check pass

Closes #61

🤖 Generated with Claude Code

When a progress item completed and auto-removed, the window would display
an empty titlebar for up to 3 seconds (the default minimumDisplayMs) before
hiding. This happened because #hideThenCloseIfEmpty() waited for minimumDisplayMs
even when there were no visible items to display.

The fix checks if there are any visible items BEFORE applying the minimumDisplayMs
delay. If there are no visible items, the window now hides immediately and only
waits for hideDelay before closing (to allow window reuse).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 27, 2026 17:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where an empty window titlebar would display for up to 3 seconds (the default minimumDisplayMs) after progress items were auto-removed, even though there was no content to show.

Changes:

  • Modified #hideThenCloseIfEmpty() to check for visible items before applying minimumDisplayMs delay, hiding immediately when no items are visible
  • Added comprehensive test case verifying the window hides immediately when items are auto-removed with both hideDelay and minimumDisplayMs configured

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/ProgressWindow/ProgressWindow.ts Added early-return path in #hideThenCloseIfEmpty() that hides window immediately when no visible items exist, bypassing minimumDisplayMs while still respecting hideDelay for window reuse
test/unit/ProgressWindow.test.ts Added test case that verifies window hides immediately (not after 3s) when item is auto-removed with both hideDelay and minimumDisplayMs configured

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jjeff jjeff merged commit 45a48a9 into main Jan 27, 2026
10 checks passed
@github-actions
Copy link

🎉 This PR is included in version 2.1.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Window shows empty titlebar after items removed when using hideDelay + minimumDisplayMs

2 participants