Open
Description
Thank you for your library!
We recently migrated from KAPT to KSP and encountered some unexpected behavior.
We use a custom annotation, ComponentPreview
, for stacking previews:
@Preview(name = "Light preview", showBackground = true)
@Preview(name = "Dark preview", showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
annotation class ComponentPreview
Additionally, each component preview is annotated with ShowkaseComposable
to specify a group in Showkase browser:
@Composable
@ShowkaseComposable(group = "MyGroup")
@ComponentPreview
fun GreetingPreview() {
DemoTheme {
Greeting()
}
}
This setup worked fine with KAPT. However, after migrating to KSP, the Showkase generates two components: one for the Default
group and another for the specified group (e.g., MyGroup
).
public val GreetingPreviewDefaultGroupGreetingPreviewDarkpreview1: ShowkaseBrowserComponent =
ShowkaseBrowserComponent(
group = "Default Group",
componentName = "GreetingPreview - Dark preview",
componentKDoc = "",
componentKey =
"""com.example.showkasenewkotlin_GreetingPreview_null_DefaultGroup_GreetingPreview-Darkpreview_1_null""",
isDefaultStyle = false,
component = @Composable { GreetingPreview() }
)
public val GreetingPreviewGroupGreetingPreview: ShowkaseBrowserComponent = ShowkaseBrowserComponent(
group = "Group",
componentName = "GreetingPreview",
componentKDoc = "",
componentKey =
"""com.example.showkasenewkotlin_GreetingPreview_null_Group_GreetingPreview_0_null""",
isDefaultStyle = false,
component = @Composable { GreetingPreview() }
)
Is there a way to ignore the Default
group and generate components only for composables annotated with ShowkaseComposable
?
Metadata
Metadata
Assignees
Labels
No labels