Skip to content
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

Code Quality: Move some ViewModel classes into the appropriate namespaces #12342

Merged
merged 5 commits into from
May 16, 2023

Conversation

0x5bfa
Copy link
Member

@0x5bfa 0x5bfa commented May 12, 2023

Description

The first step to clean up ViewModels.

Motivation and Context

PR Checklist

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Related Code Quality: Continued work to clean up entire project #12340
  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?

Screenshots

None

@0x5bfa 0x5bfa marked this pull request as ready for review May 12, 2023 14:08
@0x5bfa 0x5bfa changed the title Code Quality: Move some ViewModel classes to in appropriate namespaces Code Quality: Move some ViewModel classes into the appropriate namespaces May 12, 2023
Copy link
Contributor

@ferrariofilippo ferrariofilippo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing seems to miss, but still there are some style-related changes that you should consider

src/Files.App/Data/Models/ColumnsViewModel.cs Show resolved Hide resolved
src/Files.App/Data/Models/ColumnViewModel.cs Show resolved Hide resolved
src/Files.App/Data/Models/ColumnViewModel.cs Show resolved Hide resolved
src/Files.App/Data/Models/ColumnViewModel.cs Show resolved Hide resolved
src/Files.App/Data/Models/ColumnViewModel.cs Show resolved Hide resolved
src/Files.App/Data/Items/StatusBanner.cs Show resolved Hide resolved
src/Files.App/Data/Items/StatusBanner.cs Show resolved Hide resolved
src/Files.App/Data/Items/StatusBanner.cs Show resolved Hide resolved
@0x5bfa
Copy link
Member Author

0x5bfa commented May 14, 2023

@ferrariofilippo I'm currently working on step 1 in #12340. All of them are out of scope of the PR.

  1. Rename files with the appropriate name and put them into appropriate namespace for each.
  2. Rename variables with preferred name to follow the guideline (The most likely to happen is that I rename property-backing-field from '_isHidden' to '_IsHidden')
  3. Reorder variables & methods to follow the class structure guideline (Section 3 in the guildeline)
  4. Refactor to improve performance. You can see what I will work on in Requirements section.

@0x5bfa
Copy link
Member Author

0x5bfa commented May 15, 2023

@ferrariofilippo But thank you always for reviewing my refactoring PR. I will refer to those reviews in the further PR.

@yaira2 Ready for review.

Copy link
Contributor

@ferrariofilippo ferrariofilippo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked it again and nothing is missing, so LGTM!
I found another couple of things that you may change in phase 2:

  • At src/Files.App/ViewModels/UserControls/StatusCenterViewModel.cs CloseBanner(), it might be better to use IndexOf and then RemoveAt to avoid comparing all the elements twice
  • At src/Files.App/Data/Items/StatusBanner.cs StatusBanner(), line 85, it might be better to use a swtch assing like: Title = Operation switch ...

@yaira2
Copy link
Member

yaira2 commented May 16, 2023

I checked it again and nothing is missing, so LGTM!

Thanks! Can I resolve the conversations?

@ferrariofilippo
Copy link
Contributor

Yes

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels May 16, 2023
@yaira2 yaira2 merged commit e3904f3 into files-community:main May 16, 2023
@0x5bfa 0x5bfa deleted the 5bfa/cleanup-viewmodels branch May 19, 2023 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants