voyager
voyager copied to clipboard
Rethinking TabOptions in cafe.adriel.voyager.navigator.tab.Tab
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:
- Preferred: Remove TabOptions, mainly reduce the api surface and let the user solve it depending on their opinion & use case, such as wrapping Tab interface or having option related code specified outside of tab.
- Alternative: Turn TabOptions into a generic so that people can declare custom definitions also make it open so that implementation is optional.
i have the same question
@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!
@DevNatan check this https://github.com/adrielcafe/voyager/pull/463 it solves this issue