GitHub-Dark icon indicating copy to clipboard operation
GitHub-Dark copied to clipboard

Syntax coloring is wrong with new code navigation beta

Open Jackenmen opened this issue 4 years ago • 20 comments

  • Browser: Chrome
  • Operating System: Windows 10
  • Link to page with the issue: https://github.com/mikeshardmind/SinbadCogs/blob/v3/antimentionspam/antimentionspam.py
  • Screenshot: GH did some changes to syntax coloring style and now syntax coloring looks badly on GH Dark, and it doesn't resemble how Monokai theme looks in code editors at all :( How it looks on GH Dark chrome_2020-01-11_13-53-44 How it looks on regular GH chrome_2020-01-11_13-49-04

How it looked before on GH Dark (without code navigation, you can see it when you're not logged in): opera_2020-01-11_14-10-31 How it looked before on regular GH (without code navigation, you can see it when you're not logged in): image

Jackenmen avatar Jan 11 '20 13:01 Jackenmen

For anyone looking into this, this looks to be Monokai - Spacegray Eighties not the regular Monokai theme.

xt0rted avatar Jan 11 '20 16:01 xt0rted

Yeah, sorry for not saying that, but the new code navigation beta makes all Syntax coloring themes look wrong anyway.

Jackenmen avatar Jan 11 '20 16:01 Jackenmen

Yeah, sorry for not saying that, but the new code navigation beta makes all Syntax coloring themes look wrong anyway.

Well thats not exactly good news =(, we have umpteen themes and could use the help in this. :+1: :heart:

the-j0k3r avatar Jan 11 '20 17:01 the-j0k3r

It looks like they're adding classes when code navigation is enabled. On the first line of that code file the annotations text isn't wrapped in a span, so it's getting the default text color from the theme. But with code navigation enabled it's being wrapped in .pl-s1. If we try to fix this we'll probably just make things worse elsewhere.

xt0rted avatar Jan 11 '20 17:01 xt0rted

We could also argue that the whole syntax coloring with code navigation enabled and GH Dark not installed looks wrong too, so it's actually an issue on GitHub's side, I mean, the new syntax coloring is just wrong in general... This is how part of the code looks with code navigation enabled: chrome_2020-01-11_18-19-32 And this is how it looks with it disabled: chrome_2020-01-11_18-19-39

Jackenmen avatar Jan 11 '20 17:01 Jackenmen

How can we compete, I ask with those issues in place? But since you mentioned this was a beta, them I would suggest you file that bug upstream or send them feedback, GitHub should know about this at this beta stage.

With that taken care of, then we can revisit this when feature is more mature.

Im putting a external label on this as a reminder of the above.

the-j0k3r avatar Jan 11 '20 17:01 the-j0k3r

I too noticed .pl-s1 being used a lot more with navigation enabled. That class is colored in many of our themes but neutral in GH's theme so they probably didn't even notice the issue. Maybe we should just remove coloring from that one class in all themes.

In general, our themes aren't that great and could be improved significantly. I wonder if there is a repo of themes and their colors that could be used to programmatically build themes instead of the current manual approach.

silverwind avatar Jan 11 '20 21:01 silverwind

In general, our themes aren't that great and could be improved significantly. I wonder if there is a repo of themes and their colors that could be used to programmatically build themes instead of the current manual approach.

yep and yep. But I doubt theres such a repo with the themes we use and to actually do it programmatically some 10+ themes would require some special magic and a good commitment to start/finish that job, I'll help where I can when I can but this is outside my current skills with JS.

That class is colored in many of our themes but neutral in GH's theme so they probably didn't even notice the issue. Maybe we should just remove coloring from that one class in all themes.

I disagree with this route, we shouldn't be adapting our already not great themes to beta/production buggy upstream features. These bugs need to be reported upstream and it should be fixed upstream. Then we can deal with whatever.

the-j0k3r avatar Jan 12 '20 07:01 the-j0k3r

some 10+ themes would require some special magic

I'm happy to reduce the amount of themes to a handful of well-supported ones. Quality over quantity.

silverwind avatar Jan 12 '20 11:01 silverwind

I'm happy to reduce the amount of themes to a handful of well-supported ones. Quality over quantity.

We have 8 themes that have all counter parts GitHub | CodeMirror | Jupyter , so that would be a good place to start, though at any rate to generate themes for those alone still no easy task in automation.

the-j0k3r avatar Jan 12 '20 11:01 the-j0k3r

Can I disable code navigation on the client (i.e. my) side or is this something Github just rolled out for selected repositories and that is now active for all repos? I don't really care about code navigation, but I do care about proper code highlighting.

See also #1132 for a duplicate issue with the Twilight theme.

FichteFoll avatar Jun 19 '20 10:06 FichteFoll

@FichteFoll the changelog posts on the blog will show when this was enabled for the various languages (more on the help site). There's currently no way to disable it either.

xt0rted avatar Jun 19 '20 16:06 xt0rted

@lee-dohm would a report via contact with a link to this issue be OK with you?

Sorry for shameless ping =)

the-j0k3r avatar Jun 19 '20 17:06 the-j0k3r

The green text in Twilight also bothers me a tiny bit, maybe I'll check it out later.

silverwind avatar Jun 20 '20 07:06 silverwind

@the-j0k3r Sorry, I'm just coming back from a two-week vacation and I'm still catching up 😀 If you're asking if it's ok with me that you contact GitHub Support to report an issue with the new code navigation beta, then, in general, yes that's completely fine with me 🙂 If I'm missing some nuance to the situation ... could you be more specific? (Or wait for me to get caught up on all the other things I've got swirling around my head right now and then I'll circle back 😆)

lee-dohm avatar Jun 22 '20 17:06 lee-dohm

@silverwind I think this commit only fixes the issue mentioned in #1132, not the whole issue with syntax coloring that happened due to GitHub's new code navigation feature.

Jackenmen avatar Jul 21 '20 20:07 Jackenmen

Related: #256

auscompgeek avatar Dec 28 '20 12:12 auscompgeek

If the issue isnt fixed upstream, and the indication is thats this is the new normal, since, for codemirror, e.g. twilight you need 35 colors, the new codemirror CSS vars are only 19 at this time.

Their prettylights CSS vars are 30 strong so this is the closest we get unless we add more vars in the modding world of themes, at some stage it maybe better just todo our own thing for greater quality or try to integrate with their new vars system and be left wanting for some themes.

I have a POC for syntax theme switcher based on the latter only twilight working across all required stylesheets, but needs more work before its released into wild namely assign css vars to the tokens atm its mostly colors for the alpha test.

Please do report any issues to GH with syntax themes, this feedback is whats needed to get this resolved.

the-j0k3r avatar Dec 28 '20 15:12 the-j0k3r

Not so long ago I tried reaching out to GitHub on Twitter since the feedback sent through their private feedback form didn't get any response. I tried to explain the issues as detailed as possible, but I can only really talk about Python's syntax coloring as that's what I'm using most of the time.

Maybe someone will want to join with their own feedback or just share it so I hope people won't mind me sending a link here: https://twitter.com/JakubKuczys/status/1337562630391812098

Jackenmen avatar Dec 28 '20 17:12 Jackenmen

For contact I suggest the new and probably the right place https://support.github.com/tickets/personal/0

the-j0k3r avatar Dec 28 '20 17:12 the-j0k3r