Skip to content

Conversation

@haefele
Copy link
Owner

@haefele haefele commented Jan 10, 2026

No description provided.

When the user closed the chat window with the X button, the window was
hidden instead of closed to preserve state. However, when trying to
reopen it, the parent ViewModel would call Activate() on the existing
WindowHandle, which only activated the window without showing it first.
This caused the window to remain hidden.

The fix ensures that WindowHandle.Activate() calls Show() before
Activate() to make the window visible, similar to ChatView.ShowAndActivate().
Removed the workaround that hid the chat window instead of closing it.
The window now closes normally when the user clicks X, which is simpler
and cleaner. When reopened, a fresh window and ViewModel are created.

Changes:
- Removed _forceClose field and ForceClose() method from ChatView
- Simplified OnClosing to perform cleanup and allow normal close
- Reverted WindowHandle.Activate() to not call Show() (no longer needed)
The ShowAndActivate method was only used when creating new chat windows,
where the minimized state check was unnecessary. Simplified by calling
Show() and Activate() directly in the dialog service.
@haefele haefele enabled auto-merge (rebase) January 10, 2026 13:22
@haefele haefele merged commit 92f8fac into main Jan 10, 2026
2 of 3 checks passed
@haefele haefele deleted the claude/fix-chat-window-reopen-FLdph branch January 10, 2026 14:52
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.

3 participants