Skip to content

fix: the Delete key no longer takes a row off a list while nothing changes on the PC - #2921

Merged
laurentiu021 merged 1 commit into
mainfrom
fix/delete-key-leaves-lists-alone
Oct 21, 2026
Merged

laurentiu021 merged 1 commit into
mainfrom
fix/delete-key-leaves-lists-alone

Conversation

@laurentiu021

Copy link
Copy Markdown
Owner

Closes #2809.

WPF's DataGrid binds Delete to ApplicationCommands.Delete and takes the selected rows off its collection whenever it is not read-only and CanUserDeleteRows keeps its default of true. Eight grids are editable for their tick or switch columns and never turned it off, and the implicit DataGrid style 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.

  • The eight grids set CanUserDeleteRows="False" beside the CanUserAddRows="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.
  • New guard: ArchitectureTests.EveryEditableGrid_TurnsOffTheDeleteKey reads every DataGrid in the views and requires CanUserDeleteRows="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

  • New 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.
  • Red before the fix, green after: without the attribute on Startup Manager the guard and the view test both fail, Delete being able to run; without it on Environment Variables the guard fails.
  • Run locally, twice: ArchitectureTests (237) and StartupViewUiTests together with the Browser Cleaner, Ping and New App Alerts view tests (13). All four projects build with 0 warnings, and dotnet format --verify-no-changes is clean.

…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.
@laurentiu021
laurentiu021 merged commit aa1eb3e into main Oct 21, 2026
6 checks passed
@laurentiu021
laurentiu021 deleted the fix/delete-key-leaves-lists-alone branch October 21, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Startup Manager, Uninstaller and six more — the Delete key silently removes the selected row from the list while nothing changes on the PC

1 participant