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
scopeof collectModulePreviews / collectAllModulePreviews in user-facing call sites, andthe default of
composePreviewLab.collectPreviews.defaultCollectScopein 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:
If the explicit annotation argument or call-site argument is anything other than
[DefaultCollectScope]/DefaultCollectScope, it wins as-is.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.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
Companionclass 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 fieldon the outerComposePreviewLabOptionclass (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.