terrakok / Compose-Multiplatform-Wizard

Compose Multiplatform Wizard
https://terrakok.github.io/Compose-Multiplatform-Wizard/
MIT License
389 stars 25 forks source link

Adds dependency grouping #13

Closed cjbrooks12 closed 1 year ago

cjbrooks12 commented 1 year ago

This is a WIP, but wanted to open the PR to as a suggested improvement to the UI organization, which will help as more dependencies get added to this generator. I'm hoping that opening this as a draft PR will help fix some of the issues with it before getting merged.

This PR sets up "Dependency Types", such as Logging, Navigation, DI, etc. and categorizes the available dependencies into those categories. Categories can be defined as single-select where you pick only one of the available options (which is how it is currently done with things like DI Koin vs Kodein), and adds the possibility of multi-selection where a single category can allow the inclusion of multiple dependencies in that group. This is new, but is useful for things like Icons, where you might need multiple icon packs.

Also note that this PR is my first time using React or Kotlin/React (I'm used to using Compose for Web stuff), so I have no idea if the code is structured the right way. Also, with the multi-select category, I could not figure out how to keep the dialog open after selecting an item.

terrakok commented 1 year ago

I understand your idea but at the moment I'm not sure that I want to group dependencies. I would like to keep wizard logic as simple as possible.

DevSrSouza commented 1 year ago

One solution that I propose for the Icons Packs is a way to add all Icon packs to Version Catalog but apply only one into the project itself. It will make easier to just switch or add more icon packs because it would be already present in Version Catalog, avoid complexity of multiple selection of icon packs.

In my previous PR I add this flag to the dependencies: applyToModule that means that it would add the build script of composeApp module, if false, it would only add to Version Catalog.

https://github.com/terrakok/Compose-Multiplatform-Wizard/pull/8/files#diff-6af0ba6eea4af90b943d00d23627e2dad8e1af4a56bda8f9c0e7a6dc69ad14edR45

terrakok commented 1 year ago

@DevSrSouza it does not work well. Why might I have a few different DI libraries or logging? To have a mess in a catalog is a bad idea, IMO

cjbrooks12 commented 1 year ago

@terrakok You've already started grouping dependencies with the Loggers, Build Config, Icons, and DI, it's just not very clear in the UI. The "edit" icon doesn't really communicate that you're picking a different dependency of the same type, at first glance it looks like there are some options you can configure for that one dependency. So this PR mostly just adds labels to clarify that there are multiple options for logging, etc.

And the specific categories I set up with this PR are not the important part, we can definitely change/rename those categories, or flatten them out so more dependencies are shown at the top-level rather than within the dialogs.

terrakok commented 1 year ago

I will think about the better grouping UI/UX later.

DevSrSouza commented 1 year ago

@DevSrSouza it does not work well. Why might I have a few different DI libraries or logging? To have a mess in a catalog is a bad idea, IMO

Yes, I agree, is kinda a different idea of the Pull Request, is more towards minimizing the requirement for Groupping dependencies now, that actually a solution for groupping dependency. 2 DI libraries at the version catalog does not make sense, you are right, the idea is more towards dependency that was selected but is modular and has a bunch of modules. For example Compose Icons, Voyager, Slack Circuit (if it get Multiplatform support soon), Accompanist (if it get some libraries multiplatform), etc.

terrakok commented 1 year ago

My main idea: to keep the wizard as simple as possible. It shouldn't be over configurable. I see it clean and simple. Just a few clicks to get a new Compose project. It shouldn't contain all possible libraries or something like that. It is not a library catalog. I selected my favorite libraries for a fast start.