Skip to content

Commit ee61d86

Browse files
CopilotShreckYe
andauthored
Fix errors such as "org.jetbrains.dokka.model.DClass ScrollState cannot be merged with org.jetbrains.dokka.model.DObject ScrollState" in dokkaGeneratePublicationHtml (#115)
* Initial plan * Fix Dokka DClass/DObject merge error for ScrollState and LazyItemScope Change `actual object ScrollState` to `actual class ScrollState` in jsMain to fix Dokka's inability to merge DClass and DObject models. Apply the same fix to `LazyItemScope` which had the same expect class/actual object mismatch. Reuse a single LazyItemScope instance since it's stateless. Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com> Agent-Logs-Url: https://github.com/huanshankeji/compose-multiplatform-html-unified/sessions/fb46b1bd-1f94-4165-b19a-6bc80235c64b * Add some comments and simplify * Complete PR: update workflow to deploy Dokka API docs to GitHub Pages alongside demo - Update demo-gh-pages.yml to run dokkaGeneratePublicationHtml alongside sideBySideBrowserDistribution and copy the Dokka HTML output to the site under an `api/` subdirectory - Update workflow name to reflect it deploys both demo and API docs - Fix copilot-setup-steps.yml to use ubuntu-latest (matching main) Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com> Agent-Logs-Url: https://github.com/huanshankeji/compose-multiplatform-html-unified/sessions/fe6d1cc2-55ae-4670-a884-abf1758ec816 * Revert "Complete PR: update workflow to deploy Dokka API docs to GitHub Pages alongside demo" This reverts commit dba83da. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com> Co-authored-by: Yongshun Ye <ShreckYe@gmail.com>
1 parent ffa96ff commit ee61d86

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/Scroll.js.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ val imitateComposeUiLayoutHorizontalScrollPlatformModifier =
2828

2929
@Composable
3030
actual fun rememberScrollState(initial: Int): ScrollState =
31-
ScrollState
31+
ScrollState()
3232

33+
34+
// used to be `actual object`, but but Dokka fails with it
3335
@Stable
34-
actual object ScrollState
36+
actual class ScrollState
3537

3638
actual fun Modifier.verticalScroll(state: ScrollState): Modifier =
3739
platformModify { verticalScroll() }

common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyDsl.js.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ actual class LazyListScope {
2929
contentType: Any?,
3030
content: @Composable LazyItemScope.() -> Unit,
3131
) =
32-
addComposable { LazyItemScope.content() }
32+
addComposable { LazyItemScope().content() }
3333

3434
actual fun items(
3535
count: Int,
@@ -39,7 +39,7 @@ actual class LazyListScope {
3939
) =
4040
addComposable {
4141
repeat(count) { index ->
42-
LazyItemScope.itemContent(index)
42+
LazyItemScope().itemContent(index)
4343
}
4444
}
4545
}

common/src/jsMain/kotlin/com/huanshankeji/compose/foundation/lazy/LazyItemScope.js.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import com.huanshankeji.compose.ui.Modifier
1212
@LazyScopeMarker
1313
@JvmDefaultWithCompatibility
1414
*/
15-
actual object LazyItemScope {
15+
// used to be `actual object`, with which Dokka fails
16+
actual class LazyItemScope {
1617
// I am not sure whether these implementations work perfectly.
1718

1819
actual fun Modifier.fillParentMaxSize(

0 commit comments

Comments
 (0)