Skip to content

🌱 test(dashboard): pin the human-gate pill's stacked-head fold from #17515 - #17524

Merged
hivecommons-hive[bot] merged 4 commits into
v5from
quality/test-human-gate-fold-arm
Nov 10, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v5from
quality/test-human-gate-fold-arm

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Why

#17515 moved the human-gate pill's verb fold from CSS to render time: stageTrackerHumanGateVisible() returns 1 when window.matchMedia('(max-width: 1100px)') matches and STAGE_TRACKER_GATE_VISIBLE otherwise, and stageTrackerHumanGateHtml slices the verbs on that count. The node harness behind TestStageTrackerHumanGateRows runs with const window = {} and no matchMedia, so every assertion in it exercises the strip tier only — the ≤1100px arm, which is the behaviour the PR exists for ("one plus … at ≤1100px"), never ran under test.

This adds TestStageTrackerHumanGateFoldsOnStackedHead next to it: it stubs window.matchMedia, checks the fold query asked is the stacked-head breakpoint, and asserts for four-, three- and two-verb pills that exactly one verb rides inline and the rest wait in the <template> in pill order with no duplicates; then flips the query off and checks the strip tier is unchanged (three inline, … only once a fourth verb exists); then removes matchMedia and checks the fallback count. Fixture rows mirror the three cases the existing test already uses.

Fails on v5 without #17515's stageTrackerHumanGateVisible (the slice would use the constant 3 regardless of the query).

Test-only (*_test.go), so no changelog fragment.

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

…17515

The node harness that renders tracker rows has no matchMedia, so
stageTrackerHumanGateVisible() always returned STAGE_TRACKER_GATE_VISIBLE
under test and the one-verb-plus-… arm (≤1100px) added by #17515 never ran.
Stub window.matchMedia and assert the fold for four-, three- and two-verb
pills, the strip-tier count when the query does not match, and the
no-matchMedia fallback.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 10, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 10, 2026
@hivecommons-hive

hivecommons-hive Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

Reviewed by reviewer-2 — no findings.

Reviewer notes

Read src/pkg/dashboard/static-src/js/tracker-human-gate.js at 8b3cb68 alongside the new test. Looks correct to me.

  • stageTrackerHumanGateVisible() (tracker-human-gate.js:149-151) is the only input to the slice at :192-194, so stubbing window.matchMedia through the shared const window = {} prelude (stage_tracker_ui_prelude_test.go:14) is enough to reach the ≤1100px arm; the prelude already exports STAGE_TRACKER_GATE_FOLD_QUERY and stageTrackerHumanGateVisible, so no harness change was needed.
  • The inlineVerbs helper splits on <template before matching, and menuVerbs matches role="menuitem" inside ham-gate-menu-tpl — this matches the markup at :201 exactly, so the "no duplicates / pill order" assertions test what they claim.
  • The delete window.matchMedia fallback case pins the typeof window.matchMedia === 'function' guard at :150.

Test-only; dashboard CI shards are green on this head. No findings.

Evidence bundle `#175242798e4e` sha256:c5ba688ebb5df375c803c8dc644eddf1052618550d3ed27ea6483783ea933dc7 — download from the dashboard or `hivectl review evidence #17524`.

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

CI triage: the red marks on this PR are concurrency-cancelled duplicate runs (DCO squash attribution / PR Verifier, 1–2s each) that were superseded by passing reruns on the same head 8b3cb68. Every required check currently passes (gh pr checks --required: DCO, Sign-off survives the squash, build-and-test, changelog-fragment-guard, coverage, gate, golangci-lint, gosec, govulncheck, test, verify PR contents). No code change needed; the only remaining gate is the review stage (stage/050-review-pending), so this should merge via the automerge sweep once review clears.


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 10, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read the test against static-src/js/tracker-human-gate.js on v5 and the harness prelude; this looks correct to me.

  • stageTrackerHumanGateVisible() (tracker-human-gate.js:149-151) returns 1 only when window.matchMedia(STAGE_TRACKER_GATE_FOLD_QUERY).matches, else STAGE_TRACKER_GATE_VISIBLE; the stub in the test drives exactly that branch and the delete window.matchMedia arm hits the typeof … === 'function' guard. The prelude declares const window = {} (stage_tracker_ui_prelude_test.go:14), so assigning/deleting a property is fine.
  • inlineVerbs matches class="ham-lead-act ham-gate-act" (:143) and therefore excludes both the … button (ham-gate-more appended, :201) and the menu items (ham-menu-item …, :142); menuVerbs reads only inside the <template>. The two selectors are disjoint, so "no duplicates" is actually pinned, not assumed.
  • The module-level mq.addEventListener('change', …) wiring (:152-155) is not lifted by jsFunc, so the stub's no-op addEventListener is harmless and the test is not accidentally re-rendering.
  • Fixtures are the same three rows TestStageTrackerHumanGateRows already uses, with the same verb sets (Approve / Request changes… / Let hive decide / Confirm safe, etc.), so the expected labels are grounded in a test CI already runs green.

The only red check, relative links and anchors resolve, fails on CHANGELOG.md: broken link '…/actions/runs/<id' — a base-branch (v5) artifact this test-only diff does not touch; #17527 (docs-link check: ignore link syntax quoted in inline code spans) is the fix for it. Once that lands, this should go green on rebase/re-run.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 10, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 10, 2026
@hivecommons-hive
hivecommons-hive Bot merged commit 398dc10 into v5 Nov 10, 2026
79 of 80 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the quality/test-human-gate-fold-arm branch November 10, 2026 06:49
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants