Repository navigation
fix(desktop): restore minimized apps from desktop icons - #181
Conversation
Ziqian-Huang0607
left a comment
There was a problem hiding this comment.
Verified the fix and the reasoning.
The change is minimal and correct: OPEN_APP's existing-app branch already sets activeApp and raises the zIndex, so the extra SET_ACTIVE_APP dispatch in AppIcon was redundant, and adding isMinimized: false there restores the window instead of launching a duplicate. The taskbar path uses RESTORE_APP, which is untouched.
I ran the new test locally against current main and it passes. I also confirmed it fails without the AppContext change (the icon double-click left the window minimized), so the regression test is real.
One pre-existing inconsistency I noticed while reading the reducer, not caused by this PR and not blocking: SET_ACTIVE_APP sets minimized: false (wrong key, should be isMinimized). Nothing seems to dispatch SET_ACTIVE_APP for a minimized window today, but it is a trap for the next person. Worth a one-line follow-up issue.
Approve.
dailker
left a comment
There was a problem hiding this comment.
Nice, clean fix. Clearing isMinimized in OPEN_APP also fixes the launcher, and dropping the extra SET_ACTIVE_APP is safe since OPEN_APP already sets the active app. Thanks for the test and screenshots.
Closes #173
Double-clicking a minimized app's desktop icon restores and focuses the existing window. Closed apps still launch on double-click.
Verification
The regression test fails before the fix and passes after it. All 419 tests and the production build passed locally.
Screenshots
Before
After