feat: collapsible per-job sections on the Deployment View - #45
Merged
Merged
Conversation
One summary row per job -- environment count, newest release anywhere, and a toggle -- followed by that job's environment rows in their own tbody. A dashboard with many jobs times many environments stays scannable. The upstream PR this comes from cannot be applied: it is against the 2020 code, bundles the getActions fix we already have, and puts the toggle logic in an inline <script>, which is what JENKINS-74429 removed. The behaviour lives in dashboard.js with the existing delegated handler. Two departures from the issue. It says to put .edb-collapsed in blink.css, but #42 deleted that stylesheet when the modal moved to core's dialog. Toggling the hidden attribute instead does the same thing with no stylesheet to bring back: browsers already style [hidden] as display:none. It also suggests shipping chevron.svg; ionicons-api is already a dependency, so the chevron comes from there. Collapsing is client-side and the rows are always in the served HTML, so anything reading the page without running scripts still sees every deployment. Default is expanded up to five jobs and collapsed beyond that, with whatever the viewer opens remembered in localStorage per job -- wrapped in try/catch, since a private window throws rather than returning null there. The toggle is a real <button> carrying aria-expanded and aria-controls, which the test asserts follows the visual state rather than only looking right. Tests: structure (one summary row and one environment section per job, every environment row present in the HTML), no inline event handlers anywhere in the table, and the behaviour itself -- clicking collapses that job and leaves the other alone. That last one fails without the handler with "clicking the toggle must collapse that job ==> expected: <true> but was: <false>". e2e asserts the summary rows and environment sections reach a real Jenkins. Verified against a container locally before pushing rather than after: assert.sh green, 2 summary rows, 2 environment sections, 4 toggles, 0 inline handlers. Signed-off-by: kurok <22548029+kurok@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #40.
One summary row per job — environment count, newest release anywhere, and a toggle — followed by that job's environment rows in their own
tbody. A dashboard with many jobs × many environments stays scannable.The upstream PR cannot be applied: it is against the 2020 code, bundles the
getActions()fix we already have from #16, and puts the toggle logic in an inline<script>— which is exactly what JENKINS-74429 removed. The behaviour lives indashboard.json the existing delegated handler.Two departures from the issue
It says to put
.edb-collapsedinblink.css— but #42 deleted that stylesheet when the modal moved to core's dialog. Toggling thehiddenattribute does the same job with no stylesheet to reintroduce, since browsers already style[hidden]asdisplay: none.It also suggests shipping
chevron.svg;ionicons-apiis already a dependency, so the chevron comes from there.Degrades properly
Collapsing is client-side and the rows are always in the served HTML, so anything reading the page without running scripts still sees every deployment. Default is expanded up to five jobs, collapsed beyond, with the viewer's choice remembered in
localStorageper job — wrapped in try/catch, since a private window throws there rather than returning null.The toggle is a real
<button>witharia-expandedandaria-controls, and the test asserts the attribute follows the visual state rather than merely being present.Tests
The last one fails without the handler:
Verified against a real container before pushing
My last e2e assertion broke in CI because I reasoned about the markup instead of looking at it. Not this time:
Local
mvn clean verify: 47 tests, green.Not included
No view setting for the default state. The view's
configure()still ignores its JSON (noted back in #16), so adding a persisted option means fixing that first — worth its own change rather than smuggling it in here.