-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update styling of SourceFilePage content #1609
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
base: master
Are you sure you want to change the base?
Update styling of SourceFilePage content #1609
Conversation
4d29482
to
5c70d41
Compare
By the way, I have a few side questions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wowo
@huangsam Regarding your side questions:
|
Thanks for sharing about the details of the CI environment and the commitment to all the JDKs. That helps me understand the background of the project better. Feel free to review the PR contents at your convenience. I look forward to further collaborations on the HTML component of Jacoco. |
@marchof any chance that you or another contributor can review the changes here? |
@huangsam Thanks for your contribution and sorry for our silence. This is just a spare time project. To be honoest, I don't like the new design as the line numbers now have the exact same style as the code. Can we still render the line numbers in a more dim style (like same color as before)? |
@huangsam Because I didn't find the time to check the code myself: Did you check that the fragment references still work? Like this link jumps to the specific method. |
@marchof I addressed the line numbers. Also applied CSS variables to |
@marchof yes I checked that the fragment references are still respected. My CSS changes are only adjustments to existing CSS classes. I don't remove existing line-by-line CSS such as |
Hi @huangsam Looks like there is many aspects now in this PR (editor settings, Java code refactoring, changing the style, introdusing css variables). Please try to do one thing at a time in a PR. So the PR has clear scope and we can focus on the solution of that specific problem. |
Fair point @marchof. If anything, the essential changes for this PR are from the CSS file. Everything else is optional and can be added in later PRs |
@marchof there's only one file with diffs now |
@marchof hello. Is there anything else that concerns you regarding the changes in this PR? |
62ed575
to
a3bcce3
Compare
Update styling of SourceFilePage content.
Overall goal
By making this change, we can move towards the type of source-code formatting that Golang uses (example) and Rust uses (example) - which is less "box-like" and more minimal. IMO the minimal nature of the new style seems easier to read but I'd be happy to change things up if needed. Overall, this aligns with the spirit of #756 and #1355.
Technical detail
I made changes to the
report.css
so that we are leveraging CSS variables for different gradients of grey across the HTML report. This introduction improves readability, and also allows for future contributors to define and apply colors consistently.Developer experience
Took me a little while (but not impossible) to understand this (internal) architecture of the HTML logic:
Could be useful to put some high-level docs at the
ReportPage
orNodePage
layer to guide folks in the right direction, in case they want to make extensions to any particular Jacoco report.Items to tackle in separate PRs
Item 1: Some Java files could be changed to some Java files to improve their readability. These Java changes make it easier to understand where to make changes in case folks want to make the jump from Prettify (archived) to Highlight.js.
Item 2: I also noticed that there was a mix of tabs and spaces in various source files (from my changes) due to Intellij's default settings. So we can add an
.editorconfig
so that all editors which support EditorConfig will respect this styling preference.Current style (from vanilla run of jacoco right after
./gradlew test
):New style (done live in Chrome Dev Tools, not from a fresh copy of jacoco - not sure how to do that):