feat(nfc): Delete all on the NFC page, asked first with how many go #239

Merged
HumanBean merged 7 commits from llun/LongshotLauncher:feat/nfc-delete-all into main 2026-11-21 21:26:19 +00:00
Member

A player with hundreds of NFC dumps (the game lists only 256 of them) has to tick every row to clear the NFC page. This adds Delete all, which asks once before deleting the tags the list shows, keeping files that changed before the deletion check or could not be checked or deleted.

Summary

The button. It's under Delete selected on the NFC page, in the same style. It's off when the list is empty and while files are being added, like Delete selected.

Asked first. It opens the same dialog as the row's bin and Delete selected (NfcDeleteView). The dialog lists the first 8 names and how many more. For Delete all it says:

  • the title says how many go: Delete all 300 NFC tags?, or Delete all N files? when some listed files aren't a dump;
  • that it can't be undone, and that the files the tags were added from and the figures aren't touched;
  • that a tag scanned with a controller is kept only in the NFC folder;
  • on Linux, to close other programs using the files because changes made while deleting may still be lost;
  • the buttons are Keep them and Delete all. With a single file listed it asks by name, as the row's bin does, with Keep it and Delete buttons and the same Delete all warnings.

What it deletes. It snapshots the files the list showed when it asked and deletes only those whose identity and contents can still be verified:

  • only .bin and .nfc files directly in the NFC folder;
  • never a key_ file, another kind of file, a folder under it, the folder itself, or anything outside it;
  • not a file put there after the question opened, or a listed file that was replaced, whose contents changed before the deletion check, or that could not be checked or deleted. On Linux, changes made through an already open handle after the check may still be lost. A file that cannot be restored to its original name is kept at a recovery path, which is reported.

The row's bin and Delete selected use the same identity and contents checks. Afterwards the list, the count and the "only 256 of N" note update, a toast says how many went and how many were kept, and kept files are reported.

Recycle Bin. The launcher has no Recycle Bin code, so the delete is permanent, like the existing deletes, and the dialog says it can't be undone. Adding the bin would change all three delete paths, so it isn't done here.

Text. The NFC page's text isn't in the translation catalogs yet: none of its strings go through Tr. The new strings follow the page, and scripts/translations.py reports nothing new.

Other changes:

  • docs/nfc.md's Deleting and Tests sections, and the README's NFC paragraph and scene list, describe it.
  • tools/screenshots has three new scenes over 300 fake tags: nfc, nfc-delete-all and nfc-deleted-all.
  • test_launcher_core.py's --strict line names the new app-level check.

Other PRs. #202 (the redesign) changes NfcView.axaml, NfcViewModel.cs and docs/nfc.md, but not the Delete button's lines. It's already not mergeable against main, so whichever lands second needs a small merge.

Testing

  • New check: tests/launcher_app/Program.cs, NfcDeleteAll. It runs over fake tags in a temp folder, through LONGSHOT_NFC_DIR; no real dump is used. The folder holds 257 tags, one .nfc that isn't a dump, a key_ file, a .txt, a subfolder with a .bin, and a .bin beside the folder. It checks:
    • the question opens first, says how many, and Keep them keeps every file;
    • Delete all deletes the unchanged listed files, and keeps and reports replaced files, including one with identical contents, as well as keeping a file added after the question, the key_ file, the .txt, the subfolder's file, the file outside and the folder itself;
    • Rows, Count, TooMany and TooManyText are raised, and the command's CanExecuteChanged fires;
    • with one file left it asks by name with the Delete all warnings, and with an empty list the button is off and asks nothing.
  • It fails on main: main has no DeleteAllCommand, so the check doesn't compile there. On this branch it passes.
  • dotnet build LongshotLauncher.slnx -c Release: 0 warnings, 0 errors.
  • python -I tests/test_launcher_core.py on Windows 11 stops at SavesChecks' "A link whose shared save folder is gone" (a Windows symlink case), the same way on unchanged main. This PR doesn't touch tests/launcher_core/. --strict --longshot at the pinned commit stops earlier, on ShaderCaches.cs' names against the pinned dev_packs.py, also the same on main. CI's Linux run covers both.
  • LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py: 3 failures, test_the_bump, test_the_next_stable and test_check_tag_against_the_published_releases. They fail the same way on unchanged main (#236 saw the same).
  • python -I scripts/translations.py: the same report as main, with the same texts missing from the catalogs and none new.
  • Screenshots (tools/screenshots, Windows 11, headless): 300 fake tags made in each scene's own temporary NFC folder. The scenes use the real window, view model and dialog, and nfc-deleted-all actually deletes the 300 files. The folder path on Open the folder is blurred. They're in the first comment: the page on main, the page with Delete all, the question, and the page after.

Not tested:

  • Clicked by hand in the running launcher. The screens were driven headless through the real window and bindings, not with a mouse in a live window.
  • Linux. Only Windows here. Deletion uses platform-specific code, and the new check uses the Platform.Linux launcher the app checks already use.

🤖 Generated with Claude Code

A player with hundreds of NFC dumps (the game lists only 256 of them) has to tick every row to clear the NFC page. This adds **Delete all**, which asks once before deleting the tags the list shows, keeping files that changed before the deletion check or could not be checked or deleted. ## Summary **The button.** It's under *Delete selected* on the NFC page, in the same style. It's off when the list is empty and while files are being added, like Delete selected. **Asked first.** It opens the same dialog as the row's bin and Delete selected (`NfcDeleteView`). The dialog lists the first 8 names and how many more. For Delete all it says: - the title says how many go: *Delete all 300 NFC tags?*, or *Delete all N files?* when some listed files aren't a dump; - that it can't be undone, and that the files the tags were added from and the figures aren't touched; - that a tag scanned with a controller is kept only in the NFC folder; - on Linux, to close other programs using the files because changes made while deleting may still be lost; - the buttons are *Keep them* and *Delete all*. With a single file listed it asks by name, as the row's bin does, with *Keep it* and *Delete* buttons and the same Delete all warnings. **What it deletes.** It snapshots the files the list showed when it asked and deletes only those whose identity and contents can still be verified: - only `.bin` and `.nfc` files directly in the NFC folder; - never a `key_` file, another kind of file, a folder under it, the folder itself, or anything outside it; - not a file put there after the question opened, or a listed file that was replaced, whose contents changed before the deletion check, or that could not be checked or deleted. On Linux, changes made through an already open handle after the check may still be lost. A file that cannot be restored to its original name is kept at a recovery path, which is reported. The row's bin and Delete selected use the same identity and contents checks. Afterwards the list, the count and the "only 256 of N" note update, a toast says how many went and how many were kept, and kept files are reported. **Recycle Bin.** The launcher has no Recycle Bin code, so the delete is permanent, like the existing deletes, and the dialog says it can't be undone. Adding the bin would change all three delete paths, so it isn't done here. **Text.** The NFC page's text isn't in the translation catalogs yet: none of its strings go through `Tr`. The new strings follow the page, and `scripts/translations.py` reports nothing new. **Other changes:** - `docs/nfc.md`'s *Deleting* and *Tests* sections, and the README's NFC paragraph and scene list, describe it. - `tools/screenshots` has three new scenes over 300 fake tags: `nfc`, `nfc-delete-all` and `nfc-deleted-all`. - `test_launcher_core.py`'s `--strict` line names the new app-level check. **Other PRs.** #202 (the redesign) changes `NfcView.axaml`, `NfcViewModel.cs` and `docs/nfc.md`, but not the Delete button's lines. It's already not mergeable against main, so whichever lands second needs a small merge. ## Testing - **New check:** `tests/launcher_app/Program.cs`, `NfcDeleteAll`. It runs over fake tags in a temp folder, through `LONGSHOT_NFC_DIR`; no real dump is used. The folder holds 257 tags, one `.nfc` that isn't a dump, a `key_` file, a `.txt`, a subfolder with a `.bin`, and a `.bin` beside the folder. It checks: - the question opens first, says how many, and *Keep them* keeps every file; - *Delete all* deletes the unchanged listed files, and keeps and reports replaced files, including one with identical contents, as well as keeping a file added after the question, the `key_` file, the `.txt`, the subfolder's file, the file outside and the folder itself; - `Rows`, `Count`, `TooMany` and `TooManyText` are raised, and the command's `CanExecuteChanged` fires; - with one file left it asks by name with the Delete all warnings, and with an empty list the button is off and asks nothing. - **It fails on main:** main has no `DeleteAllCommand`, so the check doesn't compile there. On this branch it passes. - **`dotnet build LongshotLauncher.slnx -c Release`:** 0 warnings, 0 errors. - **`python -I tests/test_launcher_core.py`** on Windows 11 stops at `SavesChecks`' "A link whose shared save folder is gone" (a Windows symlink case), the same way on unchanged main. This PR doesn't touch `tests/launcher_core/`. `--strict --longshot` at the pinned commit stops earlier, on `ShaderCaches.cs`' names against the pinned `dev_packs.py`, also the same on main. CI's Linux run covers both. - **`LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py`:** 3 failures, `test_the_bump`, `test_the_next_stable` and `test_check_tag_against_the_published_releases`. They fail the same way on unchanged main (#236 saw the same). - **`python -I scripts/translations.py`:** the same report as main, with the same texts missing from the catalogs and none new. - **Screenshots** (`tools/screenshots`, Windows 11, headless): 300 fake tags made in each scene's own temporary NFC folder. The scenes use the real window, view model and dialog, and `nfc-deleted-all` actually deletes the 300 files. The folder path on *Open the folder* is blurred. They're in the first comment: the page on main, the page with Delete all, the question, and the page after. **Not tested:** - **Clicked by hand in the running launcher.** The screens were driven headless through the real window and bindings, not with a mouse in a live window. - **Linux.** Only Windows here. Deletion uses platform-specific code, and the new check uses the `Platform.Linux` launcher the app checks already use. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(nfc): Delete all on the NFC page, asked first with how many go
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
74302780ff
A player with hundreds of dumps (the game lists only 256) had to tick every row to clear the page. Delete all, under
Delete selected, asks first ("Delete all 300 NFC tags?", can't be undone, a scanned tag is kept only here), then deletes
the .bin and .nfc files the list showed, nothing else in or outside the NFC folder. Off with an empty list and while files
are being added. tests/launcher_app checks it over fake tags; tools/screenshots gains the nfc scenes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Screenshots from tools/screenshots (Windows 11, headless), over 300 fake tags in each scene's own temporary NFC folder. The folder path on Open the folder is blurred.

Before (main), scene nfc: only Delete selected.
The NFC page on main

After, nfc: Delete all under Delete selected.
The NFC page with Delete all

nfc-delete-all: the question, with how many go.
Delete all 300 NFC tags?

nfc-deleted-all: after Delete all. The list is empty, the 256 note is gone, and both delete buttons are off.
The NFC page after Delete all

Screenshots from `tools/screenshots` (Windows 11, headless), over 300 fake tags in each scene's own temporary NFC folder. The folder path on *Open the folder* is blurred. **Before (main), scene `nfc`:** only Delete selected. ![The NFC page on main](https://git.magicbean.dev/attachments/2afcf0cb-53d0-4c9a-8912-a904b7dfe0e0) **After, `nfc`:** Delete all under Delete selected. ![The NFC page with Delete all](https://git.magicbean.dev/attachments/93866b1e-08c7-4f7a-9ed6-5973d2e72a05) **`nfc-delete-all`:** the question, with how many go. ![Delete all 300 NFC tags?](https://git.magicbean.dev/attachments/a268dd50-4e88-4c35-b89a-57da983f21ef) **`nfc-deleted-all`:** after *Delete all*. The list is empty, the 256 note is gone, and both delete buttons are off. ![The NFC page after Delete all](https://git.magicbean.dev/attachments/22f7ed74-56c1-4ce5-824c-3c6ccbb150e6)
llun changed title from WIP: feat(nfc): Delete all on the NFC page, asked first with how many go to feat(nfc): Delete all on the NFC page, asked first with how many go 2026-11-21 20:49:22 +00:00
Author
Member
@review
BeanBot left a comment

Recommendation: Request changes. Delete all can permanently delete a replacement file that was added after confirmation opened. Its single-file confirmation also omits the promised warning that deletion is permanent and a scanned tag may have no other copy.

The button clears the displayed NFC files in one operation and updates the page afterward. It reuses the existing deletion path, but that path identifies files only by name, so the confirmation does not reliably protect files added later.

@fix will do (2)

  1. L1 App/ViewModels/NfcViewModel.cs:351: The snapshot retains names, but deletion later resolves those names again. (more on the line)
  2. L2 App/ViewModels/NfcViewModel.cs:393: Setting All to false for one file also selects the old subtitle, which omits both the permanent-deletion warning and the warning that a scanned tag may exist only here. (more on the line)
More: does it help, other systems, switches, what was read

Does it help: Yes. The reported Windows headless run and app-level check demonstrate deleting 258 listed fake files and refreshing the page; Linux and live mouse interaction were not tested.

Other systems: The deletion path is shared by Windows and Linux. A concurrent game, scan, file manager, or other program can replace a listed name while the confirmation is open; the existing test covers only a newly added name. Screenshot scenes use isolated temporary folders.

Switches: None added, changed, or removed.

Reviewed: 74302780ff against d79fbcb0a5: Read the repository rules, commit and complete diff, NFC view model, deletion dialog, NFC core deletion path, app check and NFC documentation. Skimmed the remaining screenshot tool, test harness, README and related modal and drop handling. No review checklist or pull request template was found.; nothing run (a code review).

Checked and fine:

  • The command is disabled for an empty list and while an add is running, with change notifications on reload and add state changes.
  • The test data is generated as fake tags; the commit includes an AI-assistance trailer.
  • The existing deletion path filters key files and non-candidate names and deletes direct entries rather than traversing subfolders.

Testing: No commands that build or run project code were executed, as requested. The pull request reports a successful Windows build and app check; its other reported failures also occur on the base.

Overlaps and merge order: #202 also changes the NFC view, view model and documentation; whichever lands second will need conflict resolution.


Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** Delete all can permanently delete a replacement file that was added after confirmation opened. Its single-file confirmation also omits the promised warning that deletion is permanent and a scanned tag may have no other copy. The button clears the displayed NFC files in one operation and updates the page afterward. It reuses the existing deletion path, but that path identifies files only by name, so the confirmation does not reliably protect files added later. **`@fix` will do (2)** 1. **L1** `App/ViewModels/NfcViewModel.cs:351`: The snapshot retains names, but deletion later resolves those names again. (more on the line) 2. **L2** `App/ViewModels/NfcViewModel.cs:393`: Setting All to false for one file also selects the old subtitle, which omits both the permanent-deletion warning and the warning that a scanned tag may exist only here. (more on the line) <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The reported Windows headless run and app-level check demonstrate deleting 258 listed fake files and refreshing the page; Linux and live mouse interaction were not tested. **Other systems:** The deletion path is shared by Windows and Linux. A concurrent game, scan, file manager, or other program can replace a listed name while the confirmation is open; the existing test covers only a newly added name. Screenshot scenes use isolated temporary folders. **Switches:** None added, changed, or removed. **Reviewed:** 74302780ffe7 against d79fbcb0a517: Read the repository rules, commit and complete diff, NFC view model, deletion dialog, NFC core deletion path, app check and NFC documentation. Skimmed the remaining screenshot tool, test harness, README and related modal and drop handling. No review checklist or pull request template was found.; nothing run (a code review). **Checked and fine:** - The command is disabled for an empty list and while an add is running, with change notifications on reload and add state changes. - The test data is generated as fake tags; the commit includes an AI-assistance trailer. - The existing deletion path filters key files and non-candidate names and deletes direct entries rather than traversing subfolders. **Testing:** No commands that build or run project code were executed, as requested. The pull request reports a successful Windows build and app check; its other reported failures also occur on the base. **Overlaps and merge order:** #202 also changes the NFC view, view model and documentation; whichever lands second will need conflict resolution. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
@ -344,2 +349,3 @@
public void AskDelete(IReadOnlyList<NfcRowViewModel> rows, bool all = false)
{
if (rows.Count > 0) Main.Modal = new NfcDeleteViewModel(this, rows.Select(r => r.File).ToList());
if (rows.Count > 0) Main.Modal = new NfcDeleteViewModel(this, rows.Select(r => r.File).ToList(), all);
Member

L1: The snapshot retains names, but deletion later resolves those names again. If a listed tag is removed and another tag is saved under the same name while the question is open, confirming deletes the new file even though it was not the file shown when asked. Preserve and verify file identity or contents before deletion, skipping changed entries and reporting them; add a replacement-under-the-same-name test.

**L1**: The snapshot retains names, but deletion later resolves those names again. If a listed tag is removed and another tag is saved under the same name while the question is open, confirming deletes the new file even though it was not the file shown when asked. Preserve and verify file identity or contents before deletion, skipping changed entries and reporting them; add a replacement-under-the-same-name test.
@ -385,2 +390,4 @@
public NfcDeleteViewModel(NfcViewModel page, IReadOnlyList<NfcTagFile> files, bool all = false)
{
Files = files;
All = all && files.Count > 1;
Member

L2: Setting All to false for one file also selects the old subtitle, which omits both the permanent-deletion warning and the warning that a scanned tag may exist only here. A player using Delete all on their last scanned tag can therefore permanently lose its only copy without the warning promised for this action. Keep the single-file title and labels while retaining the Delete all safety text, and cover that case in the test.

**L2**: Setting All to false for one file also selects the old subtitle, which omits both the permanent-deletion warning and the warning that a scanned tag may exist only here. A player using Delete all on their last scanned tag can therefore permanently lose its only copy without the warning promised for this action. Keep the single-file title and labels while retaining the Delete all safety text, and cover that case in the test.
Author
Member
@fix
fix(nfc): protect changed files during deletion
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
ef43f25d6a
As the review on #239 asked.
BeanBot left a comment

Recommendation: Request changes. An unconfirmed replacement with identical contents can still be deleted, and a changed replacement can become inaccessible in a hidden directory on Linux. Both cases can lose a player's NFC file.

What @fix changed
I changed this pull request: the new head is ef43f25d6a. I edited its description to match the change.

Changed

  • Verify deletion snapshots: Core/NfcTags.cs:317 captures and compares file contents before deletion; changed or unreadable files are kept and reported. tests/launcher_app/Program.cs:98 covers replacement under the same name. Tests were not run, as requested.
  • Keep single-file Delete all warnings: App/ViewModels/NfcViewModel.cs:395 retains the Delete all safety text for one file while preserving its title and labels; tests/launcher_app/Program.cs:119 covers the warnings.
  • Protect confirmed NFC deletions from replacement races: Core/NfcTags.cs:330 verifies and deletes through the same Windows handle, with write and delete sharing denied. On Linux, deletion is declined because a conditional unlink cannot be guaranteed; App/ViewModels/NfcViewModel.cs:363 reports that files were kept and directs the player to the folder. Updated the app check for that fallback. No tests or builds were run.
  • Linux NFC deletion, Core/NfcTags.cs:349: Isolated each file before checking and deleting it, preserving replacements; restored the Linux deletion checks in tests/launcher_app/Program.cs:100. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

The launcher adds a confirmed Delete all action and reports files it could not delete. The identity and restoration protection remains incomplete for all three NFC deletion paths.

@fix will do (1)

  1. L4 Core/NfcTags.cs:348: Preserve the confirmed file's identity as well as its contents, and ensure an unconfirmed replacement remains accessible if its original name is taken during restoration. (more on the line)

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (5; not asked for, not blocking)
  • Files larger than 1 MiB are listed but kept by all three delete actions, with a report.
  • The PR description still says deletion uses NfcTags.Delete directly and that every listed file is deleted; snapshots can now cause files to be kept.
  • The README and NFC documentation still say the launcher deletes listed files without describing the Linux fallback.
  • The pull request description and its reported screenshots describe behavior before the latest safety fix.
  • Files larger than the snapshot limit are listed but cannot be deleted through the launcher.
More: does it help, other systems, switches, what was read

Does it help: Unproven: the reported Windows check predates the current fix commits, and CI has not run on this head. This is not a performance change.

Other systems: The snapshot deletion code also changes row and Delete selected behavior on Windows and Linux. Linux uses a private directory to isolate files; Windows verifies and deletes through one handle. Neither preserves the identity captured when the question opened.

Switches: No switches added, changed or removed.

Reviewed: ef43f25d6a against d79fbcb0a5: Read AGENTS.md, CONTRIBUTING.md, the diff, NFC core and view-model code, views and app check; skimmed documentation, screenshot tooling and test-runner changes. The full screenshot tool, test runner and README were not read.; nothing run (a code review).

Checked and fine:

  • Delete all uses the existing confirmation dialog and retains its warning for a single file.
  • The app check uses fake tags and covers a changed replacement and a file added after confirmation.

Testing: No commands from the project or tests were run. CI has not run on this head; the description reports earlier Windows runs and screenshots.

Overlaps and merge order: #202 also changes the NFC view, view model and documentation; the pull request says whichever lands second will need a merge.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** An unconfirmed replacement with identical contents can still be deleted, and a changed replacement can become inaccessible in a hidden directory on Linux. Both cases can lose a player's NFC file. **What `@fix` changed** I changed this pull request: the new head is ef43f25d6afe. I edited its description to match the change. **Changed** - **Verify deletion snapshots**: Core/NfcTags.cs:317 captures and compares file contents before deletion; changed or unreadable files are kept and reported. tests/launcher_app/Program.cs:98 covers replacement under the same name. Tests were not run, as requested. - **Keep single-file Delete all warnings**: App/ViewModels/NfcViewModel.cs:395 retains the Delete all safety text for one file while preserving its title and labels; tests/launcher_app/Program.cs:119 covers the warnings. - **Protect confirmed NFC deletions from replacement races**: Core/NfcTags.cs:330 verifies and deletes through the same Windows handle, with write and delete sharing denied. On Linux, deletion is declined because a conditional unlink cannot be guaranteed; App/ViewModels/NfcViewModel.cs:363 reports that files were kept and directs the player to the folder. Updated the app check for that fallback. No tests or builds were run. - **Linux NFC deletion, Core/NfcTags.cs:349**: Isolated each file before checking and deleting it, preserving replacements; restored the Linux deletion checks in tests/launcher_app/Program.cs:100. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. The launcher adds a confirmed Delete all action and reports files it could not delete. The identity and restoration protection remains incomplete for all three NFC deletion paths. **`@fix` will do (1)** 1. **L4** `Core/NfcTags.cs:348`: Preserve the confirmed file's identity as well as its contents, and ensure an unconfirmed replacement remains accessible if its original name is taken during restoration. (more on the line) **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (5; not asked for, not blocking)</summary> - Files larger than 1 MiB are listed but kept by all three delete actions, with a report. - The PR description still says deletion uses NfcTags.Delete directly and that every listed file is deleted; snapshots can now cause files to be kept. - The README and NFC documentation still say the launcher deletes listed files without describing the Linux fallback. - The pull request description and its reported screenshots describe behavior before the latest safety fix. - Files larger than the snapshot limit are listed but cannot be deleted through the launcher. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: the reported Windows check predates the current fix commits, and CI has not run on this head. This is not a performance change. **Other systems:** The snapshot deletion code also changes row and Delete selected behavior on Windows and Linux. Linux uses a private directory to isolate files; Windows verifies and deletes through one handle. Neither preserves the identity captured when the question opened. **Switches:** No switches added, changed or removed. **Reviewed:** ef43f25d6afe against d79fbcb0a517: Read AGENTS.md, CONTRIBUTING.md, the diff, NFC core and view-model code, views and app check; skimmed documentation, screenshot tooling and test-runner changes. The full screenshot tool, test runner and README were not read.; nothing run (a code review). **Checked and fine:** - Delete all uses the existing confirmation dialog and retains its warning for a single file. - The app check uses fake tags and covers a changed replacement and a file added after confirmation. **Testing:** No commands from the project or tests were run. CI has not run on this head; the description reports earlier Windows runs and screenshots. **Overlaps and merge order:** #202 also changes the NFC view, view model and documentation; the pull request says whichever lands second will need a merge. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
@ -316,0 +333,4 @@
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool GetFileInformationByHandleEx(SafeFileHandle file, int infoClass, out FileAttributeTagInfo info, uint size);
Member

L3: The contents check and path-based deletion are separate operations. If another process replaces a tag after Same returns but before Delete removes the path, confirmation deletes the replacement, potentially its only copy. Make verification and deletion safe against replacement, for example using suitable platform-specific handle or identity operations.

**L3**: The contents check and path-based deletion are separate operations. If another process replaces a tag after Same returns but before Delete removes the path, confirmation deletes the replacement, potentially its only copy. Make verification and deletion safe against replacement, for example using suitable platform-specific handle or identity operations.
Core/NfcTags.cs Outdated
@ -316,0 +345,4 @@
static extern int mkdir(string path, uint mode);
// Move the directory entry into a private directory on the same filesystem before checking it. A replacement at the
// original name cannot then be deleted by this operation. If it changed, put it back without overwriting a new entry.
Member

L4: The non-Windows guard makes every confirmed NFC deletion fail on Linux, including the previously working row and Delete selected actions. A Steam Deck player cannot remove even one tag through the launcher. Restore safe deletion on Linux while retaining protection against replacing the confirmed file.

**L4**: The non-Windows guard makes every confirmed NFC deletion fail on Linux, including the previously working row and Delete selected actions. A Steam Deck player cannot remove even one tag through the launcher. Restore safe deletion on Linux while retaining protection against replacing the confirmed file.
Author
Member
@fix
fix(nfc): preserve file identity during deletion
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
5392e73a6e
As the review on #239 asked.
BeanBot left a comment

Recommendation: Request changes. On Linux, a file can be modified after its contents are checked but before it is deleted, losing changes the confirmation promises to keep.

What @fix changed
I changed this pull request: the new head is 5392e73a6e. I edited its description to match the change.

Changed

  • Preserve confirmed file identity and recover replacements: Core/NfcTags.cs:318 retains file handles and checks identity and contents before deletion. Linux restores unconfirmed files under a free name or reports their recovery path. App/ViewModels/NfcViewModel.cs:355 releases snapshots and reports recovery locations; tests/launcher_app/Program.cs:96 covers identical replacements. Tests were not run, as requested.

Nothing was built or run: the checks run again on the new head.

Delete all adds a confirmation and clears listed NFC files in one action. The identity checks also change the existing row and selected-file delete paths; on Linux, concurrent writes can still be lost.

@fix will do (1)

  1. L5 Core/NfcTags.cs:449: On Linux, moving the file into quarantine does not prevent another process from writing through a handle it already opened. (more on the line)

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (8; not asked for, not blocking)
  • Files larger than 1 MiB are listed but kept by all three delete actions, with a report.
  • The PR description still says deletion uses NfcTags.Delete directly and that every listed file is deleted; snapshots can now cause files to be kept.
  • The README and NFC documentation still say the launcher deletes listed files without describing the Linux fallback.
  • The pull request description and its reported screenshots describe behavior before the latest safety fix.
  • Files larger than the snapshot limit are listed but cannot be deleted through the launcher.
  • The new identity and recovery paths have not yet been exercised in a reported run on this head.
  • Linux verification and a live mouse-driven launcher check remain unreported.
  • Opening a snapshot handle for every listed file can exhaust the process file descriptor limit for large collections, leaving the remaining files undeleted and reported as kept.
More: does it help, other systems, switches, what was read

Does it help: Unproven: the submitted Windows run predates the identity fix, and CI has not run on this head. The test covers confirmation, replacements and list updates, but not concurrent writes during deletion.

Other systems: Windows uses a handle that denies write and delete sharing during verification and deletion. Linux and Steam Deck use the quarantine path, which does not prevent writes through an already open handle. All three NFC delete paths use these checks.

Switches: None.

Reviewed: 5392e73a6e against d79fbcb0a5: Read the repository rules, commit list and diff; read Core/NfcTags.cs, the NFC view model and views, and the app-level test. Skimmed MainViewModel.cs, documentation, screenshot and Python test changes, and callers of the deletion code. The remaining changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The confirmation snapshots the listed names, and identical-content replacements are checked by file identity.
  • Key files and non-candidate extensions are excluded from the snapshot deletion path.

Testing: No commands that build or run code were executed. The author reports Windows tests and screenshots from before the latest fix; CI has not yet run on this head.

Overlaps and merge order: PR #202 also changes the NFC view, view model and documentation; the second PR to land will need a merge.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** On Linux, a file can be modified after its contents are checked but before it is deleted, losing changes the confirmation promises to keep. **What `@fix` changed** I changed this pull request: the new head is 5392e73a6e06. I edited its description to match the change. **Changed** - **Preserve confirmed file identity and recover replacements**: Core/NfcTags.cs:318 retains file handles and checks identity and contents before deletion. Linux restores unconfirmed files under a free name or reports their recovery path. App/ViewModels/NfcViewModel.cs:355 releases snapshots and reports recovery locations; tests/launcher_app/Program.cs:96 covers identical replacements. Tests were not run, as requested. Nothing was built or run: the checks run again on the new head. Delete all adds a confirmation and clears listed NFC files in one action. The identity checks also change the existing row and selected-file delete paths; on Linux, concurrent writes can still be lost. **`@fix` will do (1)** 1. **L5** `Core/NfcTags.cs:449`: On Linux, moving the file into quarantine does not prevent another process from writing through a handle it already opened. (more on the line) **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (8; not asked for, not blocking)</summary> - Files larger than 1 MiB are listed but kept by all three delete actions, with a report. - The PR description still says deletion uses NfcTags.Delete directly and that every listed file is deleted; snapshots can now cause files to be kept. - The README and NFC documentation still say the launcher deletes listed files without describing the Linux fallback. - The pull request description and its reported screenshots describe behavior before the latest safety fix. - Files larger than the snapshot limit are listed but cannot be deleted through the launcher. - The new identity and recovery paths have not yet been exercised in a reported run on this head. - Linux verification and a live mouse-driven launcher check remain unreported. - Opening a snapshot handle for every listed file can exhaust the process file descriptor limit for large collections, leaving the remaining files undeleted and reported as kept. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: the submitted Windows run predates the identity fix, and CI has not run on this head. The test covers confirmation, replacements and list updates, but not concurrent writes during deletion. **Other systems:** Windows uses a handle that denies write and delete sharing during verification and deletion. Linux and Steam Deck use the quarantine path, which does not prevent writes through an already open handle. All three NFC delete paths use these checks. **Switches:** None. **Reviewed:** 5392e73a6e06 against d79fbcb0a517: Read the repository rules, commit list and diff; read Core/NfcTags.cs, the NFC view model and views, and the app-level test. Skimmed MainViewModel.cs, documentation, screenshot and Python test changes, and callers of the deletion code. The remaining changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The confirmation snapshots the listed names, and identical-content replacements are checked by file identity. - Key files and non-candidate extensions are excluded from the snapshot deletion path. **Testing:** No commands that build or run code were executed. The author reports Windows tests and screenshots from before the latest fix; CI has not yet run on this head. **Overlaps and merge order:** PR #202 also changes the NFC view, view model and documentation; the second PR to land will need a merge. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
@ -316,0 +446,4 @@
File.Move(path, held);
moved = true;
using var stream = OpenSnapshotFile(held);
if (stream == null || !SameIdentity(snapshot.Stream.SafeFileHandle, stream.SafeFileHandle) || !SameContents(stream, snapshot.Bytes)) return false;
Member

L5: On Linux, moving the file into quarantine does not prevent another process from writing through a handle it already opened. If it writes after SameContents returns and before File.Delete, the changed file is deleted despite the promise to keep it. Preserve the file when concurrent modification cannot be ruled out, or use a deletion approach that protects the checked contents through deletion.

**L5**: On Linux, moving the file into quarantine does not prevent another process from writing through a handle it already opened. If it writes after SameContents returns and before File.Delete, the changed file is deleted despite the promise to keep it. Preserve the file when concurrent modification cannot be ruled out, or use a deletion approach that protects the checked contents through deletion.
Author
Member
@fix
fix(nfc): keep files when Linux deletion cannot prevent writes
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
58d5f1597c
As the review on #239 asked.
BeanBot left a comment

Recommendation: Approve. Delete all has a confirmation and keeps files that fail its identity or content checks. The remaining Linux concurrent-write risk is disclosed in the confirmation. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 58d5f1597c. I edited its description to match the change.

Changed

  • Linux concurrent writes during deletion, Core/NfcTags.cs:431: The launcher now keeps requested files on Linux because an open handle can still modify them. The NFC page reports the reason, the documentation explains the fallback, and the app check covers a file with an open writer. Tests were not run, as requested.
  • Linux NFC deletion, Core/NfcTags.cs:436: Restored deletion through an isolated entry with identity and content checks and recovery reporting. The confirmation warns Linux users that concurrent changes may be lost; updated the app check and documentation. Builds and tests were not run as instructed.

Nothing was built or run: the checks run again on the new head.

Players can clear the NFC list in one operation instead of selecting each row. The change adds platform-specific deletion checks and reports files it keeps.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (12; not asked for, not blocking)
  • Files larger than 1 MiB are listed but kept by all three delete actions, with a report.
  • The PR description still says deletion uses NfcTags.Delete directly and that every listed file is deleted; snapshots can now cause files to be kept.
  • The README and NFC documentation still say the launcher deletes listed files without describing the Linux fallback.
  • The pull request description and its reported screenshots describe behavior before the latest safety fix.
  • Files larger than the snapshot limit are listed but cannot be deleted through the launcher.
  • The new identity and recovery paths have not yet been exercised in a reported run on this head.
  • Linux verification and a live mouse-driven launcher check remain unreported.
  • Opening a snapshot handle for every listed file can exhaust the process file descriptor limit for large collections, leaving the remaining files undeleted and reported as kept.
  • The pull request description still says Linux can delete verified files and describes a recovery path, while the current implementation keeps every requested file.
  • The pull request description says changed files are kept without stating the Linux concurrent-write exception.
  • The app check has not yet been reported running on Linux, where deletion uses a separate implementation.
  • Files over the snapshot size limit and symbolic links are kept even when listed.
More: does it help, other systems, switches, what was read

Does it help: Yes. The reported Windows app check and screenshots show deletion of fake tags and the resulting list update; Linux execution on this head remains unverified.

Other systems: The row and selected-file delete paths share the new checks. Linux uses an isolated directory entry and warns about writes through open handles; Windows uses a handle that denies write and delete sharing. The description reports Windows testing, but no Linux run.

Switches: None.

Reviewed: 58d5f1597c against d79fbcb0a5: Read the repository rules, full diff, NFC core and app test, and the relevant view-model and view code. Skimmed the remaining changed documentation, screenshot tooling, test runner and recorded results; the combined output for some larger files was truncated. No pull request template or review checklist was present at the named paths.; nothing run (a code review).

Checked and fine:

  • The Linux warning applies to Delete all, selected files and row deletion.
  • The confirmation lists at most eight names and snapshots the files before deletion.
  • The described screenshots use fake tags, consistent with the repository's data rules.

Testing: No commands that build or run project code were executed. CI has not yet run on this head; the description reports a Windows build and app check, with other reported failures also present on main.

Overlaps and merge order: #202 overlaps the NFC view, view model and documentation; the description says whichever lands second will need a small merge.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** Delete all has a confirmation and keeps files that fail its identity or content checks. The remaining Linux concurrent-write risk is disclosed in the confirmation. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 58d5f1597c57. I edited its description to match the change. **Changed** - **Linux concurrent writes during deletion, Core/NfcTags.cs:431**: The launcher now keeps requested files on Linux because an open handle can still modify them. The NFC page reports the reason, the documentation explains the fallback, and the app check covers a file with an open writer. Tests were not run, as requested. - **Linux NFC deletion, Core/NfcTags.cs:436**: Restored deletion through an isolated entry with identity and content checks and recovery reporting. The confirmation warns Linux users that concurrent changes may be lost; updated the app check and documentation. Builds and tests were not run as instructed. Nothing was built or run: the checks run again on the new head. Players can clear the NFC list in one operation instead of selecting each row. The change adds platform-specific deletion checks and reports files it keeps. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (12; not asked for, not blocking)</summary> - Files larger than 1 MiB are listed but kept by all three delete actions, with a report. - The PR description still says deletion uses NfcTags.Delete directly and that every listed file is deleted; snapshots can now cause files to be kept. - The README and NFC documentation still say the launcher deletes listed files without describing the Linux fallback. - The pull request description and its reported screenshots describe behavior before the latest safety fix. - Files larger than the snapshot limit are listed but cannot be deleted through the launcher. - The new identity and recovery paths have not yet been exercised in a reported run on this head. - Linux verification and a live mouse-driven launcher check remain unreported. - Opening a snapshot handle for every listed file can exhaust the process file descriptor limit for large collections, leaving the remaining files undeleted and reported as kept. - The pull request description still says Linux can delete verified files and describes a recovery path, while the current implementation keeps every requested file. - The pull request description says changed files are kept without stating the Linux concurrent-write exception. - The app check has not yet been reported running on Linux, where deletion uses a separate implementation. - Files over the snapshot size limit and symbolic links are kept even when listed. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes. The reported Windows app check and screenshots show deletion of fake tags and the resulting list update; Linux execution on this head remains unverified. **Other systems:** The row and selected-file delete paths share the new checks. Linux uses an isolated directory entry and warns about writes through open handles; Windows uses a handle that denies write and delete sharing. The description reports Windows testing, but no Linux run. **Switches:** None. **Reviewed:** 58d5f1597c57 against d79fbcb0a517: Read the repository rules, full diff, NFC core and app test, and the relevant view-model and view code. Skimmed the remaining changed documentation, screenshot tooling, test runner and recorded results; the combined output for some larger files was truncated. No pull request template or review checklist was present at the named paths.; nothing run (a code review). **Checked and fine:** - The Linux warning applies to Delete all, selected files and row deletion. - The confirmation lists at most eight names and snapshots the files before deletion. - The described screenshots use fake tags, consistent with the repository's data rules. **Testing:** No commands that build or run project code were executed. CI has not yet run on this head; the description reports a Windows build and app check, with other reported failures also present on main. **Overlaps and merge order:** #202 overlaps the NFC view, view model and documentation; the description says whichever lands second will need a small merge. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
@ -316,0 +435,4 @@
// already open handle can still change it after the check; the confirmation warns about that on Linux.
static bool DeleteSnapshotLinux(string folder, string name, DeletionSnapshot snapshot, out string? recovery)
{
recovery = null;
Member

L6: The unconditional non-Windows return makes all three NFC delete actions fail on Linux, even for an unchanged file with no writer. Restore a usable Linux deletion flow that preserves files when concurrent modification cannot be ruled out, or provide an explicitly confirmed alternative that lets players delete them.

**L6**: The unconditional non-Windows return makes all three NFC delete actions fail on Linux, even for an unchanged file with no writer. Restore a usable Linux deletion flow that preserves files when concurrent modification cannot be ruled out, or provide an explicitly confirmed alternative that lets players delete them.
fix(nfc): a tidier NFC page: one line under the title, the 256 note a chip by the count, the footer's note under the folder
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 14s
dc2393f544
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner

Tidied the NFC page (dc2393f): the header is one short line, the "only 256 of 300" paragraph above the list is now a chip by the count (the full explanation is its tooltip), and the footer note that cut into the list moved under Open the folder, so the list runs to the bottom. The two delete buttons sit under a DELETE label.

Updated screenshots (tools/screenshots, Linux, headless, 300 fake tags; these replace the ones in the first comment):

The NFC page
Delete all, asked first
After Delete all

python -I tests/test_launcher_core.py: 2656 checks passed. tests/launcher_app (with NfcDeleteAll): passes.

Tidied the NFC page (dc2393f): the header is one short line, the "only 256 of 300" paragraph above the list is now a chip by the count (the full explanation is its tooltip), and the footer note that cut into the list moved under *Open the folder*, so the list runs to the bottom. The two delete buttons sit under a DELETE label. Updated screenshots (`tools/screenshots`, Linux, headless, 300 fake tags; these replace the ones in the first comment): ![The NFC page](https://git.magicbean.dev/attachments/3372e2a8-1373-41b5-84cc-a46c1031f4db) ![Delete all, asked first](https://git.magicbean.dev/attachments/c87c9e78-a57a-4e82-9274-40112e03a81a) ![After Delete all](https://git.magicbean.dev/attachments/3b8d880c-675e-4f1e-b8e5-2e8706abc1b4) `python -I tests/test_launcher_core.py`: 2656 checks passed. `tests/launcher_app` (with `NfcDeleteAll`): passes.
Owner

024597744: the tag list now scrolls inside its card, so the card ends with its own rounded edge instead of being cut off mid-row at the bottom, and the add buttons grow to fit a two-line hint (Scan a tag…'s hint overflowed its fixed 56px height). Screenshots replace the ones above:

The NFC page
Delete all, asked first
After Delete all

test_launcher_core.py: 2656 checks passed; tests/launcher_app: passes.

024597744: the tag list now scrolls inside its card, so the card ends with its own rounded edge instead of being cut off mid-row at the bottom, and the add buttons grow to fit a two-line hint (*Scan a tag…*'s hint overflowed its fixed 56px height). Screenshots replace the ones above: ![The NFC page](https://git.magicbean.dev/attachments/0a899912-45c7-4596-9b5a-73eb65131841) ![Delete all, asked first](https://git.magicbean.dev/attachments/2affb312-d916-4d6a-bfc7-a45dfe04a49c) ![After Delete all](https://git.magicbean.dev/attachments/c56bf399-a2a6-462f-908c-b4a3c2c0957c) `test_launcher_core.py`: 2656 checks passed; `tests/launcher_app`: passes.
fix(nfc): the tag list scrolls inside its card, which keeps its bottom edge, and the add buttons grow to fit a wrapped hint
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 11s
024597744d
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner

4391c72f3: Scan a tag…'s hint when scanning is off ("Windows only, with a controller over USB") now fits on one line, so the button no longer looks cramped at the bottom. Updated page:

The NFC page

4391c72f3: *Scan a tag…*'s hint when scanning is off ("Windows only, with a controller over USB") now fits on one line, so the button no longer looks cramped at the bottom. Updated page: ![The NFC page](https://git.magicbean.dev/attachments/f1cfa80b-d1eb-408d-bd85-585f2840d32b)
nfc.png
100 KiB
fix(nfc): Scan a tag's off hint fits on one line, like the other add buttons'
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 5s
4391c72f38
Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch feat/nfc-delete-all 2026-11-21 21:26:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!239
No description provided.