Skip to content

Commit d71ff5f

Browse files
committed
Enable notes in the storyboard overview for only the selected index
1 parent 6cee434 commit d71ff5f

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

storyboard-easel/src/commonMain/kotlin/dev/bnorm/storyboard/easel/StoryboardOverview.kt

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import dev.bnorm.storyboard.core.Storyboard
2828
import dev.bnorm.storyboard.core.StoryboardState
2929
import dev.bnorm.storyboard.easel.internal.aspectRatio
3030
import dev.bnorm.storyboard.easel.internal.requestFocus
31+
import dev.bnorm.storyboard.easel.notes.LocalStoryboardNotes
3132
import dev.bnorm.storyboard.ui.ScenePreview
3233
import kotlinx.collections.immutable.ImmutableList
3334
import kotlinx.collections.immutable.toImmutableList
@@ -88,11 +89,23 @@ fun StoryboardOverview(
8889
}
8990
}
9091

91-
ScenePreview(
92-
storyboard = overview.storyboard.storyboard,
93-
index = item.index,
94-
modifier = sharedElementModifier
95-
)
92+
// TODO should notes be disabled *totally* during overview?
93+
// - providing notes for the selected scene in the overview means
94+
// we duplicate the scene notes during the transition.
95+
// TODO is there a better way to disable composition locals within overview?
96+
// - ProvidedValues that are applied in overview as well
97+
// - ProvidedValues that are not applied in overview
98+
// - decorator?
99+
// - some other storyboard concept?
100+
CompositionLocalProvider(
101+
LocalStoryboardNotes provides LocalStoryboardNotes.current.takeIf { isCurrentIndex },
102+
) {
103+
ScenePreview(
104+
storyboard = overview.storyboard.storyboard,
105+
index = item.index,
106+
modifier = sharedElementModifier
107+
)
108+
}
96109

97110
// Cover the scene content with a clickable modifier
98111
// to disable interaction while in overview.

0 commit comments

Comments
 (0)