Files icon indicating copy to clipboard operation
Files copied to clipboard

Code Quality: Reduce duplicated functionality classes

Open 0x5bfa opened this issue 2 years ago • 2 comments

Description

I'm planning to remove Utils namespace by moving classes to service or Files.App.Storage. Providing a single, simple and common way of accessing the application functionalities allows us to implement unit tests easily as well as enables us to maintain codes easily.

Services.App

  • [x] IAppThemeModeService
  • [x] IAppThreadingService
  • [x] IAppUpdateNoneService
  • [x] IAppUpdateSideloadService
  • [x] IAppUpdateStoreService
  • [ ] IAppResourcesService
    • (extension) AppThemeResourcesHelper
  • [ ] IAppDialogService
    • (helper) DialogDisplayService
    • (helper) UIHelper
    • (helper) DynamicDialogHelper
    • Remarks: Convert all ContentDialogs into Pages and move them to the Views namespace. The service shall have methods for every dialog to display (e.g. ShowComfirmEmptyBinDialog and ShowFileInUseDialog) instead of instancing ContentDialogs. Also all dialogs that need user interaction should have each view models. Note that some dialog contents use their own 'PrimaryButton' in the contents instead of ContentDialog's one.
  • [ ] IAppNavigationService
    • (helper) MultitaskingTabsHelpers
    • (helper) NavigationHelpers

Files.Integrations

  • [ ] IFileTagsService
    • (helper) FileTagsHelper
    • (watcher) FileTagsManager
    • (service) FileTagsService
    • (context) FileTagsContext
    • (item) FileTagItem
    • (item) TagsListItem
    • (item) TaggedFile
    • (utility) FileTagsDatabase
  • [ ] IGitService
    • (helper) GitHelpers

Services.Storages

Almost all of them should be heavily discussed ahead of time since they are related to the SAL (Storage Abstraction Layer). For more information, refer to #8974

  • [x] IStorageArchiveService
  • [x] IStorageCacheService
  • [x] IStorageNetworkService
  • [ ] IStorageLinkService
    • (helper) UIFilesystemHelper (partial)
  • [ ] IStorageOperationService
    • (utility) FileOperationsHelpers
    • (utility) FilesystemHelpers
    • (utility) FilesystemOperations
    • (utility) IFilesystemHelpers
    • (utility) IFilesystemOperations
    • (utility) ShellFilesystemOperations
    • (utility) ShellFileOperations2
  • [ ] IStorageEnumerationService
    • (utility) UniversalStorageEnumerator
    • (utility) Win32StorageEnumerator
  • [ ] IStorageCalculationService
    • (utility) FileSizeCalculator
  • [ ] IStorageDevicesService
    • (service) RemovableDrivesService
    • (watcher) DrivesViewModel
    • (watcher) DeviceManager
    • (watcher) WindowsStorageDeviceWatcher & IStorageDeviceWatcher
    • (helper) DriveHelpers
    • (utility) RemovableDevice

Services.Windows

  • [x] IWindowsCompatibilityService
  • [x] IWindowsDialogService
  • [x] IWindowsIniService
  • [x] IWindowsJumpListService
  • [x] IWindowsStartMenuService
  • [x] IWindowsRecycleBinService
    • (helper) RecycleBinHelpers
    • (watcher) RecycleBinManager
  • [ ] IWindowsQuickAccessService
    • (service) QuickAccessService
    • (watcher) QuickAccessManager
    • (utility) PinnedFoldersManager
  • [ ] IWindowsLibraryService
    • (watcher) LibraryManager
  • [ ] IWindowsWSLService
    • (watcher) WSLDistroManager
  • [ ] IWindowsTaskbarService
    • (utility) SystemTrayIcon
    • (window proc) SystemTrayIconWindow
  • [ ] IWindowsShellService
    • (item) ContextMenu, Win32ContextMenu
    • (item) ContextMenuItem, Win32ContextMenuItem
    • (helper) ShellFolderExtensions
    • (utility) ShellLibraryEx
    • (utility) ShellLibraryFolders
    • (helper) ShellNewMenuHelper
    • (item) ShellFileItem
    • (item) ShellLibraryItem
    • (item) ShellNewEntry

Classes to Remove

  • [ ] Move to HomeViewModel
    • (helper) WidgetsHelpers

Gains

  • Better maintainability
  • Reduced duplicated classes
  • Better test experience when we are going to implement Unit tests.

Requirements

  • Use single service per a functionality

Comments

No response

0x5bfa avatar Jan 29 '24 00:01 0x5bfa

This looks like a good breakdown, let's split each task into a separate PR for quality and code review purposes.

yaira2 avatar Jan 29 '24 00:01 yaira2

If someone plans to work on a specific service, please add a comment so we can prevent duplicate PRs.

yaira2 avatar Jan 29 '24 00:01 yaira2

Working on IWindowsJumpListService.

0x5bfa avatar Apr 10 '24 14:04 0x5bfa

Working on IAppThemeModeService.

0x5bfa avatar Apr 10 '24 15:04 0x5bfa

Working on INetworkDrivesService.

0x5bfa avatar Apr 11 '24 01:04 0x5bfa

Working on IStorageCacheService.

0x5bfa avatar Apr 13 '24 01:04 0x5bfa

Working on IWindowsQuickAccessService and IWindowsLibraryService.

0x5bfa avatar Apr 16 '24 20:04 0x5bfa

Working on IWSLDrivesService.

0x5bfa avatar Apr 19 '24 17:04 0x5bfa

Working on IStorageArchiveService.

0x5bfa avatar May 09 '24 00:05 0x5bfa