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

Open
wants to merge 7 commits into
base: master
Choose a base branch
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

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. The Jira issue, if it exists, is well-described.
    Options
  2. The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
    Options
  3. There is automated testing or an explanation as to why this change has no tests.
    Options
  4. New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
    Options
  5. New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
    Options
  6. New or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
    Options
  7. For dependency updates, there are links to external changelogs and, if possible, full differentials.
    Options
  8. For new APIs and extension points, there is a link to at least one consumer.
    Options

Desired reviewers

@mention

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

Maintainer checklist

Edit tasklist title
Beta Give feedback Tasklist Maintainer checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. There are at least two (2) approvals for the pull request and no outstanding requests for change.
    Options
  2. Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
    Options
  3. Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
    Options
  4. Proper changelog labels are set so that the changelog can be generated automatically.
    Options
  5. If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
    Options
  6. If it would make sense to backport the change to LTS, a Jira issue must exist, be a Bug or Improvement, and be labeled as lts-candidate to be considered (see query).
    Options

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

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

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
4 participants