Compare commits

..

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
466bd0c0a5 Fix: subscribe to ItemsChanged before fetching items to avoid missing early events
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/3f380bd3-a56a-4708-80ef-3e7d534c4f6f

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-04-29 08:58:21 +00:00
copilot-swe-agent[bot]
8db30b7e46 Initial plan 2026-04-29 08:49:46 +00:00
6 changed files with 11 additions and 10 deletions

View File

@@ -129,8 +129,8 @@ public partial class ContentPageViewModel : PageViewModel, ICommandBarContext
UpdateDetails();
FetchContent();
model.ItemsChanged += Model_ItemsChanged;
FetchContent();
DoOnUiThread(
() =>

View File

@@ -44,9 +44,9 @@ public partial class ContentTreeViewModel(ITreeContent _tree, WeakReference<IPag
UpdateProperty(nameof(Root));
}
FetchContent();
model.PropChanged += Model_PropChanged;
model.ItemsChanged += Model_ItemsChanged;
FetchContent();
}
// Theoretically, we should unify this with the one in CommandPalettePageViewModelFactory

View File

@@ -209,8 +209,8 @@ public sealed partial class DockBandViewModel : ExtensionObjectViewModel
var list = command.Model.Unsafe as IListPage;
if (list is not null)
{
InitializeFromList(list);
list.ItemsChanged += HandleItemsChanged;
InitializeFromList(list);
}
else
{

View File

@@ -957,8 +957,8 @@ public partial class ListViewModel : PageViewModel, IDisposable
Filters?.InitializeProperties();
UpdateProperty(nameof(Filters));
FetchItems(true);
model.ItemsChanged += Model_ItemsChanged;
FetchItems(true);
}
private static IGridPropertiesViewModel? LoadGridPropertiesViewModel(IGridProperties? gridProperties)

View File

@@ -6,6 +6,7 @@ using System;
using System.Collections.Generic;
using System.IO.Abstractions;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Xml.Linq;
@@ -81,7 +82,7 @@ namespace Microsoft.Plugin.Program.Programs
if (Marshal.ReleaseComObject(stream) > 0)
{
Log.Error("AppxManifest.xml was leaked", GetType());
Log.Error("AppxManifest.xml was leaked", MethodBase.GetCurrentMethod().DeclaringType);
}
}
else
@@ -109,7 +110,7 @@ namespace Microsoft.Plugin.Program.Programs
}
else
{
Log.Error($"Error occurred while trying to get the XML from {path}", typeof(UWP));
Log.Error($"Error occurred while trying to get the XML from {path}", MethodBase.GetCurrentMethod().DeclaringType);
return Array.Empty<string>();
}
@@ -144,7 +145,7 @@ namespace Microsoft.Plugin.Program.Programs
}
catch (Exception e)
{
ProgramLogger.Exception($"Unable to convert Package to UWP for {p.FullName}", e, typeof(UWP), p.InstalledLocation);
ProgramLogger.Exception($"Unable to convert Package to UWP for {p.FullName}", e, MethodBase.GetCurrentMethod().DeclaringType, p.InstalledLocation);
return Array.Empty<UWPApplication>();
}
@@ -176,7 +177,7 @@ namespace Microsoft.Plugin.Program.Programs
}
catch (Exception e)
{
ProgramLogger.Exception("An unexpected error occurred and unable to verify if package is valid", e, typeof(UWP), "id");
ProgramLogger.Exception("An unexpected error occurred and unable to verify if package is valid", e, MethodBase.GetCurrentMethod().DeclaringType, "id");
return false;
}
});

View File

@@ -215,7 +215,7 @@ namespace Microsoft.Plugin.Program.Programs
}
catch (Exception ex)
{
ProgramLogger.Exception($"Unable to launch UWP {DisplayName}", ex, GetType(), queryArguments);
ProgramLogger.Exception($"Unable to launch UWP {DisplayName}", ex, MethodBase.GetCurrentMethod().DeclaringType, queryArguments);
var name = "Plugin: " + Properties.Resources.wox_plugin_program_plugin_name;
var message = $"{Properties.Resources.powertoys_run_plugin_program_uwp_failed}: {DisplayName}";
api.ShowMsg(name, message, string.Empty);
@@ -284,7 +284,7 @@ namespace Microsoft.Plugin.Program.Programs
}
catch (Exception e)
{
ProgramLogger.Exception($"Unable to parse manifest file for {DisplayName}", e, GetType(), manifest);
ProgramLogger.Exception($"Unable to parse manifest file for {DisplayName}", e, MethodBase.GetCurrentMethod().DeclaringType, manifest);
}
}
}