eclipse / dirigible

Eclipse Dirigible™ Project
https://www.dirigible.io
Eclipse Public License 2.0
268 stars 86 forks source link

Forms doesn't load properly in Chrome incognito mode and Safari #4134

Closed iliyan-velichkov closed 2 weeks ago

iliyan-velichkov commented 2 weeks ago

Chrome Incognito mode image Video: https://github.com/eclipse/dirigible/assets/5058839/2d9a46d6-9a10-42f3-9fe5-01ac7afd599e

vs

image

Safari: image

iliyan-velichkov commented 2 weeks ago

Findings:

iliyan-velichkov commented 2 weeks ago

Without opening the IDE: https://github.com/eclipse/dirigible/assets/5058839/2d9a46d6-9a10-42f3-9fe5-01ac7afd599e vs with opening the IDE first: https://github.com/eclipse/dirigible/assets/5058839/a4cc65c2-e086-4a72-8927-137d634a23d2

StanZGenchev commented 2 weeks ago

This is not a problem with forms or with incognito mode at all. It affects all views. The "problem" is that in order to have proper theming, the theme directive gets the theme config from local storage. If there is no default config, it will get an empty object. The default theme config is created in core-modules by calling the theming provider upon initial Dirigible load, not by the views. And this is where the true "problem" is. Dirigible views are not meant to be viewed separately outside of Dirigible, so if you run them in a separate tab in a "clean" environment, the defaults will never be set. If we want a view (in this case a form view) that uses Dirigibles UI, but is not a Dirigible view itself, to work outside of Dirigible, then we can inject the theming provider in the Theme factory inside components/resources/resources-core/src/main/resources/META-INF/dirigible/resources-core/ui/theming.js.