Skip to content

Conversation

@VictoriousRaptor
Copy link
Contributor

Show taskbar when Flow is opened

Tested

  • Taskbar shows up when Flow is opened
  • Taskbar hides when Flow is closed
  • I suppose that it won't work on a dual monitor setup but I can't test it. Need some help.

Copilot AI and others added 6 commits December 21, 2025 19:25
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
…howing

Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com>
@github-actions github-actions bot added this to the 2.1.0 milestone Dec 22, 2025
@gitstream-cm
Copy link

gitstream-cm bot commented Dec 22, 2025

🥷 Code experts: Jack251970

Jack251970, jjw24 have most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Flow.Launcher.Infrastructure/NativeMethods.txt

Activity based on git-commit:

Jack251970 jjw24
DEC
NOV
OCT
SEP 6 additions & 1 deletions
AUG
JUL 7 additions & 10 deletions

Knowledge based on git-blame:
Jack251970: 76%

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Activity based on git-commit:

Jack251970 jjw24
DEC
NOV
OCT 31 additions & 52 deletions
SEP 2 additions & 3 deletions
AUG
JUL 45 additions & 4 deletions 582 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 91%

Flow.Launcher.Infrastructure/Win32Helper.cs

Activity based on git-commit:

Jack251970 jjw24
DEC
NOV
OCT
SEP 118 additions & 6 deletions
AUG
JUL 57 additions & 20 deletions 795 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 93%

Flow.Launcher/Languages/en.xaml

Activity based on git-commit:

Jack251970 jjw24
DEC
NOV
OCT 13 additions & 10 deletions
SEP 14 additions & 6 deletions
AUG 4 additions & 0 deletions
JUL 48 additions & 13 deletions

Knowledge based on git-blame:
Jack251970: 94%

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Activity based on git-commit:

Jack251970 jjw24
DEC
NOV
OCT 405 additions & 348 deletions
SEP 2 additions & 2 deletions
AUG
JUL 41 additions & 36 deletions

Knowledge based on git-blame:
Jack251970: 91%

Flow.Launcher/ViewModel/MainViewModel.cs

Activity based on git-commit:

Jack251970 jjw24
DEC
NOV 106 additions & 94 deletions
OCT 125 additions & 88 deletions
SEP 13 additions & 15 deletions
AUG
JUL 76 additions & 51 deletions

Knowledge based on git-blame:
Jack251970: 85%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link

gitstream-cm bot commented Dec 22, 2025

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Dec 22, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 22, 2025

📝 Walkthrough

Walkthrough

Adds an option and UI to temporarily show the taskbar when Flow Launcher is opened, new Win32 interop (MonitorFromWindow) and Win32Helper taskbar show/hide methods, and conditional calls in MainViewModel to invoke those methods based on Settings.ShowTaskbarWhenInvoked.

Changes

Cohort / File(s) Summary
Win32 interop & helpers
Flow.Launcher.Infrastructure/NativeMethods.txt, Flow.Launcher.Infrastructure/Win32Helper.cs
Added MonitorFromWindow native entry to declarations. Implemented ShowTaskbar() and HideTaskbar() in Win32Helper to locate Shell_TrayWnd and post APPBAR messages, using monitor lookup.
Settings model
Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Added public bool property ShowTaskbarWhenInvoked { get; set; } (default false).
UI & localization
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml, Flow.Launcher/Languages/en.xaml
Added ToggleSwitch bound to Settings.ShowTaskbarWhenInvoked in general settings. Added localization keys showTaskbarWhenOpened and showTaskbarWhenOpenedToolTip.
Application logic
Flow.Launcher/ViewModel/MainViewModel.cs
On Show(), call Win32Helper.ShowTaskbar() when setting is enabled; on Hide(), call Win32Helper.HideTaskbar() when enabled (placed around existing show/hide sequences).

Sequence Diagram(s)

sequenceDiagram
    participant UI as User / UI
    participant VM as MainViewModel
    participant Helper as Win32Helper
    participant OS as Windows (Shell_TrayWnd)

    UI->>VM: Open command
    VM->>VM: Check Settings.ShowTaskbarWhenInvoked
    alt enabled
        VM->>Helper: ShowTaskbar()
        Helper->>OS: Find Shell_TrayWnd & MonitorFromWindow
        Helper->>OS: Post message to show taskbar
    end
    VM->>VM: Update Dispatcher / show Flow window

    UI->>VM: Close command
    VM->>VM: Restore keyboard/layout etc.
    VM->>VM: Check Settings.ShowTaskbarWhenInvoked
    alt enabled
        VM->>Helper: HideTaskbar()
        Helper->>OS: Post message to hide taskbar
    end
    VM->>VM: Finish hide sequence / delay
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review Win32Helper: verify correct native signatures, monitor selection flags, APPBARDATA/message values, and safe/unsafe usage.
  • Inspect MainViewModel placement: ensure Show/Hide calls do not race with existing dispatcher, keyboard layout restoration, or async delays.
  • Confirm Settings persistence/migration: new property default and serialization behavior.

Possibly related PRs

Suggested reviewers

  • jjw24
  • Jack251970
  • onesounds

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an option to show the taskbar when Flow Launcher opens, which matches the changeset's primary functionality.
Description check ✅ Passed The description is directly related to the changeset, documenting the feature implementation and noting testing status including a known limitation on dual-monitor setups.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/add-show-taskbar-option

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b17beec and a096729.

📒 Files selected for processing (1)
  • Flow.Launcher.Infrastructure/Win32Helper.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • Flow.Launcher.Infrastructure/Win32Helper.cs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Flow.Launcher.Infrastructure/NativeMethods.txt (1)

88-96: Remove the DeviceNotifyCallbackRoutine entry causing CsWin32 warning

The DeviceNotifyCallbackRoutine entry at line 94 doesn't match any recognized symbol in the Win32 metadata. DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS already includes PDEVICE_NOTIFY_CALLBACK_ROUTINE as its callback field, which means the necessary callback type support is automatically generated when you request the struct.

Remove line 94 entirely. The MonitorFromWindow entry is correct and required for the taskbar logic.

🧹 Nitpick comments (1)
Flow.Launcher.Infrastructure/Win32Helper.cs (1)

1021-1055: Tidy up Taskbar helpers and call out multi‑monitor limitation

The core ShowTaskbar/HideTaskbar logic looks fine and matches the SmartTaskbar pattern, but a couple of cleanups would help:

  • ShowTaskbar is marked unsafe but doesn’t use any unsafe constructs; the modifier can be dropped.
  • APPBARDATA is now unused after switching away from ABM_SETSTATE, so it can be removed to avoid confusion.
  • This implementation only targets the primary taskbar (Shell_TrayWnd). That aligns with the current PR note ("may not work on dual‑monitor setups"), but if you later want multi‑monitor support you’ll likely need to also handle Shell_SecondaryTrayWnd (and potentially call the same message per monitor).

These are all non‑blocking, but worth tightening either in this PR or a follow‑up.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a08a456 and b17beec.

📒 Files selected for processing (6)
  • Flow.Launcher.Infrastructure/NativeMethods.txt
  • Flow.Launcher.Infrastructure/UserSettings/Settings.cs
  • Flow.Launcher.Infrastructure/Win32Helper.cs
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
  • Flow.Launcher/ViewModel/MainViewModel.cs
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:252-275
Timestamp: 2025-10-16T10:48:30.573Z
Learning: In Flow Launcher's App.xaml.cs, the plugin initialization block (lines 252-275) that includes PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, _mainVM.QueryResults(), and API.SaveAppAllSettings() does not require additional Task.Run wrappers or Dispatcher.InvokeAsync calls according to maintainer Jack251970, as the threading model is already safe as designed.
📚 Learning: 2025-10-16T10:48:30.573Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3854
File: Flow.Launcher/App.xaml.cs:252-275
Timestamp: 2025-10-16T10:48:30.573Z
Learning: In Flow Launcher's App.xaml.cs, the plugin initialization block (lines 252-275) that includes PreStartPluginExecutablePathUpdate, PluginManager.LoadPlugins, PluginManager.InitializePluginsAsync, _mainVM.QueryResults(), and API.SaveAppAllSettings() does not require additional Task.Run wrappers or Dispatcher.InvokeAsync calls according to maintainer Jack251970, as the threading model is already safe as designed.

Applied to files:

  • Flow.Launcher/ViewModel/MainViewModel.cs
📚 Learning: 2025-06-08T14:12:21.348Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3672
File: Flow.Launcher/MainWindow.xaml.cs:244-247
Timestamp: 2025-06-08T14:12:21.348Z
Learning: In Flow.Launcher, App.NotifyIcon is created before MainWindow creation, so null checks for App.NotifyIcon are not necessary when accessing it from MainWindow code.

Applied to files:

  • Flow.Launcher/ViewModel/MainViewModel.cs
  • Flow.Launcher.Infrastructure/NativeMethods.txt
  • Flow.Launcher.Infrastructure/Win32Helper.cs
📚 Learning: 2025-06-08T14:12:12.842Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3672
File: Flow.Launcher/MainWindow.xaml.cs:318-318
Timestamp: 2025-06-08T14:12:12.842Z
Learning: In Flow.Launcher, the App.NotifyIcon static property is initialized in the App class before MainWindow creation, so null checks are not needed when accessing App.NotifyIcon in MainWindow lifecycle methods.

Applied to files:

  • Flow.Launcher/ViewModel/MainViewModel.cs
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher.Infrastructure/Win32Helper.cs
📚 Learning: 2025-09-05T11:56:27.267Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3593
File: Flow.Launcher/HotkeyControlDialog.xaml:6-6
Timestamp: 2025-09-05T11:56:27.267Z
Learning: In Flow.Launcher's migration to iNKORE.UI.WPF.Modern UI framework, dialog resource keys like PopuBGColor, PopupButtonAreaBGColor, PopupButtonAreaBorderColor, and PopupTextColor are provided by the iNKORE.UI.WPF.Modern framework itself, not defined locally in the codebase theme files.

Applied to files:

  • Flow.Launcher/Languages/en.xaml
📚 Learning: 2025-09-28T03:57:43.995Z
Learnt from: Jack251970
Repo: Flow-Launcher/Flow.Launcher PR: 3770
File: Flow.Launcher/Helper/HotKeyMapper.cs:0-0
Timestamp: 2025-09-28T03:57:43.995Z
Learning: In Flow.Launcher/Helper/HotKeyMapper.cs, the resource descriptions for arrow keys are intentionally swapped - Up/Down keys use "HotkeyLeftRightDesc" and Left/Right keys use "HotkeyUpDownDesc". This is documented with an inline comment and is intended behavior, not a bug.

Applied to files:

  • Flow.Launcher/Languages/en.xaml
🧬 Code graph analysis (2)
Flow.Launcher/ViewModel/MainViewModel.cs (2)
Flow.Launcher.Infrastructure/UserSettings/Settings.cs (1)
  • Settings (16-632)
Flow.Launcher.Infrastructure/Win32Helper.cs (3)
  • Win32Helper (33-1058)
  • ShowTaskbar (1023-1033)
  • HideTaskbar (1035-1044)
Flow.Launcher.Infrastructure/Win32Helper.cs (1)
Flow.Launcher.Infrastructure/DialogJump/Models/WindowsExplorer.cs (1)
  • HWND (115-120)
🪛 GitHub Check: build
Flow.Launcher.Infrastructure/NativeMethods.txt

[warning] 94-94:
Method, type or constant "DeviceNotifyCallbackRoutine" not found

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (3)
Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml (1)

75-83: New “Show taskbar when opened” toggle wiring looks correct

The SettingsCard and ToggleSwitch binding to Settings.ShowTaskbarWhenInvoked are consistent with existing patterns, and the resource keys (showTaskbarWhenOpened, showTaskbarWhenOpenedToolTip) line up with the language file. No issues here.

Flow.Launcher.Infrastructure/UserSettings/Settings.cs (1)

484-485: Settings surface for taskbar option is consistent and safe

ShowTaskbarWhenInvoked as a simple bool with default false fits the existing settings pattern and keeps the new behavior opt‑in only. Placement near other window-visibility options also makes sense. No changes needed here.

Flow.Launcher/Languages/en.xaml (1)

84-85: Localization for the new taskbar option is clear and accurate

The new showTaskbarWhenOpened and tooltip strings describe the behavior well and align with the settings UI and implementation. No further changes needed.

Comment on lines +2100 to +2105
// Show the taskbar if the setting is enabled
if (Settings.ShowTaskbarWhenInvoked)
{
Win32Helper.ShowTaskbar();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Guard HideTaskbar() with state so show/hide stay balanced

Wiring the feature through Show()/Hide() is good, but right now HideTaskbar() is gated only by the current value of Settings.ShowTaskbarWhenInvoked. That means:

  • If the setting is turned on while Flow is already open, Show() won’t have called ShowTaskbar(), but Hide() will call HideTaskbar().
  • If the setting is turned off while Flow is open, Show() will have called ShowTaskbar(), but Hide() will skip HideTaskbar().

Given this uses an undocumented taskbar message, unbalanced calls risk leaving the taskbar in a different mode than the user expects.

Consider tracking a simple flag, e.g. bool _taskbarShownByFlow;, set true only when ShowTaskbar() is actually invoked in Show(), and use that flag to decide whether to call HideTaskbar() in Hide() (and reset it to false afterward). That keeps your interaction with the shell clearly symmetric regardless of when the setting is toggled.

Also applies to: 2211-2215

🤖 Prompt for AI Agents
In Flow.Launcher/ViewModel/MainViewModel.cs around lines 2100-2105 (and
similarly 2211-2215), the current logic checks only
Settings.ShowTaskbarWhenInvoked when hiding the taskbar which can lead to
unbalanced ShowTaskbar/HideTaskbar calls if the setting is toggled while Flow is
open; add a private bool field (e.g. _taskbarShownByFlow) to the viewmodel, set
it to true only when Show() actually calls Win32Helper.ShowTaskbar() (and only
when the setting is enabled), and in Hide() call Win32Helper.HideTaskbar() only
if _taskbarShownByFlow is true, then reset _taskbarShownByFlow to false after
hiding — do the same mirrored change for the other method block at 2211-2215 to
keep show/hide symmetric.

@jjw24 jjw24 enabled auto-merge (squash) December 22, 2025 23:02
@jjw24
Copy link
Member

jjw24 commented Dec 22, 2025

@Jack251970 do you have dual monitor setup to help test this?

@jjw24 jjw24 linked an issue Dec 22, 2025 that may be closed by this pull request
@VictoriousRaptor
Copy link
Contributor Author

@Jack251970 do you have dual monitor setup to help test this?

pr is not ready as the potential dual monitor issue and the issue addressed by code rabbit so I disable the auto merge now.

@jjw24 jjw24 marked this pull request as draft December 23, 2025 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 min review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to show taskbar when FL is invoked

3 participants