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

[JENKINS-72944] reduce spacing in buildhistory widget #9122

Closed
wants to merge 7 commits into from

Conversation

mawinter69
Copy link
Contributor

@mawinter69 mawinter69 commented Apr 3, 2024

the logic when name, details and badges arrangement is changed so that the available space is better used.
The stop action is no longer treated as separate thing, instead it is just like all other badges. The stop button will always be in the far right. The width calculation now considers the actual width of the content and not of the element they are in. When name and badges fit in one row they will be joined.
badges are using a flex layout that should allow for better alignement and will automatically wrap the elements though this only happen now when the badges are in their own row and still to large

Add a resize handler so when the sidepanel switch to/from tablet mode or size is changed in tablet mode then the table layout is recalculated.

The pictures show builds with many badges (gerrit, build trigger badge, keep build forever, job config change, disk usage)

Screenshots before Full width window:
  • line break inside the disk usage badge
  • no space between badges
  • bad alignement (see build 11530)

image

~850px width window
image

min-width window (483px)
image

Running build
image

after going to full-screen from min-width window
image

Screenshots after

Full width window with running build
image

~850px width window
image

min-width window (483px)
image

See JENKINS-72944.

Testing done

Manual testing

Proposed changelog entries

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

the logic when name, details and badges arrangement is changed so that
the available space is better used.
The stop action is no longer treated as separate thing, instead it is just
like all other badges. The stop button will always be in the far right.
The width calculation now considers the actual width of the content and
not of the element they are in. When name and badges fit in one
row they will be joined.
badges are using a flex layout that should allow for better alignement
and will automatically wrap the elements though this only happen now
when the badges are in their own row and still to large

Add a resize handler so when the sidepanel switch to/from tablet mode or
size is changed in tablet mode then the table layout is recalculated.

[JENKINS-70246] the sidepanel is now fixed width when total width is
larger than 900px.
@NotMyFault NotMyFault requested a review from a team April 4, 2024 16:34
@NotMyFault NotMyFault added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted needs-security-review Awaiting review by a security team member labels Apr 4, 2024
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't closed inspected the JavaScript, its quite complex. Something like handlebars would likely clean the code up a lot but may be complicated by the fact the badges are loaded in via jelly


Screenshots and testing looks good to me

Copy link
Contributor

@Kevin-CB Kevin-CB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested your PR locally, it looks fine security wise.

However, I've noticed minor bugs.
When I build an empty freestyle project and add a build description, the ordering gets messed up, placing the description first and the left bar in the middle of the character. Note that this seems to only happen on the last build.
image

Also, when there are no badges on my build, I encounter some errors.
image

@Kevin-CB Kevin-CB added security-approved @jenkinsci/core-security-review reviewed this PR for security issues and removed needs-security-review Awaiting review by a security team member labels Apr 8, 2024
mawinter69 and others added 3 commits April 8, 2024 17:40
ensure description is at the end, handle no badges properly
@mawinter69
Copy link
Contributor Author

However, I've noticed minor bugs. When I build an empty freestyle project and add a build description, the ordering gets messed up, placing the description first and the left bar in the middle of the character. Note that this seems to only happen on the last build. image

Fixed

Also, when there are no badges on my build, I encounter some errors. image

fixed

@mawinter69
Copy link
Contributor Author

given ongoing work by @janfaracik in #9148 to rewrite the build history widget does it make sense to merge this?

@timja
Copy link
Member

timja commented Apr 12, 2024

Let's mark as on-hold, we can always pick it back up later if needed.

/label on-hold

@comment-ops-bot comment-ops-bot bot added the on-hold This pull request depends on another event/release, and it cannot be merged right now label Apr 12, 2024
@github-actions github-actions bot added the unresolved-merge-conflict There is a merge conflict with the target branch. label Apr 23, 2024
Copy link
Contributor

Please take a moment and address the merge conflicts of your pull request. Thanks!

@mawinter69
Copy link
Contributor Author

close in favor of #9148

@mawinter69 mawinter69 closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on-hold This pull request depends on another event/release, and it cannot be merged right now rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted security-approved @jenkinsci/core-security-review reviewed this PR for security issues unresolved-merge-conflict There is a merge conflict with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants