How msmsrep/parallelscope works
Purpose and Runtime
ParallelScope is a Windows WPF desktop file browser for multiple configured root folders. It presents a folder tree and file list, supports navigation and search, and maintains a local SQLite cache for faster listings/searches. It targets net10.0-windows10.0.19041.0; startup is defined by App.xaml and App.xaml.cs.
UI Entry Points and Composition
MainWindow.xaml is the primary browsing shell, with code-behind in MainWindow.xaml.cs. SettingsWindow.xaml provides root-folder and display-column configuration, backed by SettingsWindow.xaml.cs. UI behavior is predominantly organized through ViewModels/MainWindowViewModel.cs, rather than the views themselves.
Main Browser State and Navigation
MainWindowViewModel is split by responsibility: navigation/history and direct paths in ViewModels/MainWindowViewModel.Navigation.cs; file-list state in ViewModels/MainWindowViewModel.FileItems.cs; and tree/flat “All Files” presentation in ViewModels/MainWindowViewModel.FlatView.cs. Item-level UI representations distinguish files and folders through ViewModels/FileItemViewModel.cs and ViewModels/FolderItemViewModel.cs.
Scan, Cache, and Search Flow
Browsing and search first use the local cache, with live filesystem scanning as fallback when cache search has no matches. Scanning orchestration lives in ViewModels/MainWindowViewModel.Scanning.cs; search behavior, including incremental search, is in ViewModels/MainWindowViewModel.Search.cs; cache-specific view-model coordination is in ViewModels/MainWindowViewModel.Cache.cs. Results cross a boundary from filesystem paths to cached entities, then to file/folder view models for binding.
Persistence and Filesystem Boundaries
Settings are persisted as local JSON through Data/AppSettingsRepository.cs and modeled by Data/AppSettings.cs. Cached filesystem metadata is represented by Data/FileSystemEntryEntity.cs and accessed through Data/FileCacheRepository.cs. EF Core owns SQLite persistence via Data/ParallelScopeDbContext.cs, with schema evolution captured in Migrations/. Local-state path resolution is centralized in Utilities/AppDataPathProvider.cs; path normalization and availability checks isolate filesystem edge cases in Utilities/PathNormalizer.cs and Utilities/DirectoryAvailabilityChecker.cs.
Platform and Store Integration
The app opens files using Windows-default behavior and obtains shell icons through Utilities/WindowsShellIconProvider.cs. Microsoft Store subscription/license state gates the Plus-only display-column customization feature through Services/StoreLicenseService.cs; billing and payment remain Microsoft Store responsibilities. Deployment metadata is in AppxManifest.xml, while theme/version behavior is encapsulated by Utilities/AppTheme.cs and Utilities/AppVersionProvider.cs.
Main entry points: MainWindowViewModel.cs Main window view model · MainWindowViewModel.Scanning.cs Scan orchestration · FileCacheRepository.cs File cache repository · MainWindowViewModel.Search.cs Incremental search
Components 20
WPF UI
- Application startup · Initializes the Windows desktop runtime.
App.xaml - Browser shell
MainWindow.xaml - Settings window
SettingsWindow.xaml
Browser state
- Main window view model · Coordinates browsing, scanning, cache, and search behavior.
ViewModels/MainWindowViewModel.cs - Navigation and history
ViewModels/MainWindowViewModel.Navigation.cs - File-list state
ViewModels/MainWindowViewModel.FileItems.cs - All Files view
ViewModels/MainWindowViewModel.FlatView.cs - Scan orchestration · Falls back to live filesystem enumeration.
ViewModels/MainWindowViewModel.Scanning.cs - Incremental search · Queries cache before triggering a scan fallback.
ViewModels/MainWindowViewModel.Search.cs - Cache coordination
ViewModels/MainWindowViewModel.Cache.cs - File and folder items · Binding representations for files and folders.
ViewModels/FileItemViewModel.cs
Local persistence
- Settings repository
Data/AppSettingsRepository.cs - Application settings · Configured roots and display-column preferences.
Data/AppSettings.cs - File cache repository
Data/FileCacheRepository.cs - Filesystem cache entry
Data/FileSystemEntryEntity.cs - SQLite cache database · Schema changes are maintained in Migrations/.
Data/ParallelScopeDbContext.cs
Windows and Store
- Filesystem path boundary · Resolves local state and normalizes or validates filesystem paths.
Utilities/AppDataPathProvider.cs - Windows shell integration · Supplies shell icons while Windows opens files by default association.
Utilities/WindowsShellIconProvider.cs - Store license gate · Controls Plus-only display-column customization.
Services/StoreLicenseService.cs - Package manifest
AppxManifest.xml
Connections 25
- Application startup → Browser shell: opens
- Application startup → Package manifest: packaged by
- Browser shell → Main window view model: binds to
- Settings window → Settings repository: loads and saves
- Settings window → Store license gate: checks Plus feature
- Main window view model → Navigation and history: composes
- Main window view model → File-list state: composes
- Main window view model → All Files view: composes
- Main window view model → Scan orchestration: orchestrates
- Main window view model → Incremental search: orchestrates
- Main window view model → Cache coordination: coordinates
- Navigation and history → File-list state: selects location
- Incremental search → Cache coordination: queries first
- Incremental search → Scan orchestration: falls back on no matches
- Cache coordination → File cache repository: reads and writes
- Scan orchestration → Filesystem path boundary: enumerates validated paths
- Scan orchestration → File cache repository: caches metadata
- File cache repository → Filesystem cache entry: maps
- File cache repository → SQLite cache database: persists through
- SQLite cache database → Filesystem path boundary: uses local data path
- Settings repository → Application settings: serializes
- Settings repository → Filesystem path boundary: uses local data path
- File-list state → File and folder items: presents
- All Files view → File and folder items: presents
- File and folder items → Windows shell integration: gets icons