Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: add a dark mode for GOSSAFUNC html output #34325

Closed
agnivade opened this issue Sep 16, 2019 · 10 comments
Closed

cmd/compile: add a dark mode for GOSSAFUNC html output #34325

agnivade opened this issue Sep 16, 2019 · 10 comments
Labels
FeatureRequest FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@agnivade
Copy link
Contributor

What version of Go are you using (go version)?

$ go version
go version go1.13 linux/amd64

It would be very helpful to have a dark mode switch for the GOSSAFUNC html file. Staring at the white screen for a long time at night is stressful to the eyes.

Just an inverted color scheme with the proper highlight colors and a checkbox at the top to toggle scheme should be good enough.

Marking it as help wanted, as it's a good started issue for anybody looking to contribute. The relevant code is in this file - https://github.com/golang/go/blob/master/src/cmd/compile/internal/ssa/html.go

@ysmolsky

@agnivade agnivade added FeatureRequest help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 16, 2019
@agnivade agnivade added this to the Unplanned milestone Sep 16, 2019
@robpike
Copy link
Contributor

robpike commented Sep 17, 2019

If your screen stresses your eyes, your brightness is set too high. I prefer a light background but the background brightness is comparable to the rest of the room. This is the way things should be set up, so your eye accommodates equally to the screen and the environment.

I'm not in favor of dark mode but I know I am in the minority. Research shows it causes more eyestrain than properly set up light backgrounds. I do not expect to win this argument.

@josharian
Copy link
Contributor

I have also had problems particularly with ssa.html. I subscribe to the “turn down the monitor” and “use red shifting” philosophies, but ssa.html is peculiarly bad.

Just switching away from programmer white to a gentler background color might help a lot.

Also, some of the highlight colors get lost or muddled when red-shifted. I have no idea how to fix that. Colors are subtle.

@agnivade
Copy link
Contributor Author

I have already done all of that. Low brightness, red filter (had been using f.lux but switched to redshift couple of years back).

But I recently started to use the dark reader chrome extension, and everything seems so easy on the eyes at night. I do realize it's a personal choice at the end of the day. That's why I suggested a small opt-in switch for people who want to use it. No harm in that :)

Also, some of the highlight colors get lost or muddled when red-shifted.

I have been using redshift for a while now. Never had an issue with the highlight colors. So I think a new set of colors for the dark background should not be an issue.

@ALTree
Copy link
Member

ALTree commented Sep 17, 2019

Since the file is viewed using the browser, wouldn't a dark mode browser extension also work?

@agnivade
Copy link
Contributor Author

It doesn't work. I don't know why. But even if it did, it's just a generic solution. It won't have bg-specific highlight colors. I would like the ssa.html itself to have a dark mode switch.

@bradford-hamilton
Copy link
Contributor

Hey yall, I'm going to start working on this!

@josharian
Copy link
Contributor

Awesome. Ask if you have questions. One item of note: It is an explicit goal that ssa.html is a single, standalone file—so go ahead and slap all that css and goo right into the html head. :)

@bradford-hamilton
Copy link
Contributor

Thanks @josharian, will do. Yes, it seemed like a really intentional decision - I will follow suite with the rest of the file.

@gopherbot
Copy link

Change https://golang.org/cl/220260 mentions this issue: cmd/compile: Add a dark mode to ssa html generation which can be toggled

@bradford-hamilton
Copy link
Contributor

Okay, just submitted a patch for this - let me know if it's what you all were thinking!

@golang golang locked and limited conversation to collaborators Mar 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants