Skip to content

feat: upgrade to .NET 9 and add ShareX settings panel#5

Merged
dufguix merged 6 commits into
dufguix:mainfrom
jeregon1:feature/net9-and-settings-ui
Jun 11, 2026
Merged

feat: upgrade to .NET 9 and add ShareX settings panel#5
dufguix merged 6 commits into
dufguix:mainfrom
jeregon1:feature/net9-and-settings-ui

Conversation

@jeregon1

Copy link
Copy Markdown
Contributor

Overview

This PR modernizes the ShareX Flow Launcher plugin by upgrading the target framework to .NET 9 and introducing a user-configurable settings panel.

Changes

1. chore: upgrade plugin target to net9 and update lockfile (47a72a2)

  • Upgrades TargetFramework from net5.0-windows to net9.0-windows
  • Adds <UseWPF>true</UseWPF> for explicit WPF support
  • Updates packages.lock.json to reflect new framework

2. feat: add ShareX settings panel and configurable launch options (02693c3)

  • Implements ISettingProvider in ShareX_Flow_Plugin class
  • Adds CreateSettingPanel() method exposing settings UI
  • New Settings class with configurable properties:
    • SharexPath: Installation path (default: C:\Program Files\ShareX\)
    • AutoClose: Boolean flag for -autoclose behavior
  • New SettingsViewModel class for WPF binding and change notifications
  • New SettingsView.xaml / xaml.cs for UI layout and folder browser dialog
  • Refactors SharexCommand to an immutable record with init-only properties
  • Renames Cat enum to CategoryType for clarity
  • RunCommand() now:
    • Always appends -silent flag
    • Conditionally appends -autoclose based on settings
    • Uses persisted Settings.SharexPath instead of hardcoded path

3. docs: refresh README for settings panel and launch args (34422bf)

  • Removes outdated note about missing settings panel
  • Documents new settings behavior and configuration options
  • Updates installation steps for clarity

Testing

  • Solution builds successfully against .NET 9
  • Settings panel appears in Flow Launcher plugin settings
  • ShareX launch args include -silent and optional -autoclose

Commits

  • 3 focused, logical commits for clean history
  • Clean working tree (only .editorconfig untracked, left for local use)

Introduce plugin settings UI for ShareX path and auto-close behavior.

Main.cs now implements ISettingProvider, loads persisted Settings, exposes CreateSettingPanel, and appends '-silent' with optional '-autoclose' when running commands.

SharexCommand.cs is refactored to an immutable record (init-only properties) and CategoryType enum for clearer intent and safer command definitions; command list initialization in Main.cs is updated accordingly.
Copilot AI review requested due to automatic review settings March 17, 2026 07:30

Copilot AI 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.

Pull request overview

Upgrades the Flow Launcher ShareX plugin to target .NET 9 (with WPF enabled) and adds a configurable settings panel so users can set the ShareX install path and toggle -autoclose behavior.

Changes:

  • Upgrade project target framework to net9.0-windows and update NuGet lockfile.
  • Add WPF settings UI (view + view model + settings storage) exposed via ISettingProvider.
  • Update command launching to always include -silent and optionally -autoclose, using the configured ShareX path.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Flow.Launcher.Plugin.ShareX-Flow-Plugin.csproj Targets .NET 9 and enables WPF for the settings UI.
packages.lock.json Updates lockfile target framework section to net9.0-windows7.0.
Main.cs Implements ISettingProvider, loads settings, and applies new launch args/path logic.
Settings.cs Adds persisted settings model (ShareX path + AutoClose).
SettingsViewModel.cs Adds WPF-binding view model for settings.
SettingsView.xaml Adds settings panel layout and bindings.
SettingsView.xaml.cs Adds folder-browse handler using OpenFolderDialog.
SharexCommand.cs Refactors command model to an immutable record and renames category enum.
README.md Documents settings panel and updated command behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread SettingsViewModel.cs Outdated
Comment on lines +1 to +5
namespace Flow.Launcher.Plugin.ShareX_Flow_Plugin
{
public class SettingsViewModel(Settings settings) : BaseModel
{
private readonly Settings Settings = settings;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It doesn't fail to compile in Visual Studio 2026

Comment thread SettingsViewModel.cs
Comment thread SettingsView.xaml Outdated
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Plugin.ShareX_Flow_Plugin"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:SettingsViewModel}"
jeregon1 and others added 3 commits March 17, 2026 09:14
…adability

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dufguix

dufguix commented Mar 17, 2026

Copy link
Copy Markdown
Owner

I had a quick look without compiling it yet.

Why -silent is not optional ?

@dufguix

dufguix commented Mar 17, 2026

Copy link
Copy Markdown
Owner

Do you save the settings somewhere ?

@jeregon1

Copy link
Copy Markdown
Contributor Author

Why -silent is not optional ?

Because if ShareX wasn't running before running the command, then its window appears and can interfere with what you were aiming to do. E.g. if you want to record the active window, it will pop up and record itself.

Do you save the settings somewhere ?

That's handled by Flow Launcher itself when using ISettingProvider and context.API.LoadSettingJsonStorage function :)

@jeregon1

Copy link
Copy Markdown
Contributor Author

Hey, I hope It's ok! Don't mean to rush things :)

@dufguix dufguix merged commit eaf5a3f into dufguix:main Jun 11, 2026
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