2023-01-31 00:00:11 +01:00
|
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Threading;
|
2024-10-17 05:14:57 -04:00
|
|
|
|
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using global::Windows.System;
|
2023-11-07 17:38:06 +01:00
|
|
|
|
using ManagedCommon;
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Controls;
|
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library;
|
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Library.Telemetry.Events;
|
|
|
|
|
|
using Microsoft.PowerToys.Settings.UI.ViewModels;
|
Make update notification InfoBar clickable in Flyout (#42064)
## Summary
Resolves #38854 by making the "Update available" InfoBar in the tray
icon flyout clickable, providing direct navigation to the General
settings page where users can manage updates.
## Problem
When PowerToys has an available update, users experience unnecessary
navigation friction:
1. Click PowerToys tray icon → flyout opens with "Update available"
InfoBar
2. InfoBar is not clickable, only the settings wheel is interactive
3. Click settings wheel → opens Dashboard page (not where updates are
managed)
4. Navigate to General page → finally access update controls
Users requested making the "Update available" text itself a hyperlink
for direct access to update functionality.
## Solution
Made the InfoBar interactive by adding a `Tapped` event handler that:
- Hides the flyout (consistent with other flyout actions)
- Opens Settings window directly to the General page using
`App.OpenSettingsWindow(typeof(GeneralPage))`
## Changes
**Files Modified:**
- `src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml`:
Added `Tapped="UpdateInfoBar_Tapped"` event
- `src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml.cs`:
Added event handler and navigation logic
## User Experience
**Before:** Tray Icon → Flyout → Settings Wheel → Dashboard → Navigate
to General → Update Controls
**After:** Tray Icon → Flyout → **Click "Update available"** → General
Page → Update Controls
The InfoBar now behaves as a clickable hyperlink as requested, while
preserving all existing functionality. Users can still use the settings
wheel if preferred, but now have a more direct path to update
management.
## Testing
The implementation follows existing patterns in the codebase and uses
established APIs. The InfoBar only appears when updates are in
`ReadyToInstall` or `ReadyToDownload` states, ensuring the navigation is
contextually appropriate.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `i1qvsblobprodcus353.vsblob.vsassets.io`
> - Triggering command: `dotnet build` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/microsoft/PowerToys/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Taskbar icon should provide link directly to update
page</issue_title>
> <issue_description>### Description of the new feature / enhancement
>
> Right now when there is an update the following message appears when
you click on the PT icon in the taskbar:
>
>

>
> When you click on the settings wheel you go to the dashboard page:
>
>

>
> Then you need to click on the Learn more button before you finally get
to the page where you can install the update:
>
>

>
> Can't you make the **_Update available_** a hyperlink or add another
button that would link directly to the General page (or wherever the
update button is) so we can quickly install the update instead of going
a roundabout way every time?
>
>

>
> ### Scenario when this would be used?
>
> When there is an update. It's a usability annoyance more than
anything.
>
> ### Supporting information
>
> _No response_</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
Fixes microsoft/PowerToys#38854
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/PowerToys/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
2025-11-06 16:53:32 +08:00
|
|
|
|
using Microsoft.PowerToys.Settings.UI.Views;
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using Microsoft.PowerToys.Telemetry;
|
|
|
|
|
|
using Microsoft.UI.Xaml;
|
|
|
|
|
|
using Microsoft.UI.Xaml.Controls;
|
|
|
|
|
|
using Microsoft.UI.Xaml.Media.Animation;
|
2024-08-08 15:26:43 +01:00
|
|
|
|
using PowerToys.Interop;
|
2023-09-15 08:34:17 +02:00
|
|
|
|
using WinUIEx;
|
2023-01-31 00:00:11 +01:00
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.PowerToys.Settings.UI.Flyout
|
|
|
|
|
|
{
|
|
|
|
|
|
public sealed partial class LaunchPage : Page
|
|
|
|
|
|
{
|
|
|
|
|
|
private LauncherViewModel ViewModel { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public LaunchPage()
|
|
|
|
|
|
{
|
|
|
|
|
|
this.InitializeComponent();
|
|
|
|
|
|
var settingsUtils = new SettingsUtils();
|
|
|
|
|
|
ViewModel = new LauncherViewModel(SettingsRepository<GeneralSettings>.GetInstance(settingsUtils), Views.ShellPage.SendDefaultIPCMessage);
|
|
|
|
|
|
DataContext = ViewModel;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void ModuleButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
FlyoutMenuButton selectedModuleBtn = sender as FlyoutMenuButton;
|
|
|
|
|
|
bool moduleRun = true;
|
2023-10-23 18:16:11 +02:00
|
|
|
|
|
|
|
|
|
|
// Closing manually the flyout to workaround focus gain problems
|
|
|
|
|
|
App.GetFlyoutWindow()?.Hide();
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
switch ((ModuleType)selectedModuleBtn.Tag)
|
2023-01-31 00:00:11 +01:00
|
|
|
|
{
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.ColorPicker: // Launch ColorPicker
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.ShowColorPickerSharedEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.EnvironmentVariables: // Launch Environment Variables
|
2023-10-20 16:28:07 +02:00
|
|
|
|
{
|
|
|
|
|
|
bool launchAdmin = SettingsRepository<EnvironmentVariablesSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.LaunchAdministrator;
|
|
|
|
|
|
string eventName = !App.IsElevated && launchAdmin
|
|
|
|
|
|
? Constants.ShowEnvironmentVariablesAdminSharedEvent()
|
|
|
|
|
|
: Constants.ShowEnvironmentVariablesSharedEvent();
|
|
|
|
|
|
|
|
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, eventName))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.FancyZones: // Launch FancyZones Editor
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.FZEToggleEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.Hosts: // Launch Hosts
|
2023-01-31 00:00:11 +01:00
|
|
|
|
{
|
|
|
|
|
|
bool launchAdmin = SettingsRepository<HostsSettings>.GetInstance(new SettingsUtils()).SettingsConfig.Properties.LaunchAdministrator;
|
2023-07-14 09:56:50 +02:00
|
|
|
|
string eventName = !App.IsElevated && launchAdmin
|
|
|
|
|
|
? Constants.ShowHostsAdminSharedEvent()
|
|
|
|
|
|
: Constants.ShowHostsSharedEvent();
|
|
|
|
|
|
|
|
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, eventName))
|
2023-01-31 00:00:11 +01:00
|
|
|
|
{
|
2023-07-14 09:56:50 +02:00
|
|
|
|
eventHandle.Set();
|
2023-01-31 00:00:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.RegistryPreview: // Launch Registry Preview
|
Registry Preview: complete feature with integration with Settings and the Launcher UX (#23709)
* Initial src for Registry Preview
Initial collection of files
* Update MainWindow.Utilities.cs
fixing a few spelling items
* Update expect.txt
* Update App.xaml.cs
* Update MainWindow.Events.cs
* Update MainWindow.Utilities.cs
* Update MainWindow.xaml.cs
* Update expect.txt
* Update MainWindow.Events.cs
* Rename AddPreviewtoRegfile.reg to AddPreviewToRegfile.reg
* Rename RemovePreviewtoRegfile.reg to RemovePreviewToRegfile.reg
* Update Resources.resw
* Update MainWindow.xaml
* Turns on self-contained mode
Updates the csproj file to compile the app as self-contained .
Includes fixes for code that expected the app to be in an ApplicationContainer.
Updates WindowsAppSDK from 1.1.5 to 1.2.230118.102.
* Updated to align with StyleCop errors
Multiple changes across the codebase that now aligns with StyleCop guidelines.
Tested again after the changes, to make sure no new bugs crept in.
* Added comments for spell-checker
Unclear if this side step should be done or not, but the kxz comes from a GUID and the other three names are constants.
* Adding code-custom.dic
Comments didn't work; trying a dic file
* Added four new terms to expects.txt file
Cleaning up attempt to update the spell-checker with dic file and moved it to expects.txt file
* Adding one more string
Adding one more string for Spell-Check
* Adding back egfile
Seems this is needed.
* Correcting a variable name
Seems one of the variable names that changed globally got missed in a XAML file.
* Update project to be more PowerToys friendly
Tweaking names and output file name to fit better with PowerToys.
* First pass at integration into Settings and Launcher
This PR is not as large as it seems:
- RegistryPreview's source moved around to a "better" directory that makes it look like the whole app changed. It didn't. In fact, I opened it in Beyond Compare and there's not much difference in the RegistryPreview app.
- Added RegistryPreviewExt that produces a DLL that the Launcher can run the EXE
- Changes to Runner calls the Ext DLL rather than the app
- Settings UI got a bunch of changes to enable the Settings page for enable/disable across ViewModels, Views, and string tables.
Still todo:
- Add "Preview" to .REG files, when the app is enable (and remove it when disabled)
- Update the thumbnail-screenshot in the Settings page
- Add support for OOBE
* Update expect.txt
Added REGISTRYPREVIEWEXT for recent changes and corrected an alphabetic sorting error.
* Updating project file for Release mode
Build failed due to a bad Includes path in Release mode.
* Adds REG registration but breaks settings
This update will update the HKCU branch of the Registry for REG files: if the app in PowerToys is enabled, it adds a Preview item to the context menu of REG files and disabling in PowerToys removes the menu item.
While working on this, I noticed that the application settings were broken, after moving to a self-contained EXE: there must have been old settings from past builds, when it was still using containers and family names.
Added TODO's to add a new way to save settings, likely as JSON.
* Re-enabled app settings
Moved from using ApplicationDataContainer for app settings and now use simple JSON.
Also cleaned up handling the scenario where the Launcher send in the PID from PowerToys' main thread.
Fixed past spelling errors as well.
* Update RegistryPreview.png
Captured new screenshot.
* Integration into OOBE
Integrates new page for Registry Preview into OOBE process.
* Removing old comment and unneeded calls
Two bits of source removed as they aren't needed any longer
Removing a chunk of old commented out code that doesn't make sense anymore.
* Merging file from upstream
Updating some files due to three merge conflicts from upstream changes and a couple of other changes to keep up.
* Update .gitignore
Adding two vcxproj files that have local updates for atls.lib locations.
* Update Resources.resw
Fixing a typo that involved a missing closing tag.
* Fix analyzer warnings
* Fix CI build
* Fix ARM64 build
Project file cleanup
* Add to installer
* expect.txt
* Remove unneeded dll
* Update MainWindow.xaml.cs
Added check for current Theme and adjust TextBox Foreground accordingly.
* Update expect.txt
Cleaning up merge cruft.
* Revert wrong .gitignore changes
* Fix ARM installer
* Update Brushes for textBox to use Theme based versions
Finally figured out how to use the built-in, Theme-aware Brushes for the font colors in the onscreen textBox. Also have it aligning the font color for the hover state.
* Align configuration in PowerToys.sln
* [installer] Add missing files
* Fix bad merge
* Fixes for stefansjfw's review
Includes:
- two new strings for UX localization
- adds compatibility section for Windows 10
- fix to only track successful activations
- Removes two REG files that were there for examples
* Fixes from review from htcfreek
Updates:
- Fixed an issue where TextBox_TextChanged was firing when you simply opened a file.
- Added clamp to prevent files larger than 10MB from being opened.
- Added support in the UX to show Keys and Values that are deleted via the file
- Added support to specially handle Keys that start with - and Values that have =- in them (delete scenario)
- Changed AppBarButton icon for Edit from Rename to NewWindow
* Create deleted-folder32.png
* Added Registry Preview to GPO
* Update expect.txt
Updating spellchecker works
* Updating Size/Move code for better results
- Moved the size/move to the MainWindow layer
- Cleaned up the JSON settings handling to avoid an access denied on first run
* Improving text handling
Changed how special characters are parse, which helps with live entry.
* Updates to parsing and other fixes
- Renamed the value PNG for parity
- Added new error image
- Added check that values have " at start and finish.
- Added support for a new "ERROR" type for Values
- Fixed support for @ versus "@" in values
- Fixed bug where Save wasn't activating in all scernarios
* Fix signing and versioning
* Update src/settings-ui/Settings.UI/ViewModels/RegistryPreviewViewModel.cs
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
* Apply suggestions from code review
Adds Launch button to the settings page.
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
* Update Resources.resw
Adding strings for new launch button
* Adding new version for GPO
Moving to 0.69.0
* More parsing bug fixes
- Changes to look for [- instead of -[ for syntax deleting keys (fix for developer's mental hiccup)
- Moved [- to top of the decision making stack, as it needs to come before [
- Added new StripEscapedCharacters function for both sides of a Value line
- Fixed crashing bug for scenario where no Keys are parsed before a Value
* Bug fixes from most recent review.
- Dictionary will now be case insensitive when searching for keys
- Added tool tips (and strings) to the images of the Keys and Values
- Updated delete handling for Keys, so that only the leaf-most node gets marked as deleted; also stops the top most roots from being marked deleted.
* Tweaking for @=-
Forces the UX to take @=- and treat it as @="" since that's what Registry Editor would do.
* Removing unused usings
* Updates app description
* Update src/gpo/assets/PowerToys.admx
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
* cleanup proj file
launch process only if module is enabled
add process to bugreport process list
* Add context menu icon
* Update src/modules/registrypreview/RegistryPreviewUI/MainWindow.Utilities.cs
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
* Use modulesRegistry.h to apply/unapply registry changes
* Tweaked window settings
Moved the loading of the settings a little later in the initialization code, which gives more time for things to initialize.
* Update registry.h
Moving the definition out of the detail namespace to the registry name space to fix a compilation issue in RegistryPreviewExt.
* Unapply on creation
If module is disabled in settings.json, on startup reg entries should be unnaplied.
TODO: read m_enabled from settings file on creation
* Removing size/move main window
Added a TODO comment that responds to the size/position settings that are being saved out in the JSON blob on close as it doesn't always work on every PC, as the MainWindow initializes at different times.
* Change to always keep Save As active
No reason for this to be disabled, honestly.
---------
Co-authored-by: Clint Rutkas <clint@rutkas.com>
Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>
2023-03-27 06:21:46 -07:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.RegistryPreviewTriggerEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.MeasureTool: // Launch Screen Ruler
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.MeasureToolTriggerEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.PowerLauncher: // Launch Run
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.PowerLauncherSharedEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.PowerOCR: // Launch Text Extractor
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.ShowPowerOCRSharedEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
[New Module] Workspaces (#34324)
* spell checker
* Adding OOBE Projects page
* changed the default hotkey
* module interface
* rename projects editor
* bug report tool
* installer
* gpo
* exit event constant
* extend search for projects by search over the containing apps' names
* [Projects] fix grammatical issue #43 (1 app - many apps)
* [Projects] Editor: Main page: fix layout if there are many apps, launch button not disappearing on the right side
* dsc
* github
* pipeline
* guid prefix
* [Projects] fixing general settings gpo handling in runner + minor changes
* arm build fix
* Do not allow saving project if name or applist is empty. Also minor UI changes
* version
* editor version
* spellcheck
* editor dll signing
* update projects names to filter them out
* shortcut saving fix
* [Projects] Editor: brining the highlighted app's icon into the foreground. + minor UI fixes
* spell checker
* spellcheck
* [Projects] re-implementing icon size calculation to have similar sized icons for every app.
* [projects] Adding info message for cases: there are no projects or no results for the search
* [Projects] Adding Edit button to the popup. + minor changes
* [Projects] Making popup having rounded corners
* changed "no projects" text color and position
* remove opening the first proj
* fix placing windows of the same app in the project
* [Projects] bringing back the breadcrumb on the editor page. Make it clickable.
* [Projects] optimizing click handlers
* [Projects] Removing not selected apps on save
* moved on thread executor to common
* moved display utils
* added convert rect
* unsigned monitor number
* set awareness
* app placement
* [Projects] Re-implementing preview drawing - one common image
* [Projects] fix boundary calculation, use DPI aware values
* fix launching with command line args
* Fix ARM64 CI build
* launch packaged apps using names when possible
* spell-check
* update packaged apps path
* projects editor single instance
* [Projects] Add Select all checkbox, Delete selected button
* Add Checkbox for per monitor selection
* modifying highlight in preview
* spell checker
* logs
* exclude help windows
https://github.com/JaneaSystems/PowerToys-DevProjects/issues/49
* Add intermediate step to project creation
* minor bugfix
* mutex fix
* modifying highlight for minimized apps
* Fixing bug: re-draw the preview on app deletion in the editor
* Adding helper class for getting the right bounds for screens
* spell checker
* spell checker
* Minor fixes in the capture dialog
* get dpi unaware screen bounds
* refactoring: added utils
* changed window filter
https://github.com/JaneaSystems/PowerToys-DevProjects/issues/2
* clean up
* refactoring
* projects common lib
* localizable default project prefix
* launcher resources
* clean up
* change snapshot project saving
https://github.com/JaneaSystems/PowerToys-DevProjects/issues/14
* changed project data
https://github.com/JaneaSystems/PowerToys-DevProjects/issues/14
* changed project creation save-cancel handles
https://github.com/JaneaSystems/PowerToys-DevProjects/issues/14
* spell-check
* Remove checkboxes, delete feature
* remove unused from the project
* get command line args in the snapshot
* minimized settings snap fix
* set window property after launching
* FZ: ignore projects launched windows
* Implementing major new features: remove button, position manipulation, arguments, admin, minimized, maximized
* modifying colors
* launcher project filters
* clean up
* Hide Admin checkbox
* hide WIP
* spell-check
* Revert "Hide Admin checkbox"
This reverts commit 3036df9d7fe48de6418b0ebeff6422d535cb25e2.
* get app elevated property
* Implementing Launch and Edit feature
* fixing: update of listed projects on the main page after hitting save in editor
* Fix for packaged app's icons
* fixing scroll speed issue
* change scroll speed to 15
* launch elevated apps
* minor fixes
* minor fix
* enhancing shortcut handling
* can-launch-elevated check
* projects module interface telemetry
* Implementing store of setting "order by".
* minor string correction
* moved projects data parsing
* telemetry
* add move apps checkbox
* notification about elevated apps
* restart unelevated
* move existing windows
* keep opened windows at the same positions
* handle powertoys settings
* use common theme
* fix corrupted data: project id and monitor id
* project launch on "launch and edit"
* clean up
* show screen numbers instead of monitor names
* launcher error messages
* fix default shortcut
* Adding launch button to projects settings, dashboard and flyout
* Adding new app which is launched when launching a project. It shows the status of the launch process
* spell checker
* Renaming Projects to App Layouts. Replacing only string values, not the variable names
* Re-ordering modules after Renaming Projects + spell checker
* setting window size according to the screen (making it bigger)
* commenting out feature "move apps if exist"
* spell checker
* Add ProjectsLauncherUI to signing
* opening apps in minimized state which are placed on a monitor, which is not found at the moment of launching
* consistent file name
* removed unused sln
* telemetry: create event
* WindowPosition comparison
* telemetry: edit event
* fix muted Launch as admin checkbox
* telemetry: delete event
* updated Edit telemetry event
* added invoke point to launcher args
* added utils
* parse invoke point
* replaced tuple with struct
* telemetry: launch event
* MonitorRect comparison
* resources
* rename: folders
* remove outdated
* rename: window property
* rename: files and folders
* rename: common data structures
* rename: telemetry namespace
* rename: workspaces data
* rename ProjectsLib -> WorkspacesLib
* rename: gpo
* rename: settings
* rename: launcher UI
* rename: other
* rename: pt run
* rename: fz
* rename: module interface
* rename: icon
* rename: snapshot tool
* rename: editor
* rename: common files
* rename: launcher
* rename: editor resources
* fix empty file crash
* rename: json
* rename: module interface
* fix custom actions build
* added launch editor event constant
* xaml formatting
* Add missing method defition to interop::Constants idl
Remove Any CPU config
* more .sln cleanup
* [Run][PowerToys] Fix Workspaces utility (#34336)
polished workspaces utility
* build fix - align CppWinRT version
* address PR comment: fix isdigit
* indentation
* address PR comment: rename function
* address PR comment: changed version for workspaces and revision
* added supported version definition
* addressPR comment: use BringToForeground
* address PR comments: updated projects
* address PR comment: uncomment gpo in settings
* address PR comment: rename oobe view
* update OOBE image with current module name
* moved AppUtils
* launching with AppUserModel.ID
* fixed module order in settings
* fix xaml formatting
* [Workspaces] Close launcher if there are failed launches. Plus adding new spinner gif
* fix topmost LauncherUI
* clean up
* UI closing
* BugReportTool - omit cmd arg data
* Delete icon on workspace removal
* Adding cancellation to launcher UI.
* reordered launching
* fix terminating UI
* Removing old shortcut on workspace renaming
* Sentence case labels
* get process path without waiting
* comment out unused
* remove unused argument
* logs
* New icon
* fix launch and edit for the new project
* fix launch and edit: save new project
* Update exe icons
---------
Co-authored-by: donlaci <laszlo@janeasystems.com>
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Stefan Markovic <stefan@janeasystems.com>
Co-authored-by: Davide Giacometti <davide.giacometti@outlook.it>
Co-authored-by: Niels Laute <niels.laute@live.nl>
2024-08-23 09:28:13 +02:00
|
|
|
|
case ModuleType.Workspaces: // Launch Workspaces Editor
|
|
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.WorkspacesLaunchEditorEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-11-07 17:38:06 +01:00
|
|
|
|
case ModuleType.ShortcutGuide: // Launch Shortcut Guide
|
2023-01-31 00:00:11 +01:00
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.ShortcutGuideTriggerEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
Add the Command Palette module (#37908)
Windows Command Palette ("CmdPal") is the next iteration of PowerToys Run. With extensibility at its core, the Command Palette is your one-stop launcher to start _anything_.
By default, CmdPal is bound to <kbd>Win+Alt+Space</kbd>.


----
This brings the current preview version of CmdPal into the upstream PowerToys repo. There are still lots of bugs to work out, but it's reached the state we're ready to start sharing it with the world. From here, we can further collaborate with the community on the features that are important, and ensuring that we've got a most robust API to enable developers to build whatever extensions they want.
Most of the built-in PT Run modules have already been ported to CmdPal's extension API. Those include:
* Installed apps
* Shell commands
* File search (powered by the indexer)
* Windows Registry search
* Web search
* Windows Terminal Profiles
* Windows Services
* Windows settings
There are a couple new extensions built-in
* You can now search for packages on `winget` and install them right from the palette. This also powers searching for extensions for the palette
* The calculator has an entirely new implementation. This is currently less feature complete than the original PT Run one - we're looking forward to updating it to be more complete for future ingestion in Windows
* "Bookmarks" allow you to save shortcuts to files, folders, and webpages as top-level commands in the palette.
We've got a bunch of other samples too, in this repo and elsewhere
### PowerToys specific notes
CmdPal will eventually graduate out of PowerToys to live as its own application, which is why it's implemented just a little differently than most other modules. Enabling CmdPal will install its `msix` package.
The CI was minorly changed to support CmdPal version numbers independent of PowerToys itself. It doesn't make sense for us to start CmdPal at v0.90, and in the future, we want to be able to rev CmdPal independently of PT itself.
Closes #3200, closes #3600, closes #7770, closes #34273, closes #36471, closes #20976, closes #14495
-----
TODOs et al
**Blocking:**
- [ ] Images and descriptions in Settings and OOBE need to be properly defined, as mentioned before
- [ ] Niels is on it
- [x] Doesn't start properly from PowerToys unless the fix PR is merged.
- https://github.com/zadjii-msft/PowerToys/pull/556 merged
- [x] I seem to lose focus a lot when I press on some limits, like between the search bar and the results.
- This is https://github.com/zadjii-msft/PowerToys/issues/427
- [x] Turned off an extension like Calculator and it was still working.
- Need to get rid of that toggle, it doesn't do anything currently
- [x] `ListViewModel.<FetchItems>` crash
- Pretty confident that was fixed in https://github.com/zadjii-msft/PowerToys/pull/553
**Not blocking / improvements:**
- Show the shortcut through settings, as mentioned before, or create a button that would open CmdPalette settings.
- When PowerToys starts, CmdPalette is always shown if enabled. That's weird when just starting PowerToys/ logging in to the computer with PowerToys auto-start activated. I think this should at least be a setting.
- Needing to double press a result for it to do the default action seems quirky. If one is already selected, I think just pressing should be enough for it to do the action.
- This is currently a setting, though we're thinking of changing the setting even more: https://github.com/zadjii-msft/PowerToys/issues/392
- There's no URI extension. Was surprised when typing a URL that it only proposed a web search.
- [x] There's no System commands extension. Was expecting to be able to quickly restart the computer by typing restart but it wasn't there.
- This is in PR https://github.com/zadjii-msft/PowerToys/pull/452
---------
Co-authored-by: joadoumie <98557455+joadoumie@users.noreply.github.com>
Co-authored-by: Jordi Adoumie <jordiadoumie@microsoft.com>
Co-authored-by: Mike Griese <zadjii@gmail.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Michael Hawker <24302614+michael-hawker@users.noreply.github.com>
Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com>
Co-authored-by: Seraphima <zykovas91@gmail.com>
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com>
Co-authored-by: Eric Johnson <ericjohnson327@gmail.com>
Co-authored-by: Ethan Fang <ethanfang@microsoft.com>
Co-authored-by: Yu Leng (from Dev Box) <yuleng@microsoft.com>
Co-authored-by: Clint Rutkas <clint@rutkas.com>
2025-03-19 03:39:57 -05:00
|
|
|
|
case ModuleType.CmdPal: // Show CmdPal
|
|
|
|
|
|
using (var eventHandle = new EventWaitHandle(false, EventResetMode.AutoReset, Constants.ShowCmdPalEvent()))
|
|
|
|
|
|
{
|
|
|
|
|
|
eventHandle.Set();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
2023-01-31 00:00:11 +01:00
|
|
|
|
default:
|
|
|
|
|
|
moduleRun = false;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (moduleRun)
|
|
|
|
|
|
{
|
2023-11-07 17:38:06 +01:00
|
|
|
|
PowerToysTelemetry.Log.WriteEvent(new TrayFlyoutModuleRunEvent() { ModuleName = ((ModuleType)selectedModuleBtn.Tag).ToString() });
|
2023-01-31 00:00:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SettingsBtn_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
App.OpenSettingsWindow(null, true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async void DocsBtn_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
await Launcher.LaunchUriAsync(new Uri("https://aka.ms/PowerToysOverview"));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void AllAppButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
Frame.Navigate(typeof(AppsListPage), null, new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void QuitButton_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
ViewModel.KillRunner();
|
|
|
|
|
|
this.DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Application.Current.Exit();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-05-26 05:03:35 -04:00
|
|
|
|
internal void ReportBugBtn_Click(object sender, RoutedEventArgs e)
|
2023-01-31 00:00:11 +01:00
|
|
|
|
{
|
|
|
|
|
|
ViewModel.StartBugReport();
|
2023-09-15 08:34:17 +02:00
|
|
|
|
|
|
|
|
|
|
// Closing manually the flyout since no window will steal the focus
|
|
|
|
|
|
App.GetFlyoutWindow()?.Hide();
|
2023-01-31 00:00:11 +01:00
|
|
|
|
}
|
Make update notification InfoBar clickable in Flyout (#42064)
## Summary
Resolves #38854 by making the "Update available" InfoBar in the tray
icon flyout clickable, providing direct navigation to the General
settings page where users can manage updates.
## Problem
When PowerToys has an available update, users experience unnecessary
navigation friction:
1. Click PowerToys tray icon → flyout opens with "Update available"
InfoBar
2. InfoBar is not clickable, only the settings wheel is interactive
3. Click settings wheel → opens Dashboard page (not where updates are
managed)
4. Navigate to General page → finally access update controls
Users requested making the "Update available" text itself a hyperlink
for direct access to update functionality.
## Solution
Made the InfoBar interactive by adding a `Tapped` event handler that:
- Hides the flyout (consistent with other flyout actions)
- Opens Settings window directly to the General page using
`App.OpenSettingsWindow(typeof(GeneralPage))`
## Changes
**Files Modified:**
- `src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml`:
Added `Tapped="UpdateInfoBar_Tapped"` event
- `src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml.cs`:
Added event handler and navigation logic
## User Experience
**Before:** Tray Icon → Flyout → Settings Wheel → Dashboard → Navigate
to General → Update Controls
**After:** Tray Icon → Flyout → **Click "Update available"** → General
Page → Update Controls
The InfoBar now behaves as a clickable hyperlink as requested, while
preserving all existing functionality. Users can still use the settings
wheel if preferred, but now have a more direct path to update
management.
## Testing
The implementation follows existing patterns in the codebase and uses
established APIs. The InfoBar only appears when updates are in
`ReadyToInstall` or `ReadyToDownload` states, ensuring the navigation is
contextually appropriate.
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `i1qvsblobprodcus353.vsblob.vsassets.io`
> - Triggering command: `dotnet build` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/microsoft/PowerToys/settings/copilot/coding_agent)
(admins only)
>
> </details>
<!-- START COPILOT CODING AGENT SUFFIX -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>Taskbar icon should provide link directly to update
page</issue_title>
> <issue_description>### Description of the new feature / enhancement
>
> Right now when there is an update the following message appears when
you click on the PT icon in the taskbar:
>
>

>
> When you click on the settings wheel you go to the dashboard page:
>
>

>
> Then you need to click on the Learn more button before you finally get
to the page where you can install the update:
>
>

>
> Can't you make the **_Update available_** a hyperlink or add another
button that would link directly to the General page (or wherever the
update button is) so we can quickly install the update instead of going
a roundabout way every time?
>
>

>
> ### Scenario when this would be used?
>
> When there is an update. It's a usability annoyance more than
anything.
>
> ### Supporting information
>
> _No response_</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
Fixes microsoft/PowerToys#38854
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/microsoft/PowerToys/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
2025-11-06 16:53:32 +08:00
|
|
|
|
|
|
|
|
|
|
private void UpdateInfoBar_Tapped(object sender, Microsoft.UI.Xaml.Input.TappedRoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Hide the flyout before opening settings window
|
|
|
|
|
|
App.GetFlyoutWindow()?.Hide();
|
|
|
|
|
|
|
|
|
|
|
|
// Open Settings window directly to General page where update controls are located
|
|
|
|
|
|
App.OpenSettingsWindow(typeof(GeneralPage));
|
|
|
|
|
|
}
|
2023-01-31 00:00:11 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|