slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.54k stars 600 forks source link

[Slint Preview ver. 1.0.1 Only] [MacOS] [Visual Studio Code] Preview window does not work #2609

Closed volodg closed 1 year ago

volodg commented 1 year ago

Given a slint layout When preview layout in Visual Studio Code Then preview appears in menu bar but does not show up

ogoffart commented 1 year ago

Thanks for reporting a bug.

Would you be able to share the code that is no longer working so we can investigate?

volodg commented 1 year ago

Yes, you can test layouts from this file for example - https://github.com/biotech-ng/exchange/blob/main/slint_lib/ui/app.slint

ogoffart commented 1 year ago

Everything seems to work alright for me. What component exactly is not working? What are the step i can use to reproduce? Could you also perhaps send screenshot, that may help me to understand

volodg commented 1 year ago

MacOS ver 12.6.3 Issue: https://user-images.githubusercontent.com/32120/233590225-2593dbff-677a-4a6a-84b2-e4308934ab97.mov

Visual studio Code ver 1.77.3

Slint preview plugin version 1.0.1

Screenshot 2023-04-21 at 10 47 13

Version 1.0.0 was working fine

ogoffart commented 1 year ago

Thanks for the video. That shows the problem clearly; But I can't reproduce this problem on Linux. Maybe it's mac specific? @tronical could you have a look? (If i have to guess what break it, i'd say it may be releated to the always-on-top flag)

tronical commented 1 year ago

I can't reproduce this either on macOS :-(. @volodg does it help if you restart vs code?

volodg commented 1 year ago

I have tried reboot MacOS and restart Visual Studio Code, nothing helped :-(

CarbonPool commented 1 year ago

I also confirm, I have this problem on windows

hunger commented 1 year ago

I have the preview window showing up under VSCode most times in windows rather often :-( Is the window visible in the - view?

You can try to use the WASM based viewer in the VSCode settings (check Extensions/Slint): That is rendered in an editor panel inside VSCode. Does that work?

ogoffart commented 1 year ago

Something that could explain the behavior is if the preview thread is stuck in an infinite loop. Is the slint-lsp process taking a lot of CPU in the background?

volodg commented 1 year ago

@ogoffart No, id does not

Screenshot 2023-04-24 at 21 48 01
tronical commented 1 year ago

@volodg what version of macOS are you running?

tronical commented 1 year ago

Yes, you can test layouts from this file for example - https://github.com/biotech-ng/exchange/blob/main/slint_lib/ui/app.slint

Just to double check: a new vs code instance, open this file, preview the last component, and then nothing shows but you see an entry on the task bar?

tronical commented 1 year ago

@CarbonPool do you have some steps that reproduce this?

I have the feeling that this might be content related.

volodg commented 1 year ago

@tronical MacOS ver.: 12.6.3

Yes, exactly: "nothing shows but you see an entry on the task bar"

volodg commented 1 year ago

I don't think it's content related, seems I can not preview any component

tronical commented 1 year ago

Do you see anything in the output tab for "Slint LSP"? There should be some messages there. I wonder what it says there when you click "Show Preview".

CarbonPool commented 1 year ago

@CarbonPool do you have some steps that reproduce this?

I have the feeling that this might be content related.

  1. update slint and slint-build to 1.0.1
  2. restart vscode or extension
volodg commented 1 year ago

@tronical Not sure, where I can find this tab? Maybe this?

Screenshot 2023-04-25 at 09 46 14
ogoffart commented 1 year ago

We mean the output tab: image If there is no "Slint LSP" there, it means there was no output for the LSP. But if the LSP crashes, the panic message should be printed there.

volodg commented 1 year ago

Nothing special there:

Screenshot 2023-04-25 at 10 02 18
ogoffart commented 1 year ago

I actually can reproduce. I confirm that the version 1.0.1 doesn't work. What's strange is that the nightly version works.

ogoffart commented 1 year ago

What's really strange is that i tried to install previous nightly build, and none of the nightly build between april 19th and april 21st reproduce the problem, despite it should be exactly the same as the 1.0.1 release

ogoffart commented 1 year ago

I was able to bisect and found out this was caused by commit abdbb8d8c648f5a8568fd6be5d70019013637b71 just before the release, and this was fixed just after the release in 21a06d1765c0f0558d31a4382250a684bede4fd1

ogoffart commented 1 year ago

We will release a version soon. I'd like to thanks everyone involved for reporting the issue and the patience helping with the debugging. (also in #2616 )