Skip to content

Cannot use @EmergeSnapshotConfig annotation with custom multipreview annotations #669

@rbro112

Description

@rbro112

Due to the AnnotationTarget.FUNCTION target on EmergeSnapshotConfig, EmergeSnapshotConfig cannot be used with custom multipreview annotations.

Example of desired behavior:

@Preview(
    name = "1. Light Theme",
    ...
)
@Preview(
    name = "2. Dark Theme",
    ...
)
@EmergeSnapshotConfig(precision = 0.99f)
annotation class CustomPreview

@EmergeSnapshotConfig(ignore = true)
annotation class IgnoredEmptySnapshot

Both CustomPreview and IgnoredEmptySnapshot should apply the precision/ignore from EmergeSnapshotConfig respectively to any functions they're applied on.

We can implement this by updating the annotation target to be AnnotationTarget.ANNOTATION_CLASS. We'll need to add support to the Emerge backend to ensure the config is applied to all previews annotated with the multipreview annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions