Skip to content

Code Quality: Reduce duplicated functionality classes #14572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
14 of 30 tasks
0x5bfa opened this issue Jan 29, 2024 · 2 comments
Open
14 of 30 tasks

Code Quality: Reduce duplicated functionality classes #14572

0x5bfa opened this issue Jan 29, 2024 · 2 comments

Comments

@0x5bfa
Copy link
Member

0x5bfa commented Jan 29, 2024

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

  • IAppThemeModeService
  • IAppThreadingService
  • IAppUpdateNoneService
  • IAppUpdateSideloadService
  • 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

  • IStorageArchiveService
  • IStorageCacheService
  • 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

  • IWindowsCompatibilityService
  • IWindowsDialogService
  • IWindowsIniService
  • IWindowsJumpListService
  • IWindowsStartMenuService
  • 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 0x5bfa self-assigned this Jan 29, 2024
@yaira2
Copy link
Member

yaira2 commented Jan 29, 2024

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

@yaira2 yaira2 moved this to 🔖 Ready to build in Files task board Jan 29, 2024
@yaira2
Copy link
Member

yaira2 commented Jan 29, 2024

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

@0x5bfa 0x5bfa changed the title Code Quality: Duplicated functionality classes Code Quality: Reduce duplicated functionality classes & Introduce IWatcher May 15, 2024
@0x5bfa 0x5bfa changed the title Code Quality: Reduce duplicated functionality classes & Introduce IWatcher Code Quality: Reduce duplicated functionality classes May 18, 2024
@Josh65-2201 Josh65-2201 moved this from 🔖 Ready to build to 🏗 In progress in Files task board Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants