diff --git a/src/Files.App (Package)/Files.Package.wapproj b/src/Files.App (Package)/Files.Package.wapproj index c4ebc93c3f0e..7803f4640589 100644 --- a/src/Files.App (Package)/Files.Package.wapproj +++ b/src/Files.App (Package)/Files.Package.wapproj @@ -108,7 +108,7 @@ - + diff --git a/src/Files.App.Controls/Files.App.Controls.csproj b/src/Files.App.Controls/Files.App.Controls.csproj index f70c1894aa68..a5b677f85943 100644 --- a/src/Files.App.Controls/Files.App.Controls.csproj +++ b/src/Files.App.Controls/Files.App.Controls.csproj @@ -17,9 +17,8 @@ - - + diff --git a/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs b/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs index be5b0d031f22..ae9d5917a05e 100644 --- a/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs +++ b/src/Files.App.Controls/ThemedIcon/ThemedIcon.cs @@ -6,11 +6,11 @@ using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Markup; using Microsoft.UI.Xaml.Shapes; -using CommunityToolkit.WinUI.UI; using Microsoft.UI.Xaml.Controls.Primitives; using System.Linq; using System.Collections.Generic; using System.Reflection.Emit; +using System; namespace Files.App.Controls { @@ -371,6 +371,30 @@ private void UpdateIconColorTypeStates() layer.IconColorType = IconColorType; } } - } - } + } + + private T? FindAscendant() where T : notnull, DependencyObject + { + T val; + DependencyObject element = this; + while (true) + { + DependencyObject parent = VisualTreeHelper.GetParent(element); + if (parent is null) + { + return null; + } + + if (parent is T target) + { + val = target; + break; + } + + element = parent; + } + + return val; + } + } } diff --git a/src/Files.App.Launcher/Files.App.Launcher.vcxproj b/src/Files.App.Launcher/Files.App.Launcher.vcxproj index d4a97cd06ccb..89dc32d0b823 100644 --- a/src/Files.App.Launcher/Files.App.Launcher.vcxproj +++ b/src/Files.App.Launcher/Files.App.Launcher.vcxproj @@ -1,7 +1,7 @@ - + Debug @@ -329,15 +329,15 @@ - - + + This project references a NuGet package that is not on this computer. To download those packages, use Restore NuGet Packages. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + - \ No newline at end of file + diff --git a/src/Files.App.Launcher/packages.config b/src/Files.App.Launcher/packages.config index 1b706ca9a10d..2ddc908f46b1 100644 --- a/src/Files.App.Launcher/packages.config +++ b/src/Files.App.Launcher/packages.config @@ -1,5 +1,5 @@  - - + + \ No newline at end of file diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj index f06b68adabb4..65973177487f 100644 --- a/src/Files.App/Files.App.csproj +++ b/src/Files.App/Files.App.csproj @@ -67,20 +67,20 @@ - + - + - - - + + + - + @@ -88,8 +88,8 @@ - - + + diff --git a/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs b/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs index ddd7c17ea8e4..7e128596400b 100644 --- a/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs +++ b/src/Files.App/Utils/Storage/Operations/FileOperationsHelpers.cs @@ -127,7 +127,7 @@ public static Task SetClipboard(string[] filesToCopy, DataPackageOperation opera { using var shi = new ShellItem(fileToDeletePath[i]); using var file = SafetyExtensions.IgnoreExceptions(() => GetFirstFile(shi)) ?? shi; - if ((uint?)file.Properties.GetValueOrDefault(PKEY_FilePlaceholderStatus) == PS_CLOUDFILE_PLACEHOLDER) + if (file.Properties.TryGetValue(PKEY_FilePlaceholderStatus, out var value) && (uint?)value == PS_CLOUDFILE_PLACEHOLDER) { // Online only files cannot be tried for deletion, so they are treated as to be permanently deleted. shellOperationResult.Items.Add(new ShellOperationItemResult() diff --git a/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs b/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs index 9c2a5d888e1f..db9826dfd610 100644 --- a/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs +++ b/src/Files.App/Utils/Storage/Operations/FilesystemHelpers.cs @@ -8,6 +8,7 @@ using System.IO; using System.Runtime.InteropServices; using System.Runtime.InteropServices.ComTypes; +using Vanara.Extensions; using Vanara.PInvoke; using Vanara.Windows.Shell; using Windows.ApplicationModel.DataTransfer; diff --git a/src/Files.App/Views/Layouts/BaseLayoutPage.cs b/src/Files.App/Views/Layouts/BaseLayoutPage.cs index 4a78f5a34e13..64b4234db3fd 100644 --- a/src/Files.App/Views/Layouts/BaseLayoutPage.cs +++ b/src/Files.App/Views/Layouts/BaseLayoutPage.cs @@ -15,6 +15,7 @@ using System.IO; using System.Runtime.CompilerServices; using System.Runtime.InteropServices.ComTypes; +using Vanara.Extensions; using Vanara.PInvoke; using Windows.ApplicationModel.DataTransfer; using Windows.ApplicationModel.DataTransfer.DragDrop; diff --git a/tests/Files.App.UITests/Files.App.UITests.csproj b/tests/Files.App.UITests/Files.App.UITests.csproj index 221b27ab8d58..cac7033df940 100644 --- a/tests/Files.App.UITests/Files.App.UITests.csproj +++ b/tests/Files.App.UITests/Files.App.UITests.csproj @@ -28,7 +28,7 @@ - + diff --git a/tests/Files.InteractionTests/Files.InteractionTests.csproj b/tests/Files.InteractionTests/Files.InteractionTests.csproj index 8db0fac809c2..182d9b01be5b 100644 --- a/tests/Files.InteractionTests/Files.InteractionTests.csproj +++ b/tests/Files.InteractionTests/Files.InteractionTests.csproj @@ -19,10 +19,10 @@ - + - - + + diff --git a/tests/Files.InteractionTests/Helper/AxeHelper.cs b/tests/Files.InteractionTests/Helper/AxeHelper.cs index b56a0b41f025..299eb3701ef9 100644 --- a/tests/Files.InteractionTests/Helper/AxeHelper.cs +++ b/tests/Files.InteractionTests/Helper/AxeHelper.cs @@ -24,7 +24,8 @@ internal static void InitializeAxe() public static void AssertNoAccessibilityErrors() { - var testResult = AccessibilityScanner.Scan(null).WindowScanOutputs.SelectMany(output => output.Errors).Where(error => error.Rule.ID != RuleId.BoundingRectangleNotNull); + var testResult = AccessibilityScanner.Scan(null).WindowScanOutputs.SelectMany(output => output.Errors) + .Where(error => !(error.Rule.ID is RuleId.BoundingRectangleNotNull or RuleId.SiblingUniqueAndFocusable)); if (testResult.Count() != 0) { var mappedResult = testResult.Select(result => "Element " + result.Element.Properties["ControlType"] + " violated rule '" + result.Rule.Description + "'."); diff --git a/tests/Files.InteractionTests/Tests/FolderTests.cs b/tests/Files.InteractionTests/Tests/FolderTests.cs index 7bcf37afdaca..57f1f6071919 100644 --- a/tests/Files.InteractionTests/Tests/FolderTests.cs +++ b/tests/Files.InteractionTests/Tests/FolderTests.cs @@ -3,6 +3,7 @@ using OpenQA.Selenium; using OpenQA.Selenium.Interactions; +using System.Linq; using System.Threading; namespace Files.InteractionTests.Tests @@ -65,6 +66,8 @@ private void CreateFolderTest() // Check for accessibility issues in the new folder prompt AxeHelper.AssertNoAccessibilityErrors(); + SessionManager.Session.FindElementsByClassName("TextBox").Last().Click(); + // Type the folder name var action = new Actions(SessionManager.Session); action.SendKeys("New Folder").Perform(); @@ -137,6 +140,7 @@ private void DeleteFolderTest() var action = new Actions(SessionManager.Session); action.SendKeys(Keys.Enter).Perform(); + Thread.Sleep(3000); // Select the "Renamed Folder - Copy" folder and clicks the "delete" button on the toolbar TestHelper.InvokeButtonByName("Renamed Folder - Copy");