DefaultCollectScope

The single source-of-truth string the whole collectScope system bottoms out on.

It is used as:

  • the default value of collectScopes (this annotation's Array<String> parameter),

  • the default scope of collectModulePreviews / collectAllModulePreviews in user-facing call sites, and

  • the default of composePreviewLab.collectPreviews.defaultCollectScope in the Gradle DSL (the per-module scope that the compiler plugin substitutes for any [DefaultCollectScope]-shaped per-preview / per-call value).

Resolution order at compile time, per @Preview and per collect[All]ModulePreviews call:

  1. If the explicit annotation argument or call-site argument is anything other than [DefaultCollectScope] / DefaultCollectScope, it wins as-is.

  2. Otherwise, the compiler plugin substitutes the module's composePreviewLab.collectPreviews.defaultCollectScope (set via the Gradle DSL) so a library can pin all of its previews to a library-specific bucket without annotating each @Preview.

  3. If the Gradle DSL was not set either, the runtime default "default" applies.

Both the surrounding Companion and this const carry @ExperimentalComposePreviewLabApi for complementary reasons:

  • the companion-level marker keeps the Companion class itself out of every BCV baseline (KLIB/JVM/Android), so an empty companion does not lock-in as ABI if the const ever moves elsewhere.

  • the const-level marker keeps the const member itself filtered: on KLIB this nests with the companion-level filter, and on JVM/Android the const surfaces directly as a public static final field on the outer ComposePreviewLabOption class (the companion-level annotation does not propagate to that flattened field — see the root build.gradle.kts Known Limitation note for details), so without this marker the field stays in JVM/Android baselines forever.