Skip to content

Expand DevTools adding test windows#4504

Merged
DavidGBrett merged 7 commits into
devfrom
expand-devtools-debug-windows
Jul 3, 2026
Merged

Expand DevTools adding test windows#4504
DavidGBrett merged 7 commits into
devfrom
expand-devtools-debug-windows

Conversation

@DavidGBrett

@DavidGBrett DavidGBrett commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Add new dev tools to open test windows so their behavior and look can be verified at runtime
These specific windows are usually hard to trigger or unsafe to use if you don't want to mess with your configuration.

The progress window has a simulated timer (1m) thats short enough to see change but long enough to get a look at it.

The message box windows are available in all the supported button types and send the result back as a notification - so you can test its behavior.

UI Changes

To make room for all these new test windows I turned DevTools into an expander

Before

image

After

image

(Messsage Box Type Flyout)
image


Summary by cubic

Replaces the DevTools flyout with a structured expander and adds test windows for Report, Progress (cancelable), Plugin Update, and Message Box. Improves discoverability and lets you verify these UIs safely.

Summary of changes

  • Changed: Converted DevTools SettingsCard + flyout into a SettingsExpander with individual SettingsCards; use shared openFolderButton for settings/log/cache folders; welcome button label is now “Open Welcome Window” (card header still “Wizard”).
  • Added: Buttons to open test Report, Progress (async, ~1 min, cancelable), Plugin Update, and Message Box windows; Message Box includes a flyout for OK, OK/Cancel, Yes/No, Yes/No/Cancel and posts the result as a notification; new localization keys for these labels and openFolderButton.
  • Removed: DevTools flyout and its grouped actions.
  • Memory impact: Minimal; windows are created on demand and disposed on close; progress demo has small, temporary allocations.
  • Security risks: None; all actions are local UI only with no new I/O or network work.
  • Unit tests: None (UI-only changes).

Release Note
About > DevTools now uses an expander with clear actions and adds test windows for reports, progress, plugin updates, and message boxes.

Written for commit b39d210. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added this to the 2.2.0 milestone Jun 2, 2026
@DavidGBrett DavidGBrett added the kind/ui related to UI, icons, themes, etc label Jul 3, 2026
@DavidGBrett
DavidGBrett force-pushed the expand-devtools-debug-windows branch 2 times, most recently from a01ef43 to 46dbd1e Compare July 3, 2026 07:14
@DavidGBrett
DavidGBrett marked this pull request as ready for review July 3, 2026 07:16

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml Outdated
Comment thread Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds devtools test-window functionality to the About settings page: new localized strings for window titles and message-box labels, view model commands to open test report/progress/plugin-update windows and configurable test message boxes, and restructured settings UI with a SettingsExpander exposing these actions.

Changes

Devtools Test Windows Feature

Layer / File(s) Summary
Devtools localization strings
Flow.Launcher/Languages/en.xaml
Adds openWelcomeWindow, openFolderButton, and a batch of devtools* strings for window titles, message-box button label variants, and test messages.
Devtools command implementations
Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs
Updates namespace imports and adds commands to open a test report window, an async cancellable test progress window, a test plugin update window, and a configurable localized test message box based on buttonType.
Devtools settings UI wiring
Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml
Replaces the combined devtool card with a SettingsExpander containing separate cards for cache/log clearing, folder access, welcome window, and test windows, plus a MenuFlyout-driven message box card.

Estimated code review effort: 2 (Simple) | ~15 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SettingsPaneAboutViewModel
  participant ProgressWindow

  User->>SettingsPaneAboutViewModel: OpenTestProgressWindowAsync()
  SettingsPaneAboutViewModel->>ProgressWindow: Show progress window
  loop progress updates
    SettingsPaneAboutViewModel->>ProgressWindow: Update progress value
  end
  User->>SettingsPaneAboutViewModel: Cancel
  SettingsPaneAboutViewModel->>SettingsPaneAboutViewModel: Stop loop and suppress OperationCanceledException
Loading

Possibly related PRs

  • Flow-Launcher/Flow.Launcher#3264: Adds About “devtools” commands including opening a ReportWindow with a test exception, directly related to the same ReportWindow usage introduced here.

Suggested reviewers: Jack251970, jjw24, VictoriousRaptor

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: expanding DevTools with test windows.
Description check ✅ Passed The description is directly about the DevTools expander and new test windows, matching the changeset.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch expand-devtools-debug-windows

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.

@DavidGBrett
DavidGBrett force-pushed the expand-devtools-debug-windows branch 2 times, most recently from fb6b814 to 716dc54 Compare July 3, 2026 08:27
@DavidGBrett
DavidGBrett force-pushed the expand-devtools-debug-windows branch from 716dc54 to b39d210 Compare July 3, 2026 08:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs`:
- Around line 92-95: The HRESULT handling in ThumbnailReader’s shell item
creation path should not throw the result of GetExceptionForHR, because
success-style codes like S_FALSE can return null and lead to an unintended
NullReferenceException. Update the check around SHCreateItemFromParsingName in
ThumbnailReader to use Marshal.ThrowExceptionForHR(retCode) instead of throwing
the value returned by Marshal.GetExceptionForHR, keeping the existing retCode
validation and behavior aligned with the API semantics.
🪄 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: 943b2ace-52d1-41d7-9937-63f43db0c65e

📥 Commits

Reviewing files that changed from the base of the PR and between fb6b814 and 716dc54.

📒 Files selected for processing (12)
  • Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj
  • Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
  • Flow.Launcher.Infrastructure/packages.lock.json
  • Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
  • Flow.Launcher.Plugin/packages.lock.json
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml
  • Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
  • Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
  • Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLocalization.cs
  • Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
✅ Files skipped from review due to trivial changes (3)
  • Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
  • Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
  • Flow.Launcher.Infrastructure/packages.lock.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml
  • Flow.Launcher/Languages/en.xaml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs`:
- Around line 92-95: The HRESULT handling in ThumbnailReader’s shell item
creation path should not throw the result of GetExceptionForHR, because
success-style codes like S_FALSE can return null and lead to an unintended
NullReferenceException. Update the check around SHCreateItemFromParsingName in
ThumbnailReader to use Marshal.ThrowExceptionForHR(retCode) instead of throwing
the value returned by Marshal.GetExceptionForHR, keeping the existing retCode
validation and behavior aligned with the API semantics.
🪄 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: 943b2ace-52d1-41d7-9937-63f43db0c65e

📥 Commits

Reviewing files that changed from the base of the PR and between fb6b814 and 716dc54.

📒 Files selected for processing (12)
  • Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj
  • Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs
  • Flow.Launcher.Infrastructure/packages.lock.json
  • Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
  • Flow.Launcher.Plugin/packages.lock.json
  • Flow.Launcher/Languages/en.xaml
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml
  • Plugins/Flow.Launcher.Plugin.ProcessKiller/Flow.Launcher.Plugin.ProcessKiller.csproj
  • Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
  • Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLocalization.cs
  • Plugins/Flow.Launcher.Plugin.Sys/Flow.Launcher.Plugin.Sys.csproj
✅ Files skipped from review due to trivial changes (3)
  • Plugins/Flow.Launcher.Plugin.Program/Flow.Launcher.Plugin.Program.csproj
  • Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
  • Flow.Launcher.Infrastructure/packages.lock.json
🚧 Files skipped from review as they are similar to previous changes (3)
  • Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs
  • Flow.Launcher/SettingPages/Views/SettingsPaneAbout.xaml
  • Flow.Launcher/Languages/en.xaml
🛑 Comments failed to post (1)
Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs (1)

92-95: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does Microsoft.Windows.CsWin32 0.3.298 generate a generic SHCreateItemFromParsingName<T> PInvoke overload?

💡 Result:

No, Microsoft.Windows.CsWin32 version 0.3.298 does not generate a generic SHCreateItemFromParsingName P/Invoke overload [1][2]. The generated P/Invoke signatures for SHCreateItemFromParsingName in CsWin32 typically match the native Win32 API signature, which uses an IntPtr (or void*) for the output parameter and requires an explicit GUID for the requested interface ID (IID) [1][2]. While CsWin32 generates various "friendly overloads" for many APIs to improve ergonomics—such as using Span or SafeHandle types—it does not automatically generate generic T-based wrappers for methods that require manual IID management like SHCreateItemFromParsingName [1][3][4]. Developers needing a more idiomatic C# experience for such APIs often create their own partial class or helper methods to wrap the CsWin32-generated P/Invoke, manually handling the IID_PPV_ARGS pattern or casting to the desired interface [1][5][2].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target file around the commented lines and locate related usages.
file='Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs'
wc -l "$file"
sed -n '1,220p' "$file"

printf '\n--- references ---\n'
rg -n "SHCreateItemFromParsingName|GetExceptionForHR|ThrowExceptionForHR|HRESULT\.S_OK" Flow.Launcher.Infrastructure -S

Repository: Flow-Launcher/Flow.Launcher

Length of output: 9216


🌐 Web query:

Marshal.GetExceptionForHR returns null only for S_OK or for any successful HRESULT values; can throwing its result cause null exception for S_FALSE?

💡 Result:

Marshal.GetExceptionForHR returns null for any HRESULT that does not represent an error [1]. By definition, an HRESULT is considered an error only if its high-order bit is set (i.e., the value is less than 0) [2]. Because S_FALSE (which has a value of 1) and S_OK (which has a value of 0) are both non-negative, Marshal.GetExceptionForHR treats them as successful return codes and returns null [1][3]. Regarding your second question: throwing the result of Marshal.GetExceptionForHR when it returns null will cause a NullReferenceException. Since the method returns null for S_FALSE, passing the result of such a call directly into a throw statement (e.g., throw Marshal.GetExceptionForHR(S_FALSE);) will result in a NullReferenceException, as the throw keyword cannot throw a null object [2]. It is standard practice to check if the returned exception object is null before attempting to throw it.

Citations:


🌐 Web query:

Microsoft docs Marshal.GetExceptionForHR behavior S_FALSE null exception Marshal.ThrowExceptionForHR

💡 Result:

The behavior of Marshal.GetExceptionForHR and Marshal.ThrowExceptionForHR regarding HRESULT values, including S_FALSE, is defined as follows: Marshal.GetExceptionForHR This method returns an Exception object if the HRESULT represents a failure code [1][2]. If the HRESULT value does not represent an error code—specifically if it indicates success (such as S_OK, where HRESULT is 0, or S_FALSE, where HRESULT is 1)—the method returns null [1][2]. Developers should verify that the returned exception is not null before attempting to use it [1][2]. Marshal.ThrowExceptionForHR This method is designed to throw an exception for a failure HRESULT [3][4]. If the HRESULT provided is 0 or positive (indicating success, such as S_OK or S_FALSE), the method returns without creating or throwing an exception [3][4]. In summary, because S_FALSE is considered a success code in COM (HRESULT 0x00000001), it is treated by both methods as a non-error state, resulting in no exception being thrown or returned [1][3].

Citations:


Avoid throwing the result of GetExceptionForHR here.

S_FALSE is a success code, but Marshal.GetExceptionForHR(retCode) returns null for it, so throw null would surface as a NullReferenceException. Use Marshal.ThrowExceptionForHR(retCode) instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Flow.Launcher.Infrastructure/Image/ThumbnailReader.cs` around lines 92 - 95,
The HRESULT handling in ThumbnailReader’s shell item creation path should not
throw the result of GetExceptionForHR, because success-style codes like S_FALSE
can return null and lead to an unintended NullReferenceException. Update the
check around SHCreateItemFromParsingName in ThumbnailReader to use
Marshal.ThrowExceptionForHR(retCode) instead of throwing the value returned by
Marshal.GetExceptionForHR, keeping the existing retCode validation and behavior
aligned with the API semantics.

@DavidGBrett DavidGBrett added the enhancement New feature or request label Jul 3, 2026
@DavidGBrett
DavidGBrett requested review from Jack251970 and jjw24 July 3, 2026 08:38

@Jack251970 Jack251970 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@DavidGBrett
DavidGBrett enabled auto-merge July 3, 2026 08:40
@DavidGBrett
DavidGBrett merged commit 6a98243 into dev Jul 3, 2026
3 checks passed
@DavidGBrett
DavidGBrett deleted the expand-devtools-debug-windows branch July 3, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request kind/ui related to UI, icons, themes, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants