Compare commits

...

11 Commits

Author SHA1 Message Date
Niels Laute
5bf9cd2801 Bullets instead of periods in README 2025-11-07 00:14:32 +01:00
Niels Laute
73f789b062 Settings fix (#43348)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [ ] Closes: #xxx
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-11-06 12:48:27 -05:00
Jiří Polášek
57f0b4b342 CmdPal: Improve crash error message (#43340)
## Summary of the Pull Request

This PR localizes the message displayed when an unhandled exception
causes CmdPal to crash. It also resolves a regression from commit
a991a118dc, which disabled storing to the desktop but failed to
update the corresponding message.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Related to: #41392
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
2025-11-06 11:32:56 -06:00
Dave Rayment
0e922a4dcb [ImageResizer] Fix issue where settings could be changed during a batch resize (#42163)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
This fixes an issue where the Image Resizer settings were reloaded for
every resize operation in a multi-file batch. This could result in
inconsistent resize results if the Settings application or the user
interacted with the settings and the properties were changed, even
temporarily.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42116, #35114
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
Corrects an issue in `ResizeBatch.Execute()` where `Settings.Default`
was used:

```csharp
    protected virtual void Execute(string file)
        => new ResizeOperation(file, DestinationDirectory, Settings.Default).Execute();
```

Unfortunately, `Settings.Default` is poorly named, and is not a constant
property. Instead it actually calls `Reload()`, which loads the settings
JSON file and re-processes it fully:

```csharp
        [JsonIgnore]
        public static Settings Default
        {
            get
            {
                defaultInstance.Reload();
                return defaultInstance;
            }
        }
```

If the settings are changed part-way through a resize batch operation
(even scrolling through the presets will set `selectedIndex` and save it
back to disk), the batch resize operation may switch to a different
resize behaviour, giving inconsistent results. The chances of this
occurring increase with the length of the batch operation.

### Solution
The solution is to set the `Settings` outside of the main loop and use
that for every resize operation, which is what this PR does.

`Process` is altered to load the `Settings` at the start and pass that
to `Execute` on each iteration of the batch loop:

```csharp
        public IEnumerable<ResizeError> Process(Action<int, double> reportProgress, CancellationToken cancellationToken)
        {
            double total = Files.Count;
            int completed = 0;
            var errors = new ConcurrentBag<ResizeError>();
            var settings = Settings.Default;

            ...

                        Execute(file, settings);
```

`Execute` is updated to accept a `Settings` object instead of using
`Settings.Default`:

```csharp
    protected virtual void Execute(string file, Settings settings)
        => new ResizeOperation(file, DestinationDirectory, settings).Execute();
```

### Additional changes
The batch-related unit tests failed after the above change. I updated
the Mock `Execute` to reflect the use of the `Settings` parameter. Also,
the `Settings` class was unfortunately bound to the WPF UI, and could
not be instantiated during unit testing. I've refactored this so it can
be instantiated with or without an `App.Current.Dispatcher`. Ther's a
new `ReloadCore()` method which just contains the extracted property
setting code.

None of the unit tests currently use the settings themselves, but at
least the capability is now there.

I also removed the setting of the `MaxDegreeOfParallelism` option in the
`Parallel.For()`. When left at its default, the runtime will use the
appropriate number of threads, and the heuristic it uses may not
necessarily equal the number of processor cores in the system.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
- Ensured all existing unit tests passed.
- Tested with multiple runs of resizing 200 image files while browsing
and changing the settings. This was no longer able to alter the ongoing
resize operations.
- Checked that the settings could still be amended via the Settings app.

---------

Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:55:47 +08:00
Juju Anselum J
d7785977d8 feat(quick-accent): add diameter ⌀ symbol for Shift+O #41954 (#42963)
## Summary of the Pull Request
- Adds support for the diameter symbol (⌀, U+2300) in Quick Accent. 
- When holding Shift+O with the Special Characters language enabled.

## Implementation
- Updated GetDefaultLetterKeySPECIAL(LetterKey.VK_O) to include ⌀.
- No impact on other existing functionalities.

## Issue
Closes  #41954
2025-11-06 19:55:30 +08:00
Copilot
bb604d87ca Fix accessibility: Associate controls with labels for screen readers (#42439)
## Problem

Input controls (ComboBoxes, ToggleSwitches, NumberBoxes) within
SettingsCards throughout the PowerToys Settings UI were not
programmatically associated with their visible labels. This caused
screen readers to announce only the control type (e.g., "combo box",
"toggle switch") without any context about the control's purpose, making
the settings inaccessible to screen reader users.

This violates WCAG 2.2 Success Criterion 1.3.1 (Info and Relationships)
- Level A requirement.

**User Impact**: Screen reader users navigating PowerToys settings would
hear only "edit text" or "combo box" with no description, making it
difficult or impossible to configure settings independently.

## Solution

Added `AutomationProperties.Name` bindings to controls, linking them to
their parent SettingsCard's `Header` property. This establishes the
programmatic relationship between labels and controls required by
assistive technologies.

### Pattern Applied

For controls inside SettingsCards with a `Name` attribute:

```xaml
<tkcontrols:SettingsCard Name="LanguageHeader" x:Uid="LanguageHeader">
    <ComboBox
        MinWidth="{StaticResource SettingActionControlMinWidth}"
        AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}"
        DisplayMemberPath="Language"
        ItemsSource="{Binding Languages, Mode=TwoWay}"
        SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
```

For data templates where headers are data-bound:

```xaml
<DataTemplate x:Key="ComboBoxTemplate" x:DataType="viewModels:PluginAdditionalOptionViewModel">
    <tkcontrols:SettingsCard Header="{x:Bind Path=DisplayLabel}">
        <ComboBox
            AutomationProperties.Name="{x:Bind Path=DisplayLabel}"
            ItemsSource="{x:Bind Path=ComboBoxItems}" />
    </tkcontrols:SettingsCard>
</DataTemplate>
```

## Changes Made

### GeneralPage.xaml (7 controls)
- Language selection ComboBox
- Color mode/theme ComboBox
- Run at startup ToggleSwitch
- Show system tray icon ToggleSwitch
- Enable experimentation ToggleSwitch
- Enable data diagnostics ToggleSwitch
- Enable view diagnostic data ToggleSwitch

### PowerLauncherPage.xaml (4 data templates)
- ComboBoxTemplate - for plugin settings
- NumberBoxTemplate - for plugin numeric settings
- CheckBoxComboBoxTemplate - for conditional ComboBox settings
- CheckBoxNumberBoxTemplate - for conditional NumberBox settings

### PowerRenamePage.xaml (6 controls)
- Enable PowerRename ToggleSwitch
- Context menu mode ComboBox
- Enable auto-complete ToggleSwitch
- Max display list number NumberBox
- Restore flags on launch ToggleSwitch
- Use Boost library ToggleSwitch

### NewPlusPage.xaml (4 controls)
- Enable New+ ToggleSwitch
- Hide file extension ToggleSwitch
- Hide starting digits ToggleSwitch
- Replace variables ToggleSwitch

## Testing

Screen readers (Windows Narrator) now properly announce controls with
context:
- **Before**: "Combo box"
- **After**: "Language, Combo box"

No functional changes to application behavior. The fix only affects how
controls are announced to assistive technologies.

## Notes

This fix follows the existing pattern already used in
ColorPickerPage.xaml. Similar issues exist in approximately 23 other
Settings pages which can be addressed in future PRs using this
established pattern. The pages fixed in this PR represent
commonly-accessed settings and demonstrate the solution approach for
comprehensive coverage.

Closes #<issue_number>

## References
- WCAG 2.2 SC 1.3.1:
https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships
- UIA Name Property:
https://learn.microsoft.com/en-us/windows/apps/design/accessibility/accessible-text-requirements#name_property_alternative_and_description

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Controls Inside Sections Are Not Associated with Their
Labels.</issue_title>
> <issue_description>### Microsoft PowerToys version
> 
> v0.94.2
> 
> ### Installation method
> 
> PowerToys auto-update
> 
> ### Area(s) with issue?
> 
> New+
> 
> ### Steps to reproduce
> 
> **Repro Steps:**
> 
> 1. Open the Power Toys.
> 2. Now navigate to the home present in the left navigation pane.
> 3. Now turn on the narrator using CTRL + Win + Enter.
> 4. Now navigate to the controls present inside the different sections.
> 5. Observe the issue.
> 
> ### ✔️ Expected Behavior
> 
> Each control should be programmatically associated with its
corresponding label so screen readers can accurately convey the purpose
of the control to users.
> 
> ###  Actual Behavior
> 
> Input controls (e.g., checkboxes, text fields, dropdowns) located
within different sections of the UI are not programmatically associated
with their visible labels.
> 
> ### Additional Information
> 
> **User Impact:**
> Screen reader users may hear only the control type (e.g., “edit text”)
with no context or description of what it is for. This makes it
difficult or impossible for them to fill out forms or interact with the
UI correctly, leading to confusion and frustration.
> 
> **WCAG Reference:**
> https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships
> 
> **Attachments:**
> 
>
https://github.com/user-attachments/assets/d25b9237-bee7-41d5-b564-df15df19b0d4
> 
> ### Other Software
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

Fixes microsoft/PowerToys#42419

<!-- 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: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:50:49 +08:00
Gleb Khmyznikov
ccaa876af2 [UI Tests] Peek - fix UI tests via setting hotkeys back to Ctrl+Space combo for tests only (#43168)
This pull request introduces a static initialization step to the
`PeekFilePreviewTests` class to ensure the correct test settings are
present before tests run. The main change is the addition of a static
constructor that creates or updates the `settings.json` file with
predefined settings, including setting the activation shortcut to
Ctrl+Space.

Test setup improvements:

* Added a static constructor to `PeekFilePreviewTests` that calls a new
`FixSettingsFileBeforeTests` method, ensuring the necessary settings
file exists and is properly configured before any tests execute.
* Implemented `FixSettingsFileBeforeTests` to create the required
directory and write a `settings.json` file with specific test
configuration, including setting the activation shortcut to Ctrl+Space
and other test-relevant properties.
2025-11-06 19:32:28 +08:00
Copilot
4a5e476a4e Fix: Add accessible name to Shortcut Conflicts button for screen readers (#42441)
## Summary
Fixes the accessibility issue where the "Shortcut Conflicts" button in
the Dashboard page has no accessible name defined, causing screen
readers to announce it as just "button" instead of providing context
about its purpose.

## Problem
The button in `ShortcutConflictControl.xaml` lacked an
`AutomationProperties.Name` attribute, violating WCAG 2.2 guidelines
(4.1.2 - Name, Role, Value). This prevented users who rely on screen
readers from determining the function of the button, making it
impossible to resolve or view shortcut conflicts.

**Before fix:**
- Screen reader announces: "button" 

**After fix:**
- Screen reader announces: "Shortcut conflicts, No conflicts found,
button" 
- Or: "Shortcut conflicts, 1 conflict found, button" 
- Or: "Shortcut conflicts, 3 conflicts found, button" 

## Solution
Added a new `AccessibleName` property to
`ShortcutConflictControl.xaml.cs` that combines:
- The static localized title: "Shortcut conflicts"
- The dynamic status text: "No conflicts found", "1 conflict found", or
"X conflicts found"

The button's `AutomationProperties.Name` is now bound to this property
using `{x:Bind AccessibleName, Mode=OneWay}`, ensuring it updates
dynamically as conflict data changes.

## Changes
- **ShortcutConflictControl.xaml**: Added `AutomationProperties.Name`
binding to the button
- **ShortcutConflictControl.xaml.cs**: Added `AccessibleName` property
and property change notification

## Impact
- Provides full context to assistive technology users about the button's
purpose and current state
- Complies with WCAG 2.2 accessibility standards
- Follows existing patterns in the codebase for accessible controls
- Minimal changes (2 files, 14 lines added)

## Related Issue
Closes #issue_number

## Testing
- [x] Code review completed with no issues
- [x] Follows existing accessibility patterns used in DashboardPage.xaml
- [x] Uses existing localized resource strings
- [x] Property updates dynamically via INotifyPropertyChanged

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>No Accessible Name Defined for "Shortcut Conflicts"
Button.</issue_title>
> <issue_description>### Microsoft PowerToys version
> 
> v0.94.2
> 
> ### Installation method
> 
> PowerToys auto-update
> 
> ### Area(s) with issue?
> 
> New+
> 
> ### Steps to reproduce
> 
> **Repro Steps:**
> 
> 1. Open power toys.
> 2. Now navigate to the home section and select.
> 3. Now turn on narrator using CTRL + Win + Enter.
> 4. Now navigate to the Shortcut conflicts button.
> 5. Observe the narrator's announcement.
> 
> ### ✔️ Expected Behavior
> 
> The button should have an accessible name — either via a visible
label, aria-label, or aria-labelledby — so that assistive technology
users understand its purpose.
> 
> ###  Actual Behavior
> 
> The "Shortcut Conflicts" button has no accessible name defined. Screen
readers announce it as “button”.
> 
> ### Additional Information
> 
> **User Impact:**
> Users who rely on screen readers cannot determine the function of the
button, making it inaccessible. This prevents users from resolving or
viewing shortcut conflicts, which could impact usability and task
completion.
> 
> **WCAG Reference:**
> https://www.w3.org/WAI/WCAG22/Understanding/name-role-value
> 
> **Attachments:**
> 
>
https://github.com/user-attachments/assets/ca0f51d3-f736-4eb9-b355-e55f2cfd5bbd
> 
> ### Other Software
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

Fixes microsoft/PowerToys#42418

<!-- 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 18:07:48 +08:00
Dave Rayment
5c96cea31f [Peek] Fix media sources remaining locked when Peek window is closed (#42055)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request

Fixes an issue where audio and video files would remain locked by Peek
after the user closed the preview window. This could prevent the
ejecting of removable storage.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #41883
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

When the Peek window is closed, it is hiden rather than destroyed,
allowing for quick reactivation. The cleanup process is triggered by
`MainWindowViewModel.Uninitialize()`, which eventually causes the active
`Previewer` instance in `FilePreviewer.xaml.cs` to be disposed of (via
`OnItemPropertyChanged()`).

The root cause of the bug is that neither `VideoPreviewer` nor
`AudioPreviewer` implemented `IDisposable` sufficiently to cover clean
up of the media file. The result was that the `MediaSource` object,
which holds the handle to the open media file, was not disposed
deterministically. This left the file locked until the GC eventually
finalised it.

### Solution
To fix this, I've implemented `IDisposable` on `AudioPreviewer` where it
was absent, and expanded `Dispose()` on `VideoPreviewer` to clean up the
media object. A new `Unload()` method on each previewer handles explicit
clean up of the media sources. The `Dispose()` method calls `Unload()`
to ensure the resources are released reliably when the previewer is
destroyed.

`Unload()` is deliberately public, as I'd like to expand upon its use in
a future refactoring of the previewer switching logic, allowing for
reusing an active previewer instead of creating a new one every time the
user navigates to a new file.

### AudioPreviewer refinements
I made a few updates to `AudioPreviewer` to make the lifecycle of the
media source more predictable and improve the error handling:
- The `Preview` observable property is now a nullable
`AudioPreviewData?`. This more accurately represents the state (data is
either present or not), and allows for the removal of the creation of an
empty object in the constructor.
- `thumbnailTask`'s success is no longer regarded as an error condition
in `LoadPreviewAsync`. It is reasonable to let the user play their audio
file even if the thumbnail cannot be shown.
- An error when loading the source data or metadata results in the new
`Unload()` method being called, correctly releasing the file, protecting
against the file lock issue even if the media file was corrupt and could
only be partially constructed.
- Null checks for `Preview`, obvs.

### Scope
I could repro the original issue on audio and video files, so this PR is
focused on improvements to `AudioPreviewer` and `VideoPreviewer`. I
wasn't able to reproduce the file locking problem with the
`WebBrowserPreviewer` for its built-in supported types (HTML, Markdown
and PDF). I found some additional issues with the previewer, however,
but they will be covered in a future PR.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Tests were performed with the following steps:

1. Place the audio/video file to test on a USB stick.
2. Open the file with Peek and play some of the media.
3. While previewing the media, close the Peek window.
4. Attempt to eject the USB stick via the systray.
- Before: the eject fails and Windows pops up the "File in use" dialog.
    - After: the drive is successfully removed.

I tested an MP4 video file and an MP3 audio track to confirm the fix.

I confirmed that other previewers were unaffected by previewing: JPEG
image files, a PDF, a TXT file, a Markdown file, an HTML file and a
folder. All items were successfully previewed.
2025-11-06 17:31:48 +08:00
Copilot
e7de5c7b8d 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:
> 
>
![Image](https://github.com/user-attachments/assets/18641e1c-d80b-4f7e-b206-8c9a36f2de36)
> 
> When you click on the settings wheel you go to the dashboard page:
> 
>
![Image](https://github.com/user-attachments/assets/e951b988-79ab-48b3-8714-a26999223153)
> 
> Then you need to click on the Learn more button before you finally get
to the page where you can install the update:
> 
>
![Image](https://github.com/user-attachments/assets/914c9c00-a642-40da-bfb5-439c1fd930c0)
> 
> 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?
> 
>
![Image](https://github.com/user-attachments/assets/5c065eed-84ad-47be-9432-607155065a17)
> 
> ### 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
Shawn Yuan
d737e22d16 fixed terms & privacy link issue (#43327)
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
This pull request updates the way legal links (Terms of Use and Privacy
Policy) are displayed for different AI providers in the AdvancedPaste
module, making them dynamic based on the currently selected provider. It
also updates the URLs for several providers to ensure accuracy and
relevance.

## PR Checklist

- [ ] Closes: #xxx
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

---------

Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
2025-11-06 15:04:16 +08:00
25 changed files with 626 additions and 101 deletions

View File

@@ -10,11 +10,11 @@
<h3 align="center">
<a href="#-installation">Installation</a>
<span> . </span>
<span> · </span>
<a href="https://aka.ms/powertoys-docs">Documentation</a>
<span> . </span>
<span> · </span>
<a href="https://aka.ms/powertoys-releaseblog">Blog</a>
<span> . </span>
<span> · </span>
<a href="#-whats-new">Release notes</a>
</h3>
<br/><br/>

View File

@@ -0,0 +1,175 @@
// 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.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text.Json;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
namespace Microsoft.PowerToys.UITest
{
/// <summary>
/// Helper class for configuring PowerToys settings for UI tests.
/// </summary>
public class SettingsConfigHelper
{
private static readonly JsonSerializerOptions IndentedJsonOptions = new() { WriteIndented = true };
private static readonly SettingsUtils SettingsUtils = new SettingsUtils();
/// <summary>
/// Configures global PowerToys settings to enable only specified modules and disable all others.
/// </summary>
/// <param name="modulesToEnable">Array of module names to enable (e.g., "Peek", "FancyZones"). All other modules will be disabled.</param>
/// <exception cref="ArgumentNullException">Thrown when modulesToEnable is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when settings file operations fail.</exception>
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This is test code and will not be trimmed")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "This is test code and will not be AOT compiled")]
public static void ConfigureGlobalModuleSettings(params string[] modulesToEnable)
{
ArgumentNullException.ThrowIfNull(modulesToEnable);
try
{
GeneralSettings settings;
try
{
settings = SettingsUtils.GetSettingsOrDefault<GeneralSettings>();
}
catch (Exception ex)
{
Debug.WriteLine($"Failed to load settings, creating defaults: {ex.Message}");
settings = new GeneralSettings();
}
string settingsJson = settings.ToJsonString();
using (JsonDocument doc = JsonDocument.Parse(settingsJson))
{
var options = new JsonSerializerOptions { WriteIndented = true };
var root = doc.RootElement.Clone();
if (root.TryGetProperty("enabled", out var enabledElement))
{
var enabledModules = new Dictionary<string, bool>();
foreach (var property in enabledElement.EnumerateObject())
{
string moduleName = property.Name;
bool shouldEnable = Array.Exists(modulesToEnable, m => string.Equals(m, moduleName, StringComparison.Ordinal));
enabledModules[moduleName] = shouldEnable;
}
var settingsDict = JsonSerializer.Deserialize<Dictionary<string, object>>(settingsJson);
if (settingsDict != null)
{
settingsDict["enabled"] = enabledModules;
settingsJson = JsonSerializer.Serialize(settingsDict, IndentedJsonOptions);
}
}
}
SettingsUtils.SaveSettings(settingsJson);
string enabledList = modulesToEnable.Length > 0 ? string.Join(", ", modulesToEnable) : "none";
Debug.WriteLine($"Successfully updated global settings");
Debug.WriteLine($"Enabled modules: {enabledList}");
}
catch (Exception ex)
{
Debug.WriteLine($"ERROR in ConfigureGlobalModuleSettings: {ex.Message}");
throw new InvalidOperationException($"Failed to configure global module settings: {ex.Message}", ex);
}
}
/// <summary>
/// Updates a module's settings file. If the file doesn't exist, creates it with default content.
/// If the file exists, reads it and applies the provided update function to modify the settings.
/// </summary>
/// <param name="moduleName">The name of the module (e.g., "Peek", "FancyZones").</param>
/// <param name="defaultSettingsContent">The default JSON content to use if the settings file doesn't exist.</param>
/// <param name="updateSettingsAction">
/// A callback function that modifies the settings dictionary. The function receives the deserialized settings
/// and should modify it in-place. The function should accept a Dictionary&lt;string, object&gt; and not return a value.
/// Example: (settings) => { ((Dictionary&lt;string, object&gt;)settings["properties"])["SomeSetting"] = newValue; }
/// </param>
/// <exception cref="ArgumentNullException">Thrown when moduleName or updateSettingsAction is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when settings file operations fail.</exception>
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This is test code and will not be trimmed")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "This is test code and will not be AOT compiled")]
public static void UpdateModuleSettings(
string moduleName,
string defaultSettingsContent,
Action<Dictionary<string, object>> updateSettingsAction)
{
ArgumentNullException.ThrowIfNull(moduleName);
ArgumentNullException.ThrowIfNull(updateSettingsAction);
try
{
// Build the path to the module settings file
string powerToysSettingsDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Microsoft",
"PowerToys");
string moduleDirectory = Path.Combine(powerToysSettingsDirectory, moduleName);
string settingsPath = Path.Combine(moduleDirectory, "settings.json");
// Ensure directory exists
Directory.CreateDirectory(moduleDirectory);
// Read existing settings or use default
string existingJson = string.Empty;
if (File.Exists(settingsPath))
{
existingJson = File.ReadAllText(settingsPath);
}
Dictionary<string, object>? settings;
// If file doesn't exist or is empty, create from defaults
if (string.IsNullOrWhiteSpace(existingJson))
{
if (string.IsNullOrWhiteSpace(defaultSettingsContent))
{
throw new ArgumentException("Default settings content must be provided when file doesn't exist.", nameof(defaultSettingsContent));
}
settings = JsonSerializer.Deserialize<Dictionary<string, object>>(defaultSettingsContent)
?? throw new InvalidOperationException($"Failed to deserialize default settings for {moduleName}");
Debug.WriteLine($"Created default settings for {moduleName} at {settingsPath}");
}
else
{
// Parse existing settings
settings = JsonSerializer.Deserialize<Dictionary<string, object>>(existingJson)
?? throw new InvalidOperationException($"Failed to deserialize existing settings for {moduleName}");
Debug.WriteLine($"Loaded existing settings for {moduleName} from {settingsPath}");
}
// Apply the update action to modify settings
updateSettingsAction(settings);
// Serialize and save the updated settings using SettingsUtils
string updatedJson = JsonSerializer.Serialize(settings, IndentedJsonOptions);
SettingsUtils.SaveSettings(updatedJson, moduleName);
Debug.WriteLine($"Successfully updated settings for {moduleName}");
}
catch (Exception ex)
{
Debug.WriteLine($"ERROR in UpdateModuleSettings for {moduleName}: {ex.Message}");
throw new InvalidOperationException($"Failed to update settings for {moduleName}: {ex.Message}", ex);
}
}
}
}

View File

@@ -8,7 +8,7 @@
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
@@ -21,4 +21,8 @@
<PackageReference Include="CoenM.ImageSharp.ImageHash" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
</ItemGroup>
</Project>

View File

@@ -542,7 +542,10 @@
Source="{x:Bind ViewModel.ActiveAIProvider?.ServiceType, Mode=OneWay, Converter={StaticResource ServiceTypeToIconConverter}}" />
</DropDownButton.Content>
<DropDownButton.Flyout>
<Flyout Placement="Bottom" ShouldConstrainToRootBounds="False">
<Flyout
Opened="AIProviderFlyout_Opened"
Placement="Bottom"
ShouldConstrainToRootBounds="False">
<Grid
Width="386"
Margin="-4"

View File

@@ -22,6 +22,8 @@ namespace AdvancedPaste.Controls
{
public OptionsViewModel ViewModel { get; private set; }
private bool _syncingProviderSelection;
public static readonly DependencyProperty PlaceholderTextProperty = DependencyProperty.Register(
nameof(PlaceholderText),
typeof(string),
@@ -74,6 +76,11 @@ namespace AdvancedPaste.Controls
var state = ViewModel.IsBusy ? "LoadingState" : ViewModel.PasteActionError.HasText ? "ErrorState" : "DefaultState";
VisualStateManager.GoToState(this, state, true);
}
if (e.PropertyName is nameof(ViewModel.ActiveAIProvider) or nameof(ViewModel.AIProviders))
{
SyncProviderSelection();
}
}
private void ViewModel_PreviewRequested(object sender, EventArgs e)
@@ -87,6 +94,7 @@ namespace AdvancedPaste.Controls
private void Grid_Loaded(object sender, RoutedEventArgs e)
{
InputTxtBox.Focus(FocusState.Programmatic);
SyncProviderSelection();
}
[RelayCommand]
@@ -126,18 +134,56 @@ namespace AdvancedPaste.Controls
Loader.IsLoading = loading;
}
private void SyncProviderSelection()
{
if (AIProviderListView is null)
{
return;
}
try
{
_syncingProviderSelection = true;
AIProviderListView.SelectedItem = ViewModel.ActiveAIProvider;
}
finally
{
_syncingProviderSelection = false;
}
}
private void AIProviderFlyout_Opened(object sender, object e)
{
SyncProviderSelection();
}
private async void AIProviderListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (AIProviderListView.SelectedItem is PasteAIProviderDefinition provider)
if (_syncingProviderSelection)
{
if (ViewModel.SetActiveProviderCommand.CanExecute(provider))
{
await ViewModel.SetActiveProviderCommand.ExecuteAsync(provider);
}
var flyout = FlyoutBase.GetAttachedFlyout(AIProviderButton);
flyout?.Hide();
return;
}
var flyout = FlyoutBase.GetAttachedFlyout(AIProviderButton);
if (AIProviderListView.SelectedItem is not PasteAIProviderDefinition provider)
{
return;
}
if (string.Equals(ViewModel.ActiveAIProvider?.Id, provider.Id, StringComparison.OrdinalIgnoreCase))
{
flyout?.Hide();
return;
}
if (ViewModel.SetActiveProviderCommand.CanExecute(provider))
{
await ViewModel.SetActiveProviderCommand.ExecuteAsync(provider);
SyncProviderSelection();
}
flyout?.Hide();
}
}
}

View File

@@ -280,13 +280,15 @@
x:Uid="TermsLink"
Padding="0"
FontSize="12"
NavigateUri="https://openai.com/policies/terms-of-use" />
NavigateUri="{x:Bind ViewModel.TermsLinkUri, Mode=OneWay}"
Visibility="{x:Bind ViewModel.HasTermsLink, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<HyperlinkButton
x:Name="PrivacyHyperLink"
x:Uid="PrivacyLink"
Padding="0"
FontSize="12"
NavigateUri="https://openai.com/policies/privacy-policy" />
NavigateUri="{x:Bind ViewModel.PrivacyLinkUri, Mode=OneWay}"
Visibility="{x:Bind ViewModel.HasPrivacyLink, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
</StackPanel>
</StackPanel>
</Flyout>

View File

@@ -71,6 +71,11 @@ namespace AdvancedPaste.ViewModels
[NotifyPropertyChangedFor(nameof(IsCustomAIAvailable))]
[NotifyPropertyChangedFor(nameof(AllowedAIProviders))]
[NotifyPropertyChangedFor(nameof(ActiveAIProvider))]
[NotifyPropertyChangedFor(nameof(ActiveAIProviderTooltip))]
[NotifyPropertyChangedFor(nameof(TermsLinkUri))]
[NotifyPropertyChangedFor(nameof(PrivacyLinkUri))]
[NotifyPropertyChangedFor(nameof(HasTermsLink))]
[NotifyPropertyChangedFor(nameof(HasPrivacyLink))]
private bool _isAllowedByGPO;
[ObservableProperty]
@@ -187,6 +192,35 @@ namespace AdvancedPaste.ViewModels
}
}
private AIServiceTypeMetadata GetActiveProviderMetadata()
{
var provider = ActiveAIProvider ?? AllowedAIProviders.FirstOrDefault();
var serviceType = provider?.ServiceTypeKind ?? AIServiceType.OpenAI;
return AIServiceTypeRegistry.GetMetadata(serviceType);
}
public Uri TermsLinkUri
{
get
{
var metadata = GetActiveProviderMetadata();
return metadata.HasTermsLink ? metadata.TermsUri : null;
}
}
public Uri PrivacyLinkUri
{
get
{
var metadata = GetActiveProviderMetadata();
return metadata.HasPrivacyLink ? metadata.PrivacyUri : null;
}
}
public bool HasTermsLink => GetActiveProviderMetadata().HasTermsLink;
public bool HasPrivacyLink => GetActiveProviderMetadata().HasPrivacyLink;
public bool ClipboardHasData => AvailableClipboardFormats != ClipboardFormat.None;
public bool ClipboardHasDataForCustomAI => PasteFormat.SupportsClipboardFormats(CustomAIFormat, AvailableClipboardFormats);
@@ -276,8 +310,8 @@ namespace AdvancedPaste.ViewModels
OnPropertyChanged(nameof(IsAdvancedAIEnabled));
OnPropertyChanged(nameof(AIProviders));
OnPropertyChanged(nameof(AllowedAIProviders));
OnPropertyChanged(nameof(ActiveAIProvider));
OnPropertyChanged(nameof(ActiveAIProviderTooltip));
NotifyActiveProviderChanged();
EnqueueRefreshPasteFormats();
}
@@ -316,8 +350,17 @@ namespace AdvancedPaste.ViewModels
}
}
NotifyActiveProviderChanged();
}
private void NotifyActiveProviderChanged()
{
OnPropertyChanged(nameof(ActiveAIProvider));
OnPropertyChanged(nameof(ActiveAIProviderTooltip));
OnPropertyChanged(nameof(TermsLinkUri));
OnPropertyChanged(nameof(PrivacyLinkUri));
OnPropertyChanged(nameof(HasTermsLink));
OnPropertyChanged(nameof(HasPrivacyLink));
}
private void RefreshPasteFormats()
@@ -837,6 +880,7 @@ namespace AdvancedPaste.ViewModels
UpdateAIProviderActiveFlags();
OnPropertyChanged(nameof(AIProviders));
NotifyActiveProviderChanged();
EnqueueRefreshPasteFormats();
}

View File

@@ -51,10 +51,10 @@ internal sealed partial class GlobalErrorHandler
// without its exception being observed. It is NOT raised immediately
// when the Task faults; timing depends on GC finalization.
e.SetObserved();
HandleException(e.Exception, Context.UnobservedTaskException, isRecoverable: true);
HandleException(e.Exception, Context.UnobservedTaskException);
}
private void HandleException(Exception ex, Context context, bool isRecoverable = false)
private static void HandleException(Exception ex, Context context)
{
Logger.LogError($"Unhandled exception detected ({context})", ex);
@@ -70,10 +70,25 @@ internal sealed partial class GlobalErrorHandler
StoreReport(report, storeOnDesktop: false);
string message;
string caption;
try
{
message = ResourceLoaderInstance.GetString("GlobalErrorHandler_CrashMessageBox_Message");
caption = ResourceLoaderInstance.GetString("GlobalErrorHandler_CrashMessageBox_Caption");
}
catch
{
// The resource loader may not be available if the exception occurred during startup.
// Fall back to hardcoded strings in that case.
message = "Command Palette has encountered a fatal error and must close.";
caption = "Command Palette - Fatal error";
}
PInvoke.MessageBox(
HWND.Null,
"Command Palette has encountered a fatal error and must close.\n\nAn error report has been saved to your desktop.",
"Unhandled Error",
message,
caption,
MESSAGEBOX_STYLE.MB_ICONERROR);
}
}

View File

@@ -431,8 +431,8 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
<data name="Run_Radio_Position_LastPosition.Content" xml:space="preserve">
<value>Last Position</value>
<comment>Reopen the window where it was last closed</comment>
</data>
<data name="TrayMenu_Settings" xml:space="preserve">
</data>
<data name="TrayMenu_Settings" xml:space="preserve">
<value>Settings</value>
</data>
<data name="TrayMenu_Close" xml:space="preserve">
@@ -493,28 +493,34 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
<data name="Settings_ExtensionsPage_Reloading_Text.Text" xml:space="preserve">
<value>Reloading extensions..</value>
</data>
<data name="Settings_ExtensionsPage_Banner_Header.Text" xml:space="preserve">
<data name="Settings_ExtensionsPage_Banner_Header.Text" xml:space="preserve">
<value>Discover more extensions</value>
</data>
<data name="Settings_ExtensionsPage_Banner_Description.Text" xml:space="preserve">
<data name="Settings_ExtensionsPage_Banner_Description.Text" xml:space="preserve">
<value>Find more extensions on the Microsoft Store or WinGet.</value>
</data>
<data name="Settings_ExtensionsPage_Banner_Hyperlink.Content" xml:space="preserve">
<data name="Settings_ExtensionsPage_Banner_Hyperlink.Content" xml:space="preserve">
<value>Learn how to create your own extensions</value>
</data>
<data name="Settings_ExtensionsPage_FindExtensions_MicrosoftStore.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<data name="Settings_ExtensionsPage_FindExtensions_MicrosoftStore.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Find extensions on the Microsoft Store</value>
</data>
<data name="Settings_ExtensionsPage_FindExtensions_MicrosoftStore.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<data name="Settings_ExtensionsPage_FindExtensions_MicrosoftStore.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Microsoft Store</value>
</data>
<data name="Settings_ExtensionsPage_FindExtensions_WinGet.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<data name="Settings_ExtensionsPage_FindExtensions_WinGet.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Find extensions on WinGet</value>
</data>
<data name="Settings_ExtensionsPage_FindExtensions_WinGet.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<data name="Settings_ExtensionsPage_FindExtensions_WinGet.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Microsoft Store</value>
</data>
<data name="Settings_ExtensionsPage_SearchBox_Placeholder.PlaceholderText" xml:space="preserve">
<data name="Settings_ExtensionsPage_SearchBox_Placeholder.PlaceholderText" xml:space="preserve">
<value>Search extensions</value>
</data>
<data name="GlobalErrorHandler_CrashMessageBox_Message" xml:space="preserve">
<value>Command Palette has encountered a fatal error and must close.</value>
</data>
<data name="GlobalErrorHandler_CrashMessageBox_Caption" xml:space="preserve">
<value>Command Palette - Fatal error</value>
</data>
</root>

View File

@@ -10,7 +10,7 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using ImageResizer.Properties;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Moq.Protected;
@@ -101,7 +101,9 @@ namespace ImageResizer.Models
private static ResizeBatch CreateBatch(Action<string> executeAction)
{
var mock = new Mock<ResizeBatch> { CallBase = true };
mock.Protected().Setup("Execute", ItExpr.IsAny<string>()).Callback(executeAction);
mock.Protected()
.Setup("Execute", ItExpr.IsAny<string>(), ItExpr.IsAny<Settings>())
.Callback((string file, Settings settings) => executeAction(file));
return mock.Object;
}

View File

@@ -87,9 +87,14 @@ namespace ImageResizer.Models
public IEnumerable<ResizeError> Process(Action<int, double> reportProgress, CancellationToken cancellationToken)
{
double total = Files.Count;
var completed = 0;
int completed = 0;
var errors = new ConcurrentBag<ResizeError>();
// NOTE: Settings.Default is captured once before parallel processing.
// Any changes to settings on disk during this batch will NOT be reflected until the next batch.
// This improves performance and predictability by avoiding repeated mutex acquisition and behaviour change results in a batch.
var settings = Settings.Default;
// TODO: If we ever switch to Windows.Graphics.Imaging, we can get a lot more throughput by using the async
// APIs and a custom SynchronizationContext
Parallel.ForEach(
@@ -97,13 +102,12 @@ namespace ImageResizer.Models
new ParallelOptions
{
CancellationToken = cancellationToken,
MaxDegreeOfParallelism = Environment.ProcessorCount,
},
(file, state, i) =>
{
try
{
Execute(file);
Execute(file, settings);
}
catch (Exception ex)
{
@@ -111,14 +115,13 @@ namespace ImageResizer.Models
}
Interlocked.Increment(ref completed);
reportProgress(completed, total);
});
return errors;
}
protected virtual void Execute(string file)
=> new ResizeOperation(file, DestinationDirectory, Settings.Default).Execute();
protected virtual void Execute(string file, Settings settings)
=> new ResizeOperation(file, DestinationDirectory, settings).Execute();
}
}

View File

@@ -461,33 +461,42 @@ namespace ImageResizer.Properties
{
}
// Needs to be called on the App UI thread as the properties are bound to the UI.
App.Current.Dispatcher.Invoke(() =>
if (App.Current?.Dispatcher != null)
{
ShrinkOnly = jsonSettings.ShrinkOnly;
Replace = jsonSettings.Replace;
IgnoreOrientation = jsonSettings.IgnoreOrientation;
RemoveMetadata = jsonSettings.RemoveMetadata;
JpegQualityLevel = jsonSettings.JpegQualityLevel;
PngInterlaceOption = jsonSettings.PngInterlaceOption;
TiffCompressOption = jsonSettings.TiffCompressOption;
FileName = jsonSettings.FileName;
KeepDateModified = jsonSettings.KeepDateModified;
FallbackEncoder = jsonSettings.FallbackEncoder;
CustomSize = jsonSettings.CustomSize;
SelectedSizeIndex = jsonSettings.SelectedSizeIndex;
if (jsonSettings.Sizes.Count > 0)
{
Sizes.Clear();
Sizes.AddRange(jsonSettings.Sizes);
// Ensure Ids are unique and handle missing Ids
IdRecoveryHelper.RecoverInvalidIds(Sizes);
}
});
// Needs to be called on the App UI thread as the properties are bound to the UI.
App.Current.Dispatcher.Invoke(() => ReloadCore(jsonSettings));
}
else
{
ReloadCore(jsonSettings);
}
_jsonMutex.ReleaseMutex();
}
private void ReloadCore(Settings jsonSettings)
{
ShrinkOnly = jsonSettings.ShrinkOnly;
Replace = jsonSettings.Replace;
IgnoreOrientation = jsonSettings.IgnoreOrientation;
RemoveMetadata = jsonSettings.RemoveMetadata;
JpegQualityLevel = jsonSettings.JpegQualityLevel;
PngInterlaceOption = jsonSettings.PngInterlaceOption;
TiffCompressOption = jsonSettings.TiffCompressOption;
FileName = jsonSettings.FileName;
KeepDateModified = jsonSettings.KeepDateModified;
FallbackEncoder = jsonSettings.FallbackEncoder;
CustomSize = jsonSettings.CustomSize;
SelectedSizeIndex = jsonSettings.SelectedSizeIndex;
if (jsonSettings.Sizes.Count > 0)
{
Sizes.Clear();
Sizes.AddRange(jsonSettings.Sizes);
// Ensure Ids are unique and handle missing Ids
IdRecoveryHelper.RecoverInvalidIds(Sizes);
}
}
}
}

View File

@@ -24,13 +24,15 @@ using Windows.Storage;
namespace Peek.FilePreviewer.Previewers.MediaPreviewer
{
public partial class AudioPreviewer : ObservableObject, IAudioPreviewer
public partial class AudioPreviewer : ObservableObject, IDisposable, IAudioPreviewer
{
private MediaSource? _mediaSource;
[ObservableProperty]
private PreviewState _state;
[ObservableProperty]
private AudioPreviewData _preview;
private AudioPreviewData? _preview;
private IFileSystemItem Item { get; }
@@ -40,7 +42,6 @@ namespace Peek.FilePreviewer.Previewers.MediaPreviewer
{
Item = file;
Dispatcher = DispatcherQueue.GetForCurrentThread();
Preview = new AudioPreviewData();
}
public async Task CopyAsync()
@@ -63,19 +64,23 @@ namespace Peek.FilePreviewer.Previewers.MediaPreviewer
{
State = PreviewState.Loading;
Preview = new AudioPreviewData();
var thumbnailTask = LoadThumbnailAsync(cancellationToken);
var sourceTask = LoadSourceAsync(cancellationToken);
var metadataTask = LoadMetadataAsync(cancellationToken);
await Task.WhenAll(thumbnailTask, sourceTask, metadataTask);
if (!thumbnailTask.Result || !sourceTask.Result || !metadataTask.Result)
if (sourceTask.Result && metadataTask.Result)
{
State = PreviewState.Error;
State = PreviewState.Loaded;
}
else
{
State = PreviewState.Loaded;
// Release all resources on error.
Unload();
State = PreviewState.Error;
}
}
@@ -88,12 +93,15 @@ namespace Peek.FilePreviewer.Previewers.MediaPreviewer
{
cancellationToken.ThrowIfCancellationRequested();
var thumbnail = await ThumbnailHelper.GetThumbnailAsync(Item.Path, cancellationToken)
?? await ThumbnailHelper.GetIconAsync(Item.Path, cancellationToken);
if (Preview != null)
{
var thumbnail = await ThumbnailHelper.GetThumbnailAsync(Item.Path, cancellationToken)
?? await ThumbnailHelper.GetIconAsync(Item.Path, cancellationToken);
cancellationToken.ThrowIfCancellationRequested();
cancellationToken.ThrowIfCancellationRequested();
Preview.Thumbnail = thumbnail ?? new SvgImageSource(new Uri("ms-appx:///Assets/Peek/DefaultFileIcon.svg"));
Preview.Thumbnail = thumbnail ?? new SvgImageSource(new Uri("ms-appx:///Assets/Peek/DefaultFileIcon.svg"));
}
});
});
}
@@ -110,7 +118,11 @@ namespace Peek.FilePreviewer.Previewers.MediaPreviewer
{
cancellationToken.ThrowIfCancellationRequested();
Preview.MediaSource = MediaSource.CreateFromStorageFile(storageFile);
if (Preview != null)
{
_mediaSource = MediaSource.CreateFromStorageFile(storageFile);
Preview.MediaSource = _mediaSource;
}
});
});
}
@@ -123,6 +135,11 @@ namespace Peek.FilePreviewer.Previewers.MediaPreviewer
await Dispatcher.RunOnUiThread(() =>
{
if (Preview == null)
{
return;
}
cancellationToken.ThrowIfCancellationRequested();
Preview.Title = PropertyStoreHelper.TryGetStringProperty(Item.Path, PropertyKey.MusicTitle)
?? Item.Name[..^Item.Extension.Length];
@@ -160,6 +177,22 @@ namespace Peek.FilePreviewer.Previewers.MediaPreviewer
return _supportedFileTypes.Contains(item.Extension);
}
public void Dispose()
{
Unload();
GC.SuppressFinalize(this);
}
/// <summary>
/// Explicitly unloads the preview and releases file resources.
/// </summary>
public void Unload()
{
_mediaSource?.Dispose();
_mediaSource = null;
Preview = null;
}
private static readonly HashSet<string> _supportedFileTypes = new()
{
".aac",

View File

@@ -25,6 +25,8 @@ namespace Peek.FilePreviewer.Previewers
{
public partial class VideoPreviewer : ObservableObject, IVideoPreviewer, IDisposable
{
private MediaSource? _mediaSource;
[ObservableProperty]
private MediaSource? preview;
@@ -56,6 +58,7 @@ namespace Peek.FilePreviewer.Previewers
public void Dispose()
{
Unload();
GC.SuppressFinalize(this);
}
@@ -145,7 +148,8 @@ namespace Peek.FilePreviewer.Previewers
MissingCodecName = missingCodecName;
}
Preview = MediaSource.CreateFromStorageFile(storageFile);
_mediaSource = MediaSource.CreateFromStorageFile(storageFile);
Preview = _mediaSource;
});
});
}
@@ -155,6 +159,16 @@ namespace Peek.FilePreviewer.Previewers
return !(VideoTask?.Result ?? true);
}
/// <summary>
/// Explicitly unloads the preview and releases file resources.
/// </summary>
public void Unload()
{
_mediaSource?.Dispose();
_mediaSource = null;
Preview = null;
}
private static readonly HashSet<string> _supportedFileTypes = new()
{
".mp4", ".3g2", ".3gp", ".3gp2", ".3gpp", ".asf", ".avi", ".m2t", ".m2ts",

View File

@@ -9,6 +9,7 @@ using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.PowerToys.UITest;
@@ -35,6 +36,105 @@ public class PeekFilePreviewTests : UITestBase
{
}
static PeekFilePreviewTests()
{
FixSettingsFileBeforeTests();
}
private static readonly JsonSerializerOptions IndentedJsonOptions = new() { WriteIndented = true };
private static void FixSettingsFileBeforeTests()
{
try
{
// Default Peek settings
string peekSettingsContent = @"{
""name"": ""Peek"",
""version"": ""1.0"",
""properties"": {
""ActivationShortcut"": {
""win"": false,
""ctrl"": true,
""alt"": false,
""shift"": false,
""code"": 32,
""key"": ""Space""
},
""AlwaysRunNotElevated"": {
""value"": true
},
""CloseAfterLosingFocus"": {
""value"": false
},
""ConfirmFileDelete"": {
""value"": true
},
""EnableSpaceToActivate"": {
""value"": false
}
}
}";
// Update Peek module settings
SettingsConfigHelper.UpdateModuleSettings(
"Peek",
peekSettingsContent,
(settings) =>
{
// Get or ensure properties section exists
Dictionary<string, object> properties;
if (settings.TryGetValue("properties", out var propertiesObj))
{
if (propertiesObj is Dictionary<string, object> dict)
{
properties = dict;
}
else if (propertiesObj is JsonElement jsonElem)
{
properties = JsonSerializer.Deserialize<Dictionary<string, object>>(jsonElem.GetRawText())
?? throw new InvalidOperationException("Failed to deserialize properties");
}
else
{
properties = new Dictionary<string, object>();
}
}
else
{
properties = new Dictionary<string, object>();
}
// Update the required properties
properties["ActivationShortcut"] = new Dictionary<string, object>
{
{ "win", false },
{ "ctrl", true },
{ "alt", false },
{ "shift", false },
{ "code", 32 },
{ "key", "Space" },
};
properties["EnableSpaceToActivate"] = new Dictionary<string, object>
{
{ "value", false },
};
settings["properties"] = properties;
});
// Disable all modules except Peek in global settings
SettingsConfigHelper.ConfigureGlobalModuleSettings("Peek");
Debug.WriteLine("Successfully updated all settings - Peek shortcut configured and all modules except Peek disabled");
}
catch (Exception ex)
{
Assert.Fail($"ERROR in FixSettingsFileBeforeTests: {ex.Message}");
}
}
[TestInitialize]
public void TestInitialize()
{

View File

@@ -212,7 +212,7 @@ namespace PowerAccent.Core
LetterKey.VK_L => new[] { "ļ", "₺" }, // ₺ is in VK_T for other languages, but not VK_L, so we add it here.
LetterKey.VK_M => new[] { "ṁ" },
LetterKey.VK_N => new[] { "ņ", "ṅ", "ⁿ", "", "№" },
LetterKey.VK_O => new[] { "ȯ", "∅" },
LetterKey.VK_O => new[] { "ȯ", "∅", "⌀" },
LetterKey.VK_P => new[] { "ṗ", "℗", "∏", "¶" },
LetterKey.VK_Q => new[] { "" },
LetterKey.VK_R => new[] { "ṙ", "®", "" },

View File

@@ -36,9 +36,9 @@ public static class AIServiceTypeRegistry
IsOnlineService = true,
LegalDescription = "AdvancedPaste_Anthropic_LegalDescription",
TermsLabel = "AdvancedPaste_Anthropic_TermsLabel",
TermsUri = new Uri("https://www.anthropic.com/legal/terms-of-service"),
TermsUri = new Uri("https://privacy.claude.com/en/collections/10672567-policies-terms-of-service"),
PrivacyLabel = "AdvancedPaste_Anthropic_PrivacyLabel",
PrivacyUri = new Uri("https://www.anthropic.com/legal/privacy"),
PrivacyUri = new Uri("https://privacy.claude.com/en/"),
},
[AIServiceType.AzureAIInference] = new AIServiceTypeMetadata
{
@@ -81,9 +81,9 @@ public static class AIServiceTypeRegistry
IsOnlineService = true,
LegalDescription = "AdvancedPaste_Google_LegalDescription",
TermsLabel = "AdvancedPaste_Google_TermsLabel",
TermsUri = new Uri("https://policies.google.com/terms"),
TermsUri = new Uri("https://ai.google.dev/gemini-api/terms"),
PrivacyLabel = "AdvancedPaste_Google_PrivacyLabel",
PrivacyUri = new Uri("https://policies.google.com/privacy"),
PrivacyUri = new Uri("https://support.google.com/gemini/answer/13594961"),
},
[AIServiceType.HuggingFace] = new AIServiceTypeMetadata
{
@@ -126,9 +126,9 @@ public static class AIServiceTypeRegistry
IsLocalModel = true,
LegalDescription = "AdvancedPaste_LocalModel_LegalDescription",
TermsLabel = "AdvancedPaste_Ollama_TermsLabel",
TermsUri = new Uri("https://ollama.com/terms"),
TermsUri = new Uri("https://ollama.org/terms"),
PrivacyLabel = "AdvancedPaste_Ollama_PrivacyLabel",
PrivacyUri = new Uri("https://ollama.com/privacy"),
PrivacyUri = new Uri("https://ollama.org/privacy"),
},
[AIServiceType.Onnx] = new AIServiceTypeMetadata
{

View File

@@ -9,7 +9,10 @@
mc:Ignorable="d">
<Grid>
<Button Click="ShortcutConflictBtn_Click" Style="{StaticResource SubtleButtonStyle}">
<Button
x:Uid="ShortcutConflictControl_Automation"
Click="ShortcutConflictBtn_Click"
Style="{StaticResource SubtleButtonStyle}">
<Grid ColumnSpacing="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />

View File

@@ -111,7 +111,8 @@
x:Uid="UpdateAvailableInfoBar"
IsClosable="False"
IsOpen="{x:Bind ViewModel.IsUpdateAvailable, Mode=OneWay}"
Severity="Success" />
Severity="Success"
Tapped="UpdateInfoBar_Tapped" />
<StackPanel
Grid.Row="1"
@@ -144,7 +145,6 @@
<Button
x:Name="SettingsBtn"
x:Uid="SettingsBtn"
Padding="8"
Click="SettingsBtn_Click"
Style="{StaticResource FlyoutButtonStyle}">
<ToolTipService.ToolTip>

View File

@@ -10,6 +10,7 @@ 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;
using Microsoft.PowerToys.Settings.UI.Views;
using Microsoft.PowerToys.Telemetry;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -183,5 +184,14 @@ namespace Microsoft.PowerToys.Settings.UI.Flyout
// Closing manually the flyout since no window will steal the focus
App.GetFlyoutWindow()?.Hide();
}
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));
}
}
}

View File

@@ -240,6 +240,7 @@
<ComboBox
x:Name="Languages_ComboBox"
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}"
DisplayMemberPath="Language"
ItemsSource="{Binding Languages, Mode=TwoWay}"
SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" />
@@ -262,7 +263,10 @@
<tkcontrols:SettingsCard.Description>
<HyperlinkButton x:Uid="Windows_Color_Settings" Click="OpenColorsSettings_Click" />
</tkcontrols:SettingsCard.Description>
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind ViewModel.ThemeIndex, Mode=TwoWay}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{Binding ElementName=ColorModeHeader, Path=Header}"
SelectedIndex="{x:Bind ViewModel.ThemeIndex, Mode=TwoWay}">
<ComboBoxItem x:Uid="Radio_Theme_Dark" />
<ComboBoxItem x:Uid="Radio_Theme_Light" />
<ComboBoxItem x:Uid="Radio_Theme_Default" />
@@ -273,12 +277,16 @@
Name="GeneralPageRunAtStartUp"
x:Uid="GeneralPage_RunAtStartUp"
IsEnabled="{x:Bind ViewModel.IsRunAtStartupGPOManaged, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.Startup, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=GeneralPageRunAtStartUp, Path=Header}"
IsOn="{x:Bind ViewModel.Startup, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
<controls:GPOInfoControl ShowWarning="{x:Bind ViewModel.IsRunAtStartupGPOManaged, Mode=OneWay}">
<tkcontrols:SettingsCard x:Uid="ShowSystemTrayIcon">
<tkcontrols:SettingsCard x:Name="ShowSystemTrayIconCard" x:Uid="ShowSystemTrayIcon">
<ToggleSwitch
x:Uid="ShowSystemTrayIcon_ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=ShowSystemTrayIconCard, Path=Header}"
IsOn="{x:Bind ViewModel.ShowSysTrayIcon, Mode=TwoWay}"
Toggled="ShowSystemTrayIcon_Toggled" />
</tkcontrols:SettingsCard>
@@ -398,12 +406,16 @@
<tkcontrols:SettingsCard.HeaderIcon>
<PathIcon Data="M1859 1758q14 23 21 47t7 51q0 40-15 75t-41 61-61 41-75 15H354q-40 0-75-15t-61-41-41-61-15-75q0-27 6-51t21-47l569-992q10-14 10-34V128H640V0h768v128h-128v604q0 19 10 35l569 991zM896 732q0 53-27 99l-331 577h972l-331-577q-27-46-27-99V128H896v604zm799 1188q26 0 44-19t19-45q0-10-2-17t-8-16l-164-287H464l-165 287q-9 15-9 33 0 26 18 45t46 19h1341z" />
</tkcontrols:SettingsCard.HeaderIcon>
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.EnableExperimentation, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=GeneralPageEnableExperimentation, Path=Header}"
IsOn="{x:Bind ViewModel.EnableExperimentation, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="General_DiagnosticsAndFeedback">
<tkcontrols:SettingsExpander
x:Name="GeneralPageEnableDataDiagnostics"
x:Uid="GeneralPage_EnableDataDiagnostics"
HeaderIcon="{ui:FontIcon Glyph=&#xE9D9;}"
IsEnabled="{x:Bind ViewModel.IsDataDiagnosticsGPOManaged, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
@@ -421,10 +433,19 @@
NavigateUri="https://aka.ms/powertoys-data-and-privacy-documentation" />
</StackPanel>
</tkcontrols:SettingsExpander.Description>
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.EnableDataDiagnostics, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=GeneralPageEnableDataDiagnostics, Path=Header}"
IsOn="{x:Bind ViewModel.EnableDataDiagnostics, Mode=TwoWay}" />
<tkcontrols:SettingsExpander.Items>
<tkcontrols:SettingsCard x:Uid="GeneralPage_EnableViewDiagnosticData" IsEnabled="{x:Bind ViewModel.EnableDataDiagnostics, Mode=TwoWay}">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.EnableViewDataDiagnostics, Mode=TwoWay}" />
<tkcontrols:SettingsCard
x:Name="GeneralPageEnableViewDiagnosticData"
x:Uid="GeneralPage_EnableViewDiagnosticData"
IsEnabled="{x:Bind ViewModel.EnableDataDiagnostics, Mode=TwoWay}">
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=GeneralPageEnableViewDiagnosticData, Path=Header}"
IsOn="{x:Bind ViewModel.EnableViewDataDiagnostics, Mode=TwoWay}" />
<tkcontrols:SettingsCard.Description>
<StackPanel Orientation="Vertical">
<TextBlock

View File

@@ -23,7 +23,10 @@
Name="NewPlusEnableToggle"
x:Uid="NewPlus_Enable_Toggle"
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/NewPlus.png}">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=NewPlusEnableToggle, Path=Header}"
IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
<controls:SettingsGroup x:Uid="NewPlus_Templates" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
@@ -60,12 +63,18 @@
Name="NewPlusHideFileExtensionToggle"
x:Uid="NewPlus_Hide_File_Extension_Toggle"
IsEnabled="{x:Bind ViewModel.IsHideFileExtSettingsCardEnabled, Mode=OneWay}">
<ToggleSwitch x:Uid="HideFileExtensionToggle" IsOn="{x:Bind ViewModel.HideFileExtension, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="HideFileExtensionToggle"
AutomationProperties.Name="{Binding ElementName=NewPlusHideFileExtensionToggle, Path=Header}"
IsOn="{x:Bind ViewModel.HideFileExtension, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
<tkcontrols:SettingsCard Name="NewPlusHideStartingDigitsToggle" x:Uid="NewPlus_Hide_Starting_Digits_Toggle">
<ToggleSwitch x:Uid="HideStartingDigitsToggle" IsOn="{x:Bind ViewModel.HideStartingDigits, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="HideStartingDigitsToggle"
AutomationProperties.Name="{Binding ElementName=NewPlusHideStartingDigitsToggle, Path=Header}"
IsOn="{x:Bind ViewModel.HideStartingDigits, Mode=TwoWay}" />
<tkcontrols:SettingsCard.Description>
<TextBlock x:Uid="NewPlus_Hide_Starting_Digits_Description" />
</tkcontrols:SettingsCard.Description>
@@ -79,7 +88,10 @@
x:Uid="NewPlus_Behaviour_Replace_Variables_Toggle"
IsEnabled="{x:Bind ViewModel.IsReplaceVariablesSettingsCardEnabled, Mode=OneWay}">
<StackPanel Orientation="Horizontal" Spacing="4">
<ToggleSwitch x:Uid="ReplaceVariablesToggle" IsOn="{x:Bind ViewModel.ReplaceVariables, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ReplaceVariablesToggle"
AutomationProperties.Name="{Binding ElementName=NewPlusBehaviourReplaceVariablesToggle, Path=Header}"
IsOn="{x:Bind ViewModel.ReplaceVariables, Mode=TwoWay}" />
<Button
x:Uid="FileCreationButton"
Width="28"

View File

@@ -67,6 +67,7 @@
Header="{x:Bind Path=DisplayLabel}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{x:Bind Path=DisplayLabel}"
DisplayMemberPath="Key"
ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind ComboBoxValue, Mode=TwoWay}"
@@ -110,6 +111,7 @@
Header="{x:Bind Path=DisplayLabel}">
<NumberBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{x:Bind Path=DisplayLabel}"
LargeChange="{x:Bind NumberBoxLargeChange, Mode=OneWay}"
Maximum="{x:Bind NumberBoxMax, Mode=OneWay}"
Minimum="{x:Bind NumberBoxMin, Mode=OneWay}"
@@ -175,6 +177,7 @@
IsEnabled="{x:Bind SecondSettingIsEnabled, Mode=OneWay}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{x:Bind Path=SecondDisplayLabel}"
DisplayMemberPath="Key"
ItemsSource="{x:Bind Path=ComboBoxItems}"
SelectedValue="{x:Bind ComboBoxValue, Mode=TwoWay}"
@@ -290,6 +293,7 @@
IsEnabled="{x:Bind SecondSettingIsEnabled, Mode=OneWay}">
<NumberBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{x:Bind Path=SecondDisplayLabel}"
LargeChange="{x:Bind NumberBoxLargeChange, Mode=OneWay}"
Maximum="{x:Bind NumberBoxMax, Mode=OneWay}"
Minimum="{x:Bind NumberBoxMin, Mode=OneWay}"

View File

@@ -22,7 +22,10 @@
Name="PowerRenameToggleEnable"
x:Uid="PowerRename_Toggle_Enable"
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/PowerRename.png}">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=PowerRenameToggleEnable, Path=Header}"
IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:GPOInfoControl>
<controls:SettingsGroup x:Uid="PowerRename_ShellIntegration" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
@@ -30,7 +33,10 @@
Name="PowerRenameToggleContextMenu"
x:Uid="PowerRename_Toggle_ContextMenu"
IsExpanded="False">
<ComboBox MinWidth="{StaticResource SettingActionControlMinWidth}" SelectedIndex="{x:Bind ViewModel.EnabledOnContextExtendedMenu, Mode=TwoWay, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{Binding ElementName=PowerRenameToggleContextMenu, Path=Header}"
SelectedIndex="{x:Bind ViewModel.EnabledOnContextExtendedMenu, Mode=TwoWay, Converter={StaticResource BoolToComboBoxIndexConverter}}">
<ComboBoxItem x:Uid="PowerRename_Toggle_StandardContextMenu" />
<ComboBoxItem x:Uid="PowerRename_Toggle_ExtendedContextMenu" />
</ComboBox>
@@ -53,7 +59,10 @@
Name="PowerRenameToggleAutoComplete"
x:Uid="PowerRename_Toggle_AutoComplete"
IsExpanded="True">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.MRUEnabled, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=PowerRenameToggleAutoComplete, Path=Header}"
IsOn="{x:Bind ViewModel.MRUEnabled, Mode=TwoWay}" />
<tkcontrols:SettingsExpander.Items>
<tkcontrols:SettingsCard
Name="PowerRenameToggleMaxDispListNum"
@@ -61,6 +70,7 @@
IsEnabled="{x:Bind ViewModel.GlobalAndMruEnabled, Mode=OneWay}">
<NumberBox
MinWidth="{StaticResource SettingActionControlMinWidth}"
AutomationProperties.Name="{Binding ElementName=PowerRenameToggleMaxDispListNum, Path=Header}"
Maximum="20"
Minimum="0"
SpinButtonPlacementMode="Compact"
@@ -73,12 +83,18 @@
Name="PowerRenameToggleRestoreFlagsOnLaunch"
x:Uid="PowerRename_Toggle_RestoreFlagsOnLaunch"
HeaderIcon="{ui:FontIcon Glyph=&#xe81c;}">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.RestoreFlagsOnLaunch, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=PowerRenameToggleRestoreFlagsOnLaunch, Path=Header}"
IsOn="{x:Bind ViewModel.RestoreFlagsOnLaunch, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:SettingsGroup>
<controls:SettingsGroup x:Uid="PowerRename_BehaviorHeader" IsEnabled="{x:Bind ViewModel.IsEnabled, Mode=OneWay}">
<tkcontrols:SettingsCard Name="PowerRenameToggleUseBoostLib" x:Uid="PowerRename_Toggle_UseBoostLib">
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.UseBoostLib, Mode=TwoWay}" />
<ToggleSwitch
x:Uid="ToggleSwitch"
AutomationProperties.Name="{Binding ElementName=PowerRenameToggleUseBoostLib, Path=Header}"
IsOn="{x:Bind ViewModel.UseBoostLib, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
</controls:SettingsGroup>
</StackPanel>

View File

@@ -5580,6 +5580,9 @@ To record a specific window, enter the hotkey with the Alt key in the opposite m
<data name="ShortcutConflictControl_Title.Text" xml:space="preserve">
<value>Shortcut conflicts</value>
</data>
<data name="ShortcutConflictControl_Automation.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Shortcut conflicts</value>
</data>
<data name="ShortcutConflictControl_NoConflictsFound" xml:space="preserve">
<value>No conflicts found</value>
</data>