adrielcafe / voyager

🛸 A pragmatic navigation library for Jetpack Compose
https://voyager.adriel.cafe
MIT License
2.47k stars 124 forks source link

Rethinking TabOptions in cafe.adriel.voyager.navigator.tab.Tab #141

Open afTrolle opened 1 year ago

afTrolle commented 1 year ago

Hi, I'm having a great time using voyager, I just wanted to share my thought on improving the Tab Interface.

Issue:

I've been trying to make the most of Voyager and its features, but I've run into an issue with TabOptions in cafe.adriel.voyager.navigator.tab.Tab. The design seems a bit to much opinionated and is causing a bit of trouble,

Depending on use cases it lacks fields and require fields that are optional for other use cases.

Also I'm not sure if the TabOptions should be declared inside the tab itself, because the usage is mostly going to be outside of itself.

Solutions:

Xxx-ming commented 11 months ago

i have the same question

DevNatan commented 10 months ago

@afTrolle @Xxx-ming True, current TabOptions design is very limited and the index, title and icon fields are not necessary, this is something that whoever is going to use it determines whether they need it or not. Also Tab will become a marker interface in the near future probably.

I'm collecting use cases to see what changes to Tabs API would look like in the end to try to reach the widest possible TabNavigator users (to improve docs as well). I would be happy if you guys gave me code examples to think about :) A PR with such changes is also welcome, Voyager will be my "baby" starting in Q4/2023 (October) so I promise to respond as quickly as possible to them

About the solution: Deprecate TabOptions and keep it backwards compatible up to v1.2 or higher and options optional.

I'm open to any recommendation. Thanks!

FireLord commented 3 weeks ago

@DevNatan check this https://github.com/adrielcafe/voyager/pull/463 it solves this issue