kikipoulet/SukiUI

[Bug] Blank app has no background/View Theme

LeviGNMBS opened this issue Β· 8 comments

Check the following items

  • I have looked up relevant Issue

Description of the issue

Today i stated a blank avalonia app with the 6.0.0-rc release of suki. I noticed when starting a browser app (where sukiwindow is not used) There is no background, controls still seem to have their styling so i believe this difference to be the usage of singleviewlifetime. Is it possible to fix the theme for Browser apps? Maybe with a SukiView as main view? Maybe also support hosts for Browser purposes?

Package Version

6.0.0-rc

Environment

Browser

Expected Behavior

Is it possible to fix the theme for Browser apps? Maybe with a SukiView as main view? Maybe if possible also support hosts for Browser purposes in said view since i feel the difference in experience is very large atm.

Other than that love it!

Reproduction

Create a new xplat app
Update Avalonia to 11.2
Add SukiUI 6.0.0-rc
Start Browser app

Additional Information

No response

Currently there is no plan to support any platform other than desktop. A lot of our animations are quite heavy and the visual tree is quite a bit more complex than is really reasonable for other platforms, as well as the controls being designed with the desktop in mind.

Aside from this, web and mobile support in Avalonia are still quite early and not in a particularly good place.

Perhaps in a future release when support for those platforms are much more stable, but that's not likely any time soon.

As @sirdoombox said, browser support is not our priority. Honestly I don't even see a real use-case for Avalonia Browser in the current state, but I'm happy that you actually ran it as there are some issues with WASM (#180). Personnally I never succeeded in running WASM, even a blank project. Didn't spend a lot of time on it too.

About Hosts and background you should be able to use it with a little tweaking. Just look at the style of the SukiWIndow (https://github.com/kikipoulet/SukiUI/blob/main/SukiUI/Controls/SukiWindow.axaml). You can definitely use the "SukiBackground" control and declare your Hosts yourself in an usercontrol.

However, creating an alternative "SukiView" for SingleViewLifeTime is not planned at all.

I beg to differ

Currently there is no plan to support any platform other than desktop. A lot of our animations are quite heavy and the visual tree is quite a bit more complex than is really reasonable for other platforms, as well as the controls being designed with the desktop in mind.

That is sad in my opinion but ok, could you at least add a note on your readme that you do not support all platforms? Claiming that Suki is a and i quote "Complete UI Toolkit" that "is a theme for AvaloniaUI" implies all Avalonia platforms are supported in my opinion, otherwise it would be a "theme for AvaloniaUI Desktop"

Aside from this, web and mobile support in Avalonia are still quite early and not in a particularly good place.

Perhaps in a future release when support for those platforms are much more stable, but that's not likely any time soon.

I beg to differ, I have years of experience with WPF, XAML, UNO, Avalonia, and the current state is seen its history remarkably good, i have had 0 issues until i started using suki in my current project... Ever since the new backend (Avalonia 11+) its remarkably stable if you accept its limitations.

As @sirdoombox said, browser support is not our priority. Honestly I don't even see a real use-case for Avalonia Browser in the current state, but I'm happy that you actually ran it as there are some issues with WASM (#180). Personnally I never succeeded in running WASM, even a blank project. Didn't spend a lot of time on it too.

I agree it can sometimes be a pain to set up all the needed workloads (you need multiple extras that are not installed by default). But once set up its just a matter of pressing run like any other project. You should really give it a try!

About Hosts and background you should be able to use it with a little tweaking. Just look at the style of the SukiWIndow (https://github.com/kikipoulet/SukiUI/blob/main/SukiUI/Controls/SukiWindow.axaml). You can definitely use the "SukiBackground" control and declare your Hosts yourself in an usercontrol.
However, creating an alternative "SukiView" for SingleViewLifeTime is not planned at all.

Ok, i will try that, the toasts i already got working like that, i just think im doing something wrong with the background, since desktop isn't working either anymore. I'll try to get it to work like that. I doubt ill get it to work if you believe so strongly it would not work, but if i do that means there is in fact a real-use case to support it...

Ok, i will try that, the toasts i already got working like that, i just think im doing something wrong with the background, since desktop isn't working either anymore. I'll try to get it to work like that. I doubt ill get it to work if you believe so strongly it would not work, but if i do that means there is in fact a real-use case to support it...

I'm glad to hear that toasts works well on the browser. Does it have the right font ? I saw that Avalonia wasm loose the custom font, I hope it has been fixed.

To add the background, just add <SukiBackground /> control, it will work directly really.

The "use-case" quote was about wasm in general for web, in its current state. But otherwise, I would be seriously happy to see your result on it πŸ‘

I'm glad to hear that toasts works well on the browser. Does it have the right font ? I saw that Avalonia wasm loose the custom font, I hope it has been fixed.

I don't know, im bad at recognizing fonts, also keep in mind im not using the SukiWindow, so the font might not even be set but using the manual background i get the same result on desktop and Browser:
image

To add the background, just add <SukiBackground /> control, it will work directly really.

I did, and its gorgeous πŸ˜„

The "use-case" quote was about wasm in general for web, in its current state. But otherwise, I would be seriously happy to see your result on it πŸ‘

Well, my company for instance is trying to move away/find alternatives from the traditional javascript frontends for a while, since our expertise and codebase is all .NET. And migrating .NET Desktop to .NET WASM is surprisingly easy compared to migrating to JS. πŸ˜‰

I'm glad to hear that toasts works well on the browser. Does it have the right font ? I saw that Avalonia wasm loose the custom font, I hope it has been fixed.

I don't know, im bad at recognizing fonts, also keep in mind im not using the SukiWindow, so the font might not even be set but using the manual background i get the same result on desktop and Browser: image

To add the background, just add <SukiBackground /> control, it will work directly really.

I did, and its gorgeous πŸ˜„

Oh indeed, and it is the correct font ! It seems to render well, that's great πŸ‘

Well, my company for instance is trying to move away/find alternatives from the traditional javascript frontends for a while, since our expertise and codebase is all .NET. And migrating .NET Desktop to .NET WASM is surprisingly easy compared to migrating to JS. πŸ˜‰

Well, finally it's just that we don't want to disperse by explicitely supporting wasm as we're focused on desktop and window behavior, but there was no reason it wouldn't work on wasm so. Do not hesitate to show us your project in the future are projects on wasm are quite rare.

Oh indeed, and it is the correct font ! It seems to render well, that's great πŸ‘

Yes eventually all i needed was a base View that wrapped my main view containing nothing more than:

<Panel Background="White"
       IsVisible="{DynamicResource IsLight}"
       Opacity="0.1" />
<suki:SukiBackground />
<v:MainView/>

To get everything working. To be honest, i'm surprised that it works this well for never being tested πŸ˜„

Well, finally it's just that we don't want to disperse by explicitely supporting wasm as we're focused on desktop and window behavior, but there was no reason it wouldn't work on wasm so. Do not hesitate to show us your project in the future are projects on wasm are quite rare.

I understand, no worries, as long as this workaround keeps working im happy πŸ˜„
Sadly my project is an internal (and very specific) tool that could not be used outside our company, so it won't get released. But if i ever make another one ill make sure to show it ;)

Thank you for the help!!

As I'm working on some projects with AvaloniaUI and SukiUI on WASM, I've confirmed that SukiUI can run on WASM with a few modifications. However, there are some compile-time issues when the dependencies aren’t aligned with Avalonia.

SukiUI 6.0.0-beta.4 works well with Avalonia 11.1.0-beta1.
SukiUI 6.0.0-beta7 works well with Avalonia 11.1.0-rc2.

SukiUI 6.0.0-rc is not tested yet.