-
Notifications
You must be signed in to change notification settings - Fork 23
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
Modernize the UI design #35
Conversation
7068d55
to
46b51db
Compare
727f218
to
ca2d9d4
Compare
I have deployed the plugin our the Wikimedia Jenkins instance. An example can be seen at https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php74/lastSuccessfulBuild/consoleFull |
I am not sure if it is part of this issue, but when you scroll a litle down, the the 'timestamp block' will jump to top and overlap the 'console section' block |
Indeed! Thank you @mPokornyETM at a quick glance I need to craft another commit that would:
|
The overlap issue is caused by Timestamper plugin panel which became sticky with jenkinsci/timestamper-plugin#287 Any added panels end up being overflown and the sticky panel is transparent. I guess that should be rollback. From my comment earlier I have pushed a new commit that adds timestamper as a test dependency and to ensure the panel holding the list of collapsible sections is always the last element. |
PS: I changed the outline jelly a bit so the border looks like for the timestamper widget and has some margin inside:
|
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.
LGTM
Ah good point, I forgot about that. The styling comes from Jenkins itself using CSS classes |
The Timestamps panel would still overflow over the Console section panel. I would have to test a bit more. Meanwhile I have offered to revert the stickiness at jenkinsci/timestamper-plugin#311 . Long term I think the Jenkins side-panel would need something like:
|
In the outline, the <ul> and <li> elements have a `data-level` stored, that was introduced in 2017 by 8b53705 and as far as I can tell was only used by commented out `console.log()` statements.
The first section started directly as a list item and missed an <ul>. When later changing the outline to use the Jenkins panels styling, that causes the first element to not have the necessary marging/padding and have it sticked to the left border. Make generateOutlineSection() to start with an <ul>, which adds the missing one from the first section. Doing so also let us remove the ul creation when inserting childs, since they are generated by generateOutlineSection() and thus get an <ul>.
Indeed the background became opaque as part of 0419465f4dea7652dd9d85ae8a53a70a46fd834b / jenkinsci/jenkins#9148. That was first released in jenkins-2.463 and is part of jenkins-2.479.1
Yeah it looks like to be how we would stick an element before position: sticky; top: 0 got introduced in web browsers. So essentially, the JavaScript code attached to |
I have added some more changes to the pull requests:
The
That addresses @mawinter69 remark about lack of padding. What I found is the first section were added without a
That is manually adjusting our
That is some magic Stylelint, I can probably send that as an individual pull request.
This replace the pane to use
Addressed previously, else the TimeStamper plugin or some other panels can be inserted AFTER the collapsible section pane which itself can be fairly long when there are lot of sections. |
Looks like I can replace most of the duplicated HTML by |
I wrote a custom formatter function to emit: - a string based report to the console for human consumption - a CheckStyle XML report for CI
Replace the collapsible sections with a `<details>` HTML Element, this has been available in all browsers since early 2020. It defaults to being collapsed and showing the `<summary>` content. Toggling is handled by the browser which let us get rid of the `doToggle()` script (which also had duplicate logic to support IE 8). The styling is inspired from Jenkins values and some shadow is casted at the bottom of the sections to help differentiate them.
And finally I have added a last commit which removes all the scrolling code in favor of using CSS To avoid the overlapping texts at #35 (comment) , I have made the pane background solid instead of transparent. That would no more be needed with later Jenkins. This is what I got with just 3 sections, the pane that is below is the Timestamper plugin: I think that is finally good to go. I have deployed it on the Wikimedia Jenkins, an example is https://integration.wikimedia.org/ci/job/wmf-quibble-vendor-mysql-php74/lastSuccessfulBuild/consoleFull |
...resources/org/jvnet/hudson/plugins/collapsingconsolesections/CollapsingSectionNote/script.js
Show resolved
Hide resolved
Other plugins add sidebar elements and the order in which they are added depends on how fast their `fetch()` requests are fulfiled. The Timestamper outline is slightly slower to respond and is most often put last as a result. Add an observer for any child changes made to the sidebar, when the collapsible sections panel is not the last, move it after the last panel ensuring it is always last. Add Timestamper as a test dependency to ease testing when using hpi:run.
The panel holding the section was made to stick to the top when the window was scrolled. Nowadays this can be achieved with the CSS property `position:sticky`. Remove the JavaScript code attached to `window.onscroll`. Drop the now unused div.scrollAttached The panel is made to stick at 44px from the top, which is the value used by the Timestamper plugin. Before Jenkins 2.463/2.479.1, the pane is transparent and overlapping two sticky had the texts overlayed which. Made it use a solid background, thus when scrolling, the second panel hides the first one.
@mawinter69 & @mPokornyETM the last iteration addresses all the remarks you have mentioned. There is some glitch with the Timestamper plugin which is addressed with more recent version that uses a solid background. I have made the collapsible section panel to always be last since it can potentially be very long. There was some UI freeze which was caught over the week-end and that I have addressed. I have never tested my code on a job console that does not have any section :D (solved: https://phabricator.wikimedia.org/T378864 ). If that looks good, I will merge it and release a new version. |
Replace the collapsible sections with a
<details>
HTML Element, this has been available in all browsers since early 2020. It defaults to being collapsed and showing the<summary>
content. Toggling is handled by the browser which let us get rid of thedoToggle()
script (which also had duplicate logic to support IE 8).Add StyleLint to validate the CSS with a custom formatter function to emit:
The styling is inspired from Jenkins values and some shadow is casted at the bottom of the sections to help differentiate them.
Rendering: https://phabricator.wikimedia.org/F57652063
Downstream task: https://phabricator.wikimedia.org/T378327
Submitter checklist
Link to relevant issues in GitHub or JiraLink to relevant pull requests, esp. upstream and downstream changes