Assigned
Status Update
Comments
mg...@gmail.com <mg...@gmail.com> #2
Also doesn't work in AS 2024.3.2 Canary 4 and Compose 1.8.0-beta01
mg...@gmail.com <mg...@gmail.com> #3
Andrei: Is this the same as
mn...@google.com <mn...@google.com>
al...@google.com <al...@google.com> #4
Triage notes: Needs investigation. Assigning for later.
al...@google.com <al...@google.com> #5
Could you share the AppScaffoldTopBar
function that fails here? This seems different from
al...@google.com <al...@google.com> #6
Reconstructed from IR:
@Composable
fun AppScaffoldTopBar(
showBackArrow: Boolean,
showSearch: Boolean,
title: String?,
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
actions: ImmutableList<AppScaffoldNavigationAction>
) {
if (!showSearch) {
TitledTopAppBar(
title = title,
showBackArrow = showBackArrow,
modifier = modifier,
actions = actions,
onBackClick = onBackClick
)
} else {
TopAppBar(
title = {
// Composable lambda for title
AppScaffoldTopBarTitle(showBackArrow)
},
modifier = modifier,
navigationIcon = {
// Composable lambda for navigation icon
AppScaffoldTopBarNavigationIcon(showBackArrow, onBackClick)
},
actions = {
// Composable lambda for actions
AppScaffoldTopBarActions(actions)
}
)
}
}
This seems /extremely/ weird to me, because showSearch
is just a regular parameter that is used in function body only once. We need more context about surrounding code to figure out why it crashed the compiler.
Description
As an application becomes more complex, the difficulty of determing what is causing a recomposition increases. No amount of skill or experience can allow you to quickly identify what triggered the recomposition, it is just a major chore.
In the best case, it would be super useful if we could do something like this:
recompositionCause
here is a debugging statement, not to be used in production code. Its performance does not matter at all.I expect it to print something like:
Is this at all possible?
From googling, I see that Android Studio has some tools built into the IDE that help with identifying recomposition triggers. However, I'm looking for something that works on multplatform (desktop, in particular) and that doesn't require the IDE at all. I use IntelliJ, not Android studio. But in any case, an IDE feature wouldn't really fit my needs and shouldn't be neccesarry.
Also
DebugProbes
from kotlinx.coroutines comes to mind. I am essentially looking for something similar to this.With coroutines debug probles, we have to call
install
to start recording. It would be totally fine if we also had toinstall
some probe at the start of our application in order for this to work.Originally posted in a Compose Multiplatform discusssion . The Jetbrains team said that this issue would be better addressed by Google since Google is working on the Compose runtime, so I copied the post here.