openui5 icon indicating copy to clipboard operation
openui5 copied to clipboard

The dark mode is applied only after handling the cookies popup on UI5 1.132.x and OpenUI5 1.133.x

Open pubmikeb opened this issue 1 year ago • 6 comments

Open https://ui5.sap.com/1.132.0 or https://openui5nightly.hana.ondemand.com in Chrome's incognito mode (no AD blockers or any other content filter) — UI5 / OpenUI5 will be loaded in light mode, even if your browser is in dark mode, e.g.:

Image

The proper mode is applied only after accepting/rejecting cookies (e.g. pressing «Understood»). If using an AD blocker, no cookies popup is displayed, and a user gets the UI5 / OpenUI5 in light mode.

The UI5 documentation prior 1.132.x and OpenUI5 1.133.x have no such an issue, the dark mode is active automatically.

pubmikeb avatar Jan 21 '25 08:01 pubmikeb

Thank you for sharing this finding. I've created an internal incident DINC0389455. The status of the issue will be updated here in GitHub.

JumpNRun avatar Jan 22 '25 16:01 JumpNRun

It looks like, the problem is with the new cookies popup window, thus it might be, that the openui5-docs project is more relevant place to filing this issue.

pubmikeb avatar Jan 24 '25 08:01 pubmikeb

@pubmikeb SAP/openui5-docs and SAP-docs/sapui5 contain only the static documentation content such as the text, images, snippets, etc. that can be found in /topic/<...>. On the other hand, issues found in the Demo Kit implementation itself such as its theming, cookie handling, source for the API Reference (/api), Samples (/controls), etc. should be rather reported in this SAP/openui5 repo since their source code is maintained here.

boghyon avatar Jan 27 '25 12:01 boghyon

Hello @pubmikeb ,

It sounds that prior versions were working for you as a side effect.

I tested incognito mode (Chrome Version 132.0.6834.160 on MacOS) and it shows the "Understood" footer with Adblock Plus every time when I close/open the incognito mode window.

This is expected because the browser is not supposed to keep any of your cookie settings on reopening as mentioned here:

https://www.cookielawinfo.com/incognito-cookies/#:~:text=Incognito%20mode%20clears%20local%20data,browsing%20on%20a%20user's%20device.

If I accept the dialog (with Adblock Plus active), choose dark theme and refresh the incognito window in the same session (without closing it and losing the cookie settings) the theme remains dark.

I believe there is no issue here.

Regards, Plamen Ivanov

plamenivanov91 avatar Jan 31 '25 10:01 plamenivanov91

@plamenivanov91, thanks for checking this ticket,

Actually, I believe, the problem I've reported here has nothing to do with the cookies. As we know, UI5 is capable detecting which mode (light or dark) is used on a client side and acts accordingly.

The essence of the problem: If prior the version 1.132.0 UI5 used to detect the light/dark mode before accepting/declining cookies, starting 1.132.0 with the new Cookies-Prompt, the behavior has changed: by default UI5 is loaded in a light mode and only after dealing with the cookies popup UI5 decides which mode to use and if required, UI5 switched to the dark mode.

Repro steps:

  1. Open Chrome/Edge in dark mode in privacy mode without any content blockers
  2. Visit https://ui5.sap.com/1.131.0/

Expected result: UI5 page will be loaded completely in a dark mode, even before answering the cookies popup.

Outcome in fact: UI5 page is loaded completely in a dark mode, even before answering the cookies popup:

Image

  1. Close and reopen Chrome/Edge in dark mode in privacy mode without any content blockers
  2. Visit https://ui5.sap.com/1.132.0/

Expected result: UI5 page will be loaded completely in a dark mode, even before answering the cookies popup.

Outcome in fact: UI5 page is loaded in a light mode, only cookies popup is in a dark mode:

Image

And only after answering the cookies question, UI5 will be loaded in a proper mode, according to the browser settings:

Image

That's what I mean under this ticket, IMO, it's an regression comparing to the 1.131.0. Thus, please, consider reopening this ticket.

pubmikeb avatar Jan 31 '25 10:01 pubmikeb

@jdichev can you confirm the described behavior? If yes, is this by design?

flovogt avatar Feb 13 '25 07:02 flovogt