Comments (19)
Can you post a reproducer? This works fine for me:
fun main() = singleWindowApplication {
DialogWindow(
onCloseRequest = { }
) {
Text("Hello, World")
}
}
from compose-multiplatform.
I just call it in composable function
@Composable
fun DialogWrapper(
visible: Boolean,
) {
DialogWindow(
visible = visible,
onCloseRequest = { }
) {
Text("Hello, World")
}
}
from compose-multiplatform.
Please provide a complete, working reproduction of the bug. The full source code...
from compose-multiplatform.
What environment are you running this in? I see com.intellij.ide classes in the stack trace.
Are you writing an IDEA plugin?
from compose-multiplatform.
Correct. Now, I'm working to write the IDEA plugin through the Compose Desktop & Jewel library.
As I mentioned before, I just call a simple DialogWindow in compose view and an exception happens.
from compose-multiplatform.
I couldn't reproduce it.
Can you please share what’s runtime and VM, OS version do you use during development? You can do that by invoking action “About” and put its output here.
In my case I tried with current state of Jewel project (running samples:ide-plugin:runIde configuration):
IntelliJ IDEA 2024.1 (Community Edition)
Build #IC-241.14494.240, built on March 28, 2024
Runtime version: 17.0.9+7-b1087.7 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.0
from compose-multiplatform.
Hi @m-sasha please see the video here:
https://quangtrungcollege-my.sharepoint.com/:v:/g/personal/huutq98_ms365vip_com/EWiCIP-mSENLr7y3iScNG3AB9L6MTr4nic3nVIYAJ4qpIQ?e=ZBT7TW
from compose-multiplatform.
My OS: macOS 14.4.1
Jewel: org.jetbrains.jewel:jewel-ide-laf-bridge-232:0.15.2
Compose-Desktop: 1.6.10-dev1561
Kotlin: 1.9.21
from compose-multiplatform.
Can you try with the latest (or at least 2024.1) version of IDEA?
from compose-multiplatform.
Can you try with the latest (or at least 2024.1) version of IDEA?
Yup, my current IDE is 2024.1. But my IDE plugin project support starts from v2023.3. If the exception happens on 2023.3 the error dialog will be displayed, right?
Can you set the props in the gradle.properties to try reproduce
pluginSinceBuild = 222.*
pluginUntilBuild = 233.*
platformType = IC
platformVersion = 2023.3
pluginVerifierIdeVersions = 2023.3
from compose-multiplatform.
If the error is due to a bug in an older version of IDEA, we're not going to be able to fix it, unfortunately.
from compose-multiplatform.
Alright, I will try again in 2024.1.
from compose-multiplatform.
Can you also check what happens if you open a regular java.awt.Dialog
from the same place?
from compose-multiplatform.
It seems I don't see an error dialog when installing the plugin from disk on 2023.3.6 & 2024.1.
from compose-multiplatform.
Hi @m-sasha , I know this is not relevant, but I have a quick question about VerticalScrollbar. When I use it in LazyColumn via LazyListState, when I scroll their progress height increases/decreases abnormally. This doesn't happen on Column using verticalScrollState, but I need to know if it is a feature or bug to create/report.
I'm stuck with this for 2 days and trying to find out the work around but I can't. If I go back to Column and use verticalScroll it works perfectly, but I can't handle LazyLoad (it is related to performance, scrollbar index doesn't reload progress when adding more items to the top, etc.).
You can try this code below:
import androidx.compose.foundation.VerticalScrollbar
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollbarAdapter
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.unit.dp
import kotlin.random.Random
@Composable
fun VerticalScrollbarUsage() = Box {
val state = rememberLazyListState()
val itemCount = 100
val heights = remember {
val random = Random(10)
(0 until itemCount).map { random.nextInt(0, 2000) }
}
LazyColumn(Modifier.graphicsLayer(alpha = 0.5f), state = state) {
items((0 until itemCount).toList()) { i ->
val itemHeight = 20.dp + 20.dp + heights[i].dp
Text(i.toString(), Modifier.graphicsLayer(alpha = 0.5f).height(itemHeight))
}
}
VerticalScrollbar(
rememberScrollbarAdapter(state),
Modifier.align(Alignment.CenterEnd)
)
}
from compose-multiplatform.
If you mean that the size of the scrollbar changes as you scroll, that's expected if the items in the list are of varying sizes.
In a LazyColumn
, only the visible items are actually created, so the scrollbar can't know the "real" offset or the full height of the column (the sum of heights of all the elements). Instead it uses a heuristic to estimate these values. If the items have wildly different sizes, the heuristic will be wrong.
from compose-multiplatform.
If you mean that the size of the scrollbar changes as you scroll, that's expected if the items in the list are of varying sizes.
In a
LazyColumn
, only the visible items are actually created, so the scrollbar can't know the "real" offset or the full height of the column (the sum of heights of all the elements). Instead it uses a heuristic to estimate these values. If the items have wildly different sizes, the heuristic will be wrong.
Yeah, I know how LazyList works but is there any way to improve this, because the scrollbar UX is quite bad in case the items are different in height from each other?
from compose-multiplatform.
Unfortunately no.
from compose-multiplatform.
Thanks for your support, Regarding the issue I mentioned before it seems not to happen on the production build. If I'm facing with this in the future, I will re-create the ticket. You can close it now.
from compose-multiplatform.
Related Issues (20)
- [Compose resources]: Allow custom naming of "Res" class generated HOT 4
- A common way to handle window-level key handlers
- [Compose resources]: Make url paths absolute for JS/Web HOT 1
- Compose Navigation show overlay on Desktop & Web HOT 8
- Support Kotlin 1.9.24 HOT 2
- Could not isolate value org.jetbrains.compose.internal.service.ConfigurationProblemReporterService HOT 2
- Implementing Room causes issue to run iOS App in Simulator HOT 2
- Unable to collect hover interactions over BasicText
- Add GPG signatures to released artifacts HOT 1
- Compose Compiler 1.5.12+ causes Only @HiddenFromObjC declaration can be a subtype of @HiddenFromObjC declaration HOT 9
- Accessibility. Crash on Windows when traversing elements
- Accessibility. Review enabling accessibility on Windows in native distributed apps
- Compose 1.6.2 iOS ComposeContainer memory leak HOT 2
- ComposeUIViewController don't Update View HOT 2
- TextField cannot input in ExposedDropdownMenuBox, when ExposedDropdownMenu is expanded HOT 4
- 🚀 Low-code tools to speed up and ease app development HOT 1
- java.lang.SecurityException: SHA-256 digest error for org/bouncycastle/operator/OperatorCreationException.class HOT 3
- [IOS-Simulator] TextField Text Cursor Jumps Around After Using CMD+A then Delete to clear all text preventing further text input.
- Using `ComposeScene`s with anything but `MainUIDispatcher` results in a deadlock HOT 19
- Generate XCFramework with UI, resources and dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-multiplatform.