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: Improved Widget code #14458

Merged
merged 15 commits into from
Feb 8, 2024

Conversation

0x5bfa
Copy link
Member

@0x5bfa 0x5bfa commented Jan 14, 2024

Summary

1st stage of Widgets cleanup.

Since SideBar and Widget use diffierent data models, added SideBar and Widget prefixes so others could understand what a data model is for easily.

Card means Button.
Container means Expander.
FileTagsContainer means a tag container.

  • Renamed: WidgetDriveCardItem
  • Renamed: WidgetFileTagsCardItem
  • Renamed: WidgetFolderCardItem
  • Removed: Some of classes that are referenced from nowhere

Widget models
image

Steps To Validate Changes

  1. Launch the app
  2. Go to Home page
  3. See nothing different from what Files stable shows
  4. Right click on any widget card item
  5. See the context menu shows correctly

PR Checklist

Screenshots

N/A

Footnotes

  1. If the request hasn't been agreed by the team, this work might be rejected. Make sure that you get approval from the team before opening any PR related the request.

  2. If you removed any en-US string resources, make sure that there are no references of those resources. When you add a new en-US string resources, do not make any changes on other languages' resources; Crowdin will do that, instead.

@0x5bfa
Copy link
Member Author

0x5bfa commented Jan 14, 2024

Reduced changed code lines. Mostly renaming and moving classes.

Ready for review

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, works as expected on my computer. I couldn't manage to find any regression.
A second try might be worth.

Copy link
Member

@d2dyno1 d2dyno1 left a comment

Choose a reason for hiding this comment

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

I'd rename the sidebar from "SideBar" to "Sidebar" but it's optional 🙂

@0x5bfa
Copy link
Member Author

0x5bfa commented Jan 23, 2024

Currently, Files has both SideBar and Sidebar, and the VS spell checker warn you if you use Sidebar, so I decided to use SideBar to create a sense of unity with TabBar.

@yaira2 It's what depends on you.

@yaira2
Copy link
Member

yaira2 commented Jan 23, 2024

"Sidebar"

@0x5bfa
Copy link
Member Author

0x5bfa commented Jan 23, 2024

TabBar is "Tabbar" or "TabBar"?

@yaira2
Copy link
Member

yaira2 commented Jan 23, 2024

"TabStrip"

@0x5bfa
Copy link
Member Author

0x5bfa commented Jan 23, 2024

What😂
Fun fact: TabBar is what you decided to call tho

But whatever it'll be, I'm gonna change all SideBar to be Sidebar.

@yaira2
Copy link
Member

yaira2 commented Jan 23, 2024

Things change 😁

@0x5bfa
Copy link
Member Author

0x5bfa commented Jan 24, 2024

Ready for review again

@0x5bfa 0x5bfa requested a review from d2dyno1 January 25, 2024 03:40
@0x5bfa
Copy link
Member Author

0x5bfa commented Jan 29, 2024

@yaira2 I can revert the last commit to be fetched to the last approved state. I wanna rename to Sidebar in the forth coming PR to merge first. Plus, It turned out that those classes should be prefixed with Standard*Item such as StandardDriveItem and StandardLibraryItem because those classes used as standard encapsulated classes everywhere in Files.App (Standard* respects @lukeblevins's change)

@yaira2
Copy link
Member

yaira2 commented Feb 4, 2024

@0x5bfa can you revert the remaining changes to the sidebar?

@lukeblevins
Copy link
Contributor

@yaira2 I can revert the last commit to be fetched to the last approved state. I wanna rename to Sidebar in the forth coming PR to merge first. Plus, It turned out that those classes should be prefixed with Standard*Item such as StandardDriveItem and StandardLibraryItem because those classes used as standard encapsulated classes everywhere in Files.App (Standard* respects @lukeblevins's change)

I'd be curious to know which change it was mentioned from me. 😬

@0x5bfa
Copy link
Member Author

0x5bfa commented Feb 5, 2024

@yaira2 I can revert the last commit to be fetched to the last approved state. I wanna rename to Sidebar in the forth coming PR to merge first. Plus, It turned out that those classes should be prefixed with StandardItem such as StandardDriveItem and StandardLibraryItem because those classes used as standard encapsulated classes everywhere in Files.App (Standard respects @lukeblevins's change)

I'd be curious to know which change it was mentioned from me. 😬

You renamed ListedItem to StandardItemViewModel in #12601. I found it was pretty valid and I should rename DriveItem, WslDistroItem and so on like this.

@yaira2 yaira2 changed the title Code Quality: Clean up Widgets 1 Code Quality: Improved Widget code Feb 7, 2024
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Feb 7, 2024
@yaira2 yaira2 merged commit d501d1d into files-community:main Feb 8, 2024
6 checks passed
@0x5bfa 0x5bfa deleted the 5bfa/Cleanup-Widgets1 branch February 13, 2024 02:53
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.

5 participants