JetBrains / jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Apache License 2.0
744 stars 40 forks source link

SplitLayout jumps weirdly in the IDE #589

Open rock3r opened 1 month ago

rock3r commented 1 month ago

As we were upgrading Jewel in Studio to 0.24.2 with @jrlogsdon, we noticed that the split layout has a bad bug when dragging on the initial state. We can repro this in both Linux and macOS — have not tried Windows, but would assume it's the same. We have not tried repro'ing in standalone.

This code:

Column(
  modifier = Modifier.fillMaxWidth().fillMaxHeight(),
  verticalArrangement = Arrangement.Center,
  horizontalAlignment = Alignment.CenterHorizontally
) {
  HorizontalSplitLayout(
    firstPaneMinWidth = 200.dp,
    secondPaneMinWidth = 250.dp,
    first = { },
    second = { },
    state = rememberSplitLayoutState(.3f)
  )
}

(simplified version of this Studio code)

Has this behaviour when set as content of a toolwindow:

https://github.com/user-attachments/assets/27521866-dfa4-481f-b591-7f274890e45e

hamen commented 1 month ago

I looked into it, but I can't find a quick solution. I can give you a workaround for now, though:

Add Modifier.fillMaxWidth() to the HorizontalSplitLayout and the measurement glitch should be contained.