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

Allow @ShowkaseComposable as annotation for annotation class #331

Open
ln-12 opened this issue Jun 9, 2023 · 3 comments
Open

Allow @ShowkaseComposable as annotation for annotation class #331

ln-12 opened this issue Jun 9, 2023 · 3 comments

Comments

@ln-12
Copy link

ln-12 commented Jun 9, 2023

Hey, I have a feature request which is kind of related to #233.

The @Preview annotation can be used for functions and other annotation classed (see here). @ShowkaseComposable can only be used for functions. I would like to do the following:

// some other annotations
@ShowkaseComposable
annotation class DefaultPreview

This is already possible with @Preview. Do you see any issues when allowing @ShowkaseComposable on annotation classes to achieve that? I think the only thing needed for that would be to add AnnotationTarget.ANNOTATION_CLASS here.

@vinaygaba
Copy link
Collaborator

@oas004 Any chance you could add the same functionality to ShowkaseComposable as well? Trying to remember why you didn't add this in the original PR's itself?

@oas004
Copy link
Contributor

oas004 commented Sep 19, 2023

Hey, I think I just might have forgotten to add that as well in the initial PRs. I think that should be possible, but I'm not sure that it is as easy as just adding AnnotationTarget.ANNOTATION_CLASS. I can try to look into it this weekend if that is okay? :)

Do you think it would make sense to add the repeatable pattern as well to this annotation? So that this is possible?

@ShokaseComposable
@ShowkaseComposable
annotation class DefaultPreview

and

@ShokaseComposable
@ShowkaseComposable
@Composable
fun SomePreview()

@ReginFell
Copy link

ReginFell commented Mar 12, 2024

Do you have any updates on this by any chance? This would be extremely useful for us since we want to use the ShowkaseComposable annotation across different modules, but we want to hide its configuration.

@ShowkaseComposable(tags = listOf(specialTag)
annotation class HasSpecialTag

@HasSpecialTag
@Composable
fun SomePreview()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants