Repository navigation
fix: the Delete key no longer takes a row off a list while nothing changes on the PC - #2921
Merged
Merged
Conversation
…anges on the PC - The eight editable grids that left CanUserDeleteRows at its default, Startup Manager, Uninstaller, Right-click Menu, Environment Variables, Preinstalled Apps, App Updates, Browser Cleaner and Windows Update, turn it off like the five that already did. - ArchitectureTests.EveryEditableGrid_TurnsOffTheDeleteKey requires it of every grid that is not read-only, and StartupViewUiTests presses Delete on the real Startup list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2809.
WPF's
DataGridbinds Delete toApplicationCommands.Deleteand takes the selected rows off its collection whenever it is not read-only andCanUserDeleteRowskeeps its default of true. Eight grids are editable for their tick or switch columns and never turned it off, and the implicitDataGridstyle does not either: Startup Manager, Uninstaller, Right-click Menu, Environment Variables, Preinstalled Apps, App Updates, Browser Cleaner and Windows Update. Pressing Delete on a selected row made it vanish with no confirmation while nothing changed on the PC: the startup program still ran at boot and the app stayed installed. On Environment Variables, Apply then deleted nothing; on Preinstalled Apps the hidden row stayed ticked, so Remove selected could remove an app no longer on screen. Since each list was added, the oldest in 0.3.0.CanUserDeleteRows="False"beside theCanUserAddRows="False"each already sets, as App Blocker, DNS & Hosts, Shortcut Cleaner, File Shredder and New App Alerts do. A read-only grid needs nothing: WPF refuses Delete on one.ArchitectureTests.EveryEditableGrid_TurnsOffTheDeleteKeyreads everyDataGridin the views and requiresCanUserDeleteRows="False"of each that is not read-only. Its floor is the 35 grids and 11 editable ones measured.The attribute on each grid rather than a setter in the implicit style, because the five grids that already turned Delete off do it that way, and the guard reads what each grid says.
Docs
README: the keyboard section says Delete does nothing in a list.
Tests
StartupViewUiTests.TheDeleteKey_LeavesTheListAlone(the real XAML): with a row selected, Delete cannot run on the Startup list and the list keeps both rows. The view is given only the list it binds:StartupViewModel's scan hands its result to the application's dispatcher once any test has made one, and nothing pumps that dispatcher on the test's STA thread, so a test waiting for the scan hung when it ran after another view test.ArchitectureTests(237) andStartupViewUiTeststogether with the Browser Cleaner, Ping and New App Alerts view tests (13). All four projects build with 0 warnings, anddotnet format --verify-no-changesis clean.