Skip to content

Code Quality: ShellViewModel Windows code isolated (P4-E) - #73

Merged
MemerGamer merged 1 commit into
linux/mainfrom
linux/p4-e
Oct 5, 2026
Merged

MemerGamer merged 1 commit into
linux/mainfrom
linux/p4-e

Conversation

@MemerGamer

Copy link
Copy Markdown
Owner

Resolved / Related Issues

Phase 4 work package P4-E (docs/linux-port/PLAN.md, Phase 4 plan Revision 3). No issue.

What changed

  • ViewModels/ShellViewModel.Windows.cs (new, excluded on desktop by the *.Windows.cs glob): the FindFirstFileEx/StorageFolder enumeration (EnumerateWindowsFolderAsync, the former #else body), EnumFromStorageFolderAsync, the ReadDirectoryChangesW/StorageQuery/FileSystemWatcher watchers and their queues, WatchForStorageFolderChangesAsync, AddFileOrFolderAsync(string), AddFileOrFolderFromShellFile, the Recycle Bin shell-item handlers, the BitLocker prompt, ADS listing and the SFGAO drive-capacity block. Moved verbatim; the ADS and SFGAO blocks became bodies of partial void methods, so Linux needs no #if.
  • ShellViewModel.cs: 3720 to about 2810 lines. The Win32 usings are gone, and the Windows-only switch cases and Recycle Bin subscriptions are wrapped in #if WINDOWS. LINUX-TODO(props) marks GetExtraProperties and CheckCloudDriveSyncStatusAsync.
  • ShellViewModel.Linux.cs: archive roots and folders inside archives are listed through IStorableResolver → ArchiveFolder/ArchiveEntryFile. The listing is read-only, has no watcher, and handles password dismissal. The location is kept as currentStorable (StorableWithPath). currentStorageFolder stays StorageFolderWithPath, because the Windows enumeration and StorageFileExtensions take that type; on Linux it is always null.
  • NavigationHelpers.Linux.cs: you can now open a folder inside an archive (it navigates). Opening files inside an archive shows the open-failed dialog (LINUX-TODO(archives)). The archive file itself still opens with its default application.
  • Compat-off baseline goes from 3 keys to 2 (only ContextMenu.cs and WidgetRecentItem.cs are left). A probe that stubbed those two showed no errors left in ShellViewModel.

Unchanged: the incremental watcher (FolderChangeBatch, TryApplyIncrementalDisplayChanges) and the trash view.

Steps used to test these changes

  1. dotnet build src/Files.App -f net10.0-desktop: 0 errors.
  2. Platform tests: 864 passed, 7 skipped, 0 failed.
  3. scripts/linux/compat-off-check.sh: no new keys; ratcheted with --update.
  4. Headless smoke test (headless-run.sh, showcase drives and seed). Each step passed: browse Documents; copy summary.txt into Reports; move todo.txt into Notes; trash readme.txt; restore it from the Recycle Bin; browse into Projects.zip (via the address bar) and into its Projects folder; exec touch/rm in Documents (the item appears and then disappears); search "inventory"; Properties of the result. The files on disk were checked afterwards.
  5. The Windows target can't be built on this machine.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY

Move the FindFirstFileEx/StorageFolder enumeration, ReadDirectoryChangesW
watchers, alternate data streams, Recycle Bin shell items and BitLocker
prompt verbatim into ShellViewModel.Windows.cs. Linux lists archive roots
and folders through IStorableResolver/ArchiveFolder (read-only, no
watcher) and can navigate into folders inside an archive. Ratchet the
compat-off baseline to 2 keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY
@MemerGamer
MemerGamer merged commit 473e711 into linux/main Oct 5, 2026
4 of 5 checks passed
@MemerGamer
MemerGamer deleted the linux/p4-e branch October 5, 2026 20:29
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.

1 participant