Skip to content

feat: collapsible per-job sections on the Deployment View - #45

Merged
kurok merged 1 commit into
masterfrom
feat/collapsible-job-rows
Sep 18, 2026
Merged

kurok merged 1 commit into
masterfrom
feat/collapsible-job-rows

Conversation

@kurok

@kurok kurok commented Sep 18, 2026

Copy link
Copy Markdown

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 in dashboard.js on 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 does the same job with no stylesheet to reintroduce, since 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.

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 localStorage per job — wrapped in try/catch, since a private window throws there rather than returning null.

The toggle is a real <button> with aria-expanded and aria-controls, and the test asserts the attribute follows the visual state rather than merely being present.

Tests

  • structure — one summary row and one environment section per job, and all four environment rows present in the HTML
  • CSP — no inline event handlers anywhere in the table
  • behaviour — clicking collapses that job and leaves the other expanded

The last one fails without the handler:

clickingTheToggleCollapsesOnlyThatJob
  clicking the toggle must collapse that job ==> expected: <true> but was: <false>

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:

e2e OK: dashboard shows both environments at 3.1.4, and the link redirects with its query string intact
edb-job rows: 2 · env sections: 2 · toggles: 4 · inline onclick: 0

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.

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>
@kurok
kurok merged commit 8fde8f3 into master Sep 18, 2026
12 checks passed
@kurok
kurok deleted the feat/collapsible-job-rows branch September 18, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Collapsible per-job rows on the Deployment View (from upstream PR jenkinsci#8)

1 participant