Recover from task switcher issue with minimized windows#4400
Conversation
|
🥷 Code experts: Jack251970 Jack251970 has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame:
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
|
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughAdds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Flow.Launcher/PluginSettingsWindow.xaml.cs`:
- Around line 95-104: The restore logic in Window_Activated uses
_settings.SettingWindowState (global SettingWindow history) which can reopen
PluginSettingsWindow with the wrong state; add a PluginSettingsWindow-local
field (e.g., _lastNonMinimizedState) that you update whenever this window's
StateChanged handler sees a non-minimized state, and change Window_Activated to
restore WindowState from that local field instead of
_settings.SettingWindowState; update any StateChanged or closing logic in the
PluginSettingsWindow class to maintain _lastNonMinimizedState so the window
reliably returns to its own last non-minimized state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5e62d825-f765-456b-a5bf-d6a32c0d4403
📒 Files selected for processing (4)
Flow.Launcher/PluginSettingsWindow.xamlFlow.Launcher/PluginSettingsWindow.xaml.csFlow.Launcher/SettingWindow.xamlFlow.Launcher/SettingWindow.xaml.cs
Catches case where window is activated but not restored / maximized and then manually does that
e3dc615 to
8783bac
Compare
Catches case where window is activated but not restored / maximized and then manually does that
Partially resolves #4397
This doesn't fix the core issue but does recover from it to get to the desired state regardless.
There will still be an error sound, but the window will be restored/maximized based on the state it was before being minimized.
Summary by cubic
Fixes a rare Alt+Tab case where Settings and Plugin Settings stayed minimized after activation. On activation, each window restores to its last non-minimized state so it shows up in the task switcher.
PluginSettingsWindownow tracks the last non-minimized state inOnLoaded/Window_StateChanged;SettingWindowstate persistence remains the same.Activated="Window_Activated"on both windows; on activation, if minimized,SettingWindowrestores to_settings.SettingWindowStateandPluginSettingsWindowrestores to_lastNonMinimizedWindowState.PluginSettingsWindowand one extra event subscription per window).Written for commit 8783bac. Summary will update on new commits.