TOPdesk/operator-recoloring

Comment box type color grey.

youri-a opened this issue · 19 comments

When you type something in the commont box in a ticket you get grey lettres.
2023-11-07 12_00_26-Start

2023-11-07 12_00_46-Start
When you save the commont, the commont looks fine in white.

I use the version in Edge.

I installed the new version 3.12 but don't work.

@youri-a I was hoping this would have been resolved, it looks very similar to #29.

I have been able to reproduce it a few times, unfortunately not consistently. When I do reproduce it, I can see clearly that the Stylus extension has not applied the styling to the comment box. A refresh of the browser (i.e. not the refresh button in TOPdesk), does seem to fix the problem.

Could you let me know if this happens consistently for you? And whether refreshing in the browser is a workable solution?

Hey

I just tested this when I refresh in Edge the first time it's oké.
When I refresh a second time it's back grey.

When I open a new ticket it's back grey and when I refresh is stays grey most of the time.

When I use shift + F5 it gets back white.

I am not sure if it is a reliable reproduction yet, but when I open multiple incidents in the background (using SHIFT + double click on the overview) it looks like I get the issue every time.

Opening incidents one by one, i.e. waiting for them to fully render before opening the next one, tends to not give me the issue.

I will have to go through Stylus builds to see if the issue has been introduced there in the recent past.

@youri-a In the meantime, I've found that disabling and re-enabling the style in the Stylus extension dropdown solves the issue consistently for all tabs that are open.

Neoony commented

Same thing for me just since yesterday 29-11-2023
Portable Firefox 120.0 (64-bit)
Stylus 1.5.38

Actually just noticed my stylus got updated on that same day

When I disable and enable the theme, it gets fixed
But then later the color of text changes again

I guess previous version was 1.5.35
https://addons.mozilla.org/en-US/firefox/addon/styl-us/versions/
I will install and see if it reappears

Neoony commented

Have not seen it so far since I downgraded to 1.5.35
So its going to be something between 1.5.35 and 1.5.38

@Neoony That is great info, thank you!

I've been able to pin down the issue to a commit made on November 2nd that ended up in release 1.5.38 of Stylus. Specifically, commit 02ead94: add option to use adoptedStyleSheets. Unfortunately, I haven't (yet) been able to pinpoint the exact cause of the issue. I'll see if I can reach the Stylus people again to help out.

@Neoony & @youri-a, The same commit that introduced the problem seemingly also provides a solution!

This commit adds a new 'Advanced' feature to stylus to use the new adoptedStyleSheets functionality instead. In other words the styles get applied through JavaScript and not by injecting HTML. When I enable this feature I am then unable to reproduce the problem.

You can find it by clicking the Stylus extension icon, click the cogwheel button to open the 'Options' dialog. There in the 'Advanced' section the second switch, at time of writing, is for 'Circumvent CSP 'style-­src' via adoptedSty­leSheets'. Turn that on, and I think the issue will be resolved.

Raised an issue at Stylus openstyles/stylus#1709

One of the Stylus maintainers found a 'smoking gun', but it'll still require some research to find out why it is not working as expected.

I have provided them with the tools to test the issue, for now that's all I can do.

The issue has been fixed in the Stylus code, which should make its way to you all in the next Stylus release, 1.5.42.

I'll keep this issue open until then.

Neoony commented

The issue has been fixed in the Stylus code, which should make its way to you all in the next Stylus release, 1.5.42.

I'll keep this issue open until then.

Thanks a lot!

Meanwhile I am using the 'Circumvent CSP 'style-­src' via adoptedSty­leSheets' while on 1.5.38 - works fine as a workaround

I tried the 'Circumvent CSP 'style-­src' option that works fine but when i'm opening assets i get this:

2023-12-07 09_28_59-Start

2023-12-07 09_28_15-Start

@youri-a That is really unfortunate.

I have tried with the latest development version and the issue persists there. I have sent a message to the Stylus maintainer to make them aware of the problem and provide them with a reproduction recipe. Since the demo environment is still up for this issue they should be able to take a look themselves.

Neoony commented

Seems like 1.5.41 is out for firefox
I unchecked 'Circumvent CSP 'style-­src' via adoptedSty­leSheets'
And didnt see the issue since. (only just tried for a while however)

Actually not sure what are "assets", or where can I find that, so didnt test that part.

@Neoony be aware that 1.5.41 does not contain the fix for the issue with the comment box text color.

There has been plenty of activity in the Stylus repository, but they have not yet made a new release.

Neoony commented

Thats strange
I have not had the issue since then
'Circumvent CSP 'style-­src' via adoptedSty­leSheets' disabled

Not really sure what triggered it to happen

Neoony commented

Using these settings
image

But I had these same settings when it happened to me on my first post in this Git Issue

No gray/black text in comment boxes

A new version of Stylus is out that includes the fix for this issue. Closing this ticket.