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: Refactored tab control #13197

Merged
merged 27 commits into from
Sep 26, 2023

Conversation

0x5bfa
Copy link
Member

@0x5bfa 0x5bfa commented Aug 14, 2023

Code Quality: Clean up multitasking control

I'm actually surprised how the code was complicated. This would be a milestone for implementation of the templated custom tabview for the future.

Motivation & Context

  • Improved readability
  • Improved maintainability

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 Feature: Improving Performance, optimizations, reliability and codebase  #4180
    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?
    • Open the app
    • Add a new tab, see contents changed properly
    • Close a tab, see contents changed properly
    • Right click a tab, see menu is shown properly
    • If you dont see nothing changed, changes were validated.

Screenshots

image

@0x5bfa 0x5bfa marked this pull request as ready for review August 14, 2023 14:06
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.

Overall, the code looks good, except in a few cases.
You might consider removing using Files.App.UserControls.TabView from most of the files.
I'm not a big fan of the new class names, they are in conflict with existing ones. They might confuse other contributors

src/Files.App/Data/Parameters/TabItemArguments.cs Outdated Show resolved Hide resolved
src/Files.App/ViewModels/MainPageViewModel.cs Outdated Show resolved Hide resolved
src/Files.App/ViewModels/MainPageViewModel.cs Outdated Show resolved Hide resolved
src/Files.App/UserControls/TabView/BaseTabView.cs Outdated Show resolved Hide resolved
src/Files.App/UserControls/TabView/TabView.xaml.cs Outdated Show resolved Hide resolved
src/Files.App/UserControls/TabView/TabView.xaml.cs Outdated Show resolved Hide resolved
@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 15, 2023

I'm not a big fan of the new class names, they are in conflict with existing ones.

Does anyone have an idea?

@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 16, 2023

CustomTabView will do.

@ferrariofilippo
Copy link
Contributor

CustomTabView will do.

This one sounds good

@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 21, 2023

@yaira2 do you have plans to create custom template tabview? it is supposed to be easier than sidebar tbh.

@yaira2
Copy link
Member

yaira2 commented Aug 21, 2023

@0x5bfa you mean a custom control like we did with the sidebar? It's something I'd like to do at some point but there is a lot of logic (particularly around resizing the tabs) so it's quite a large task.

@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 21, 2023

Ready for review. @yaira2

@0x5bfa 0x5bfa changed the title Code Quality: Clean up multitasking control Code Quality: Cleaned up multitasking control Aug 23, 2023
@0x5bfa 0x5bfa requested a review from ferrariofilippo August 23, 2023 03:54
@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 23, 2023

@yaira2 I can rename CustomTabView with something else if you dont like it such as MultitaskingTabView.

@yaira2
Copy link
Member

yaira2 commented Aug 23, 2023

@0x5bfa what's in scope for this PR?

@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 23, 2023

  • Refactor/simplify MultitaskingControl code
  • Rename MultitaskingControl with CustomTabView.

@0x5bfa
Copy link
Member Author

0x5bfa commented Aug 23, 2023

Unwrapped the content frame from usercontrol, so slight performance improvement will be expected.

@yaira2
Copy link
Member

yaira2 commented Sep 5, 2023

I'm not a big fan of the new class names, they are in conflict with existing ones.

Does anyone have an idea?

How about HorizontalTabView?

@0x5bfa
Copy link
Member Author

0x5bfa commented Sep 6, 2023

If we are certainly going to implement vertical one. But if not, I don't like it.

@yaira2
Copy link
Member

yaira2 commented Sep 6, 2023

Vertical tabs aren't in the plans

@0x5bfa
Copy link
Member Author

0x5bfa commented Sep 6, 2023

Then adding Horizontal is not appropriate I believe.

@yaira2
Copy link
Member

yaira2 commented Sep 6, 2023

What about TabBar?

@0x5bfa
Copy link
Member Author

0x5bfa commented Sep 6, 2023

Sounds great. Would you like me to change to be it?

yaira2
yaira2 previously approved these changes Sep 12, 2023
Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Sep 12, 2023
Copy link
Contributor

@QuaintMako QuaintMako left a comment

Choose a reason for hiding this comment

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

LGTM.

@yaira2
Copy link
Member

yaira2 commented Sep 18, 2023

@0x5bfa can you look into the build error?

@yaira2
Copy link
Member

yaira2 commented Sep 21, 2023

@0x5bfa can you also share some steps to test these changes? Ideally this would include all the different functionality around the tab bar.

@0x5bfa
Copy link
Member Author

0x5bfa commented Sep 25, 2023

@0x5bfa can you also share some steps to test these changes? Ideally this would include all the different functionality around the tab bar.

No changes were made of functionalities. But cleaned up codebase to make them have clear purpose of existence. Just opening the app would check if this changes were appropriately made.

@0x5bfa 0x5bfa requested a review from yaira2 September 25, 2023 14:08
@0x5bfa
Copy link
Member Author

0x5bfa commented Sep 25, 2023

Please take another look.

@0x5bfa
Copy link
Member Author

0x5bfa commented Sep 26, 2023

Done

@yaira2
Copy link
Member

yaira2 commented Sep 26, 2023

@0x5bfa looks good, thank you for the PR.

@yaira2 yaira2 merged commit d14bb1c into files-community:main Sep 26, 2023
2 checks passed
@0x5bfa 0x5bfa deleted the 5bfa/Cleanup-MultitaskingControl branch September 28, 2023 23:27
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.

4 participants