cryptee / web-client

Cryptee's web client source code for all platforms.
https://crypt.ee
Other
444 stars 22 forks source link

[Feature] Dark mode friendly PWA splash screen #93

Open schaafjs opened 3 years ago

schaafjs commented 3 years ago

Is your feature request related to a problem? Please describe. I prefer the dark version of cryptee on my mobile device but this setting is not respected by the splash screen since that is most likely a hardcoded image.

Describe the solution you'd like A dark mode friendly PWA splash screen which is either the standard or switches based on the theme selected by the user.

Additional context n/a

brendanperry commented 3 years ago

I agree this would be a nice fix.

PreciselyPixels commented 3 years ago

Yet to be fixed with crypt.ee 3.0

johnozbay commented 3 years ago

Hey there! Funny thing is that we actually did fix this for v3.0 initially : https://github.com/cryptee/web-client/blob/7ae4124034a8227fc26637fc8557e001e916bae6/source/imports/www/webapp-head.kit#L16-L94

BUT. Turns out there's a big Safari bug that made things even worse. Basically Safari caches app icons & start screens at the moment of installation, and keeps using those forever. So if you had dark mode on when you installed Cryptee it gets stuck in dark mode boot images etc.

What's more is that your boot images may also get stuck on the install-moment orientation of your device (i.e. if you installed Cryptee while your iPad was in portrait mode, if you launch Cryptee in landscape the splash images stretch out to fill the screen 🤦🏻‍♂️ ) thx apple. Both are known webkit bugs, and hopefully someone will fix them soon. Here's a relevant thread if you'd like to read more about all the ios specific splash screen bugs.

Until then, we had to make a choice to go with one or another. So we checked what other apps do, and majority of the ones we checked seemed be going with light-mode as default in these situations, so that's what we did. As soon as webkit fixes these bugs, we'll enable the dark mode splash screens.

Hoping this makes sense! ✌🏻

ghost commented 3 years ago

Does the same apply to Blink-based browsers like Chromium? I experience similar situation with the Chromium Browser on my Android device

johnozbay commented 3 years ago

@makkussu It's entirely possible! Pretty much every browser, blink-or-not, implement PWA manifests differently. Mainly because the idea of PWAs are still too new (in internet years), there's very little standardization, and lots of work-in-progress changes.

PWA installation flows / implementations differ even among blink-based browsers (and even operating systems) nowadays. i.e. Edge & Chrome have different installation badging & flows for PWAs even on same OSes.

Firefox introduced bunch of bugs with PWA installations recently, causing icons to appear white (#113) etc.

All this aside, –funnily enough– the concept of "dark-mode" itself is still too new for the web & operating systems. i.e. our editor now supports full-dark-mode (dark background, white text), and we have to convert dark background to light background right before things are printed so that you won't empty the ink cartridge printing all black. Turns out some browsers auto-disable dark mode before rendering the page for print (yay!), and some don't (fuuuuck!). So to combat this, we have to watch for the "print" event, turn on light-mode before opening the print dialog, wait for browser to render the document for print, then restore dark-mode. 🤦🏻‍♂️ (here's where all this magic happens if you want to check the code)