Also I was mildly disappointed to see that the Des...
# compose-desktop
d
Also I was mildly disappointed to see that the Desktop Preview and Android Preview are: • Still in separate panels - is it not feasible to integrate Desktop preview with the Android Code / Split / Design system? • Cannot work from
common
source set i.e. define a
@Preview
from within some
materialCommon
(Desktop + Android) source set. When we develop a Multiplatform Project for Desktop + Mobile this is (very happily) where we can define most of our Compose components, so not being able to define
@Preview
here as well, sadly makes the Preview feature useless in this scenario. I played with different `expect`/`actual` definitions for the
Preview
annotation, but couldn't make anything that improved the experience.
6
s
No preview from common code is a bummer
3
c
I think Igor Demin once suggested that someone can try to write a new kmm compatible annotation?
a
See the comments in this CL. Key part:
In general, we think that having one annotation might be the end goal but, for now, two it's fine.
The reason for that is that currently, the Android annotation includes configuration values that are Android specific so it is not reusable. For the next version of the annotation, we decided that we probably want to split it in two to make the @Preview completely platform agnostic if possible.
Regarding the previewing of all Composables, this is something we've discussed at length internally. It is possible but, at least for Android, not desirable. Previews relied on state setup or Composition locals that are not available.
👍 1