airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.1k stars 107 forks source link

Support annotation customizations #305

Closed pmecho closed 1 year ago

pmecho commented 1 year ago

We have a use case for a customized annotation that can carry more information than the standard @ShowkaseComposable. To avoid needing to specify another annotation on preview functions that has that information, this adds a compiler flag to allow a custom annotation to be used instead of the standard annotation.

Additionally, there are specific terms we use for the fields in the annotation and we'd like to customize those as well. This adds compiler flags to allow for overriding the name, group and styleName fields. It also allows for multiple fields to be defined in a priority order where the first non-empty field is used. For us, this allows us to separate test-specific previews from previews used as a canonical style in our design system.

pmecho commented 1 year ago

Closing this in favor of https://github.com/airbnb/Showkase/pull/309