fix: hide window immediately when no visible items (fixes #61)#62
Merged
Conversation
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>
There was a problem hiding this comment.
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 applyingminimumDisplayMsdelay, hiding immediately when no items are visible - Added comprehensive test case verifying the window hides immediately when items are auto-removed with both
hideDelayandminimumDisplayMsconfigured
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.
|
🎉 This PR is included in version 2.1.6 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
hideDelay+minimumDisplayMstogether, the window now hides immediately if there are no visible itemsProblem
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 forminimumDisplayMseven when there were no visible items to display.Solution
The fix checks if there are any visible items before applying the
minimumDisplayMsdelay:hideDelaybefore closing (to allow window reuse)autoRemove: false), it respectsminimumDisplayMsas beforeTest plan
should hide immediately when item is auto-removed with hideDelay + minimumDisplayMs (fixes #61)Closes #61
🤖 Generated with Claude Code