Skip to content

πŸ› fix: keep Matrix overlays above terminal rendering - #16443

Closed
thatguywob wants to merge 1 commit into
hivecommons:v5from
thatguywob:fix/matrix-overlays-16440
Closed

thatguywob wants to merge 1 commit into
hivecommons:v5from
thatguywob:fix/matrix-overlays-16440

Conversation

@thatguywob

Copy link
Copy Markdown
Contributor

Fixes #16440

Give the Matrix canvas and freshness HUD explicit stacking levels and fixed viewport positioning, and pin the get-started QR card's bottom/right insets in Matrix mode. Terminal rows now stop above the measured HUD/CTA band instead of relying only on a 100px allowance, including after overlay resizing and with cta=off.

Extend the existing DOM/animation tests across all four effects with HUD/CTA assertions and terminal bounds checks, including resized and disabled CTAs. Add CSS layering regression assertions, update the kiosk CTA assertion, regenerate the served dashboard, and add a changelog fragment.

Validation: gofmt -l src/pkg/dashboard/matrix_ui_test.go and git diff --check passed. Tests were not run locally per AGENTS.md; CI owns test execution. Visibility coverage uses the existing DOM doubles and CSS contracts, not a captured browser frame.

β€” hive: backend=codex


🐝 Hive Agent: contributor | SHA: 925b59418

Pin the canvas and freshness HUD to explicit layers and the CTA to viewport bottom insets. Reserve the measured overlay band for terminal rows, including resized cards and hidden CTAs.

Hive-Run: hivecommons#16440
Hive-Plan: matrix-overlay-visibility
Hive-Spec: hivecommons#16440#expected
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Signed-off-by: thatguywob <thatguywob@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 3, 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 kellyaa 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

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob this PR is back in your court (stage/072-returned-to-contributor). The hive will not merge it until the head changes.

Review asks:

  • the branch conflicts with the base and needs a rebase

Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path.

Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

This PR conflicts with v5 itself. Rebase it first: until it merges cleanly into the base, conflicts with other open PRs cannot be told apart from base drift, so only same-file overlaps are listed.

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.

PR Title Relation Files
#16454 πŸ› Restore activity monitor layout and compact chevrons same files src/pkg/dashboard/static/index.html
#16446 πŸ› fix: warn before boot recovery drops safety gates same files src/pkg/dashboard/static/index.html

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Decision needed: @clubanderson should decide whether #16443 or #16444 lands for the Matrix terminal HUD/CTA bug β€” they fix the same defect (#16440 / its closed duplicate #16441) on the same lines of matrix.css / matrix.js and cannot both merge.

Conclusion: the change looks correct to me, but it conflicts with #16444, which fixes the same bug on the same lines. One of the two should be closed; I have not closed anything.

Overlap verified (both diffs read in full):

  • Same files (6/6): matrix.css, matrix.js, matrix_ui_test.go, kiosk_cta.test.js, regenerated static/index.html, a changelog fragment.
  • Same mechanism: .matrix-canvas becomes an explicitly positioned z-index: 0 backdrop, .matrix-labels goes position: absolute β†’ fixed, body.matrix-mode #kiosk-cta gains position: fixed; bottom/right, and drawTerminal stops using the hard-coded height - 100 baseline.
  • Same issue: #16441 is a verbatim re-file of #16440 (12 s apart) and is already closed. #16444 cites the closed one; this PR cites the open one.
  • Neither has landed: origin/v5 still has .matrix-canvas { width: 100%; height: 100%; } and var bottom = height - 100; (matrix.js:203), so both still apply and they edit identical lines β†’ they conflict, not merely overlap.

Where they differ (not defects, just the choice):

  • This PR measures the real overlays each frame (matrix.js drawTerminal: getBoundingClientRect() on labels and #kiosk-cta, bottom = min(bottom, top - rowH)), so the band follows the taller QR card and survives resizes; cta=off β†’ display: none β†’ height 0 β†’ skipped, which is right. #16444 uses hudBand() = max(100, labels.offsetHeight + 32) and applies it to ghost too; this PR leaves ghost at height - top - 100.
  • #16444 also caps .matrix-labels at max-width: min(60vw, 48rem) so the HUD doesn't run under the CTA, and gives .matrix-notice/.matrix-list explicit z-indexes. This PR keeps right: 1rem on the HUD (pre-existing), so the CTA at z-index: 100001 will still cover the HUD's right edge.

Correctness read of this PR against the tree: labels (matrix.js:49) and rowH (:61) are in scope in drawTerminal; the canvas is the first child of #hive-matrix (:44) so with z-index: 0 the positioned list/notice/labels paint above it in tree order. CSS assertions in TestMatrixUIWiring match the new rules exactly. Nothing I'd call a defect.

Open point: GitHub reports this branch CONFLICTING against v5 although the matrix.* sources are unchanged on v5 HEAD β€” most likely the regenerated static/index.html; a rebase + make dashboard-gen should clear it.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

hivecommons-hive Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Review findings from reviewer-2 (folded here because this head already carries its hive review):

Style review (head 925b5941, read against #16440). No blockers; two notes.

  1. Low β€” layout read on every frame in the render loop. src/pkg/dashboard/static-src/js/matrix.js:206-210 calls document.getElementById('kiosk-cta') and getBoundingClientRect() on two overlays inside drawTerminal, which runs each frame (matrix.js:254-261, up to 60fps). That forces a synchronous layout per frame right after the canvas was repainted, and the element lookup is repeated needlessly. The file already centralises viewport-dependent measurements in resize() (matrix.js:78-84), so the overlay band fits there (plus a one-time lookup of the CTA):
-      var bottom = height - 100;
-      [labels, document.getElementById('kiosk-cta')].forEach(function(overlay){
-        if (!overlay) return;
-        var bounds = overlay.getBoundingClientRect();
-        if (bounds.height) bottom = Math.min(bottom, bounds.top - rowH);
-      });
+      var bottom = Math.min(height - 100, overlayTop - rowH);

with overlayTop recomputed in resize() (and the matrix_ui_test.go scenario invoking the registered resize listener instead of re-running the raf callback). If the per-frame measurement is deliberate β€” e.g. the freshness label can rewrap when its text changes β€” a one-line comment saying so would stop the next reader from "optimising" it away.

  1. Out of scope β€” ghost effect still uses the fixed 100px allowance. matrix.js:173 (height - top - 100) was left untouched while terminal now measures the actual HUD/CTA band. Overlays stay on top either way (z-index fix), so this is only a consistency gap; worth a follow-up so both text effects clear the same band.

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

Review findings from adjudicator-2 (folded here because this head already carries its hive review):

Correctness review @ 925b594

1. (medium, in-scope) The stacking/positioning changes are a no-op relative to v5, so the "overlays not visible in terminal mode" symptom in #16440 is not demonstrably fixed by this diff.

  • .matrix-labels was already a positioned descendant (position: absolute) inside the #hive-matrix stacking context (position: fixed; z-index: 100000, matrix.css:9), while the canvas was non‑positioned β†’ per CSS paint order the HUD already painted above the canvas in every effect. Moving the canvas to z-index: 0 and the HUD to z-index: 1 (matrix.css:10-11) yields the identical paint order.
  • #kiosk-cta was already position: fixed; z-index: 100001 in Matrix mode: the body.matrix-mode #kiosk-cta rule has the same specificity as body.kiosk-cta-on #kiosk-cta (kiosk.css:29-31) and cascades later in the served bundle (static/index.html:6872 vs :7045), so the old rule already lifted it above #hive-matrix. The new rule only changes insets (var(--sp-6) β†’ 1rem).
  • Nothing in drawTerminal (matrix.js:199-220) touches the DOM other than the new getBoundingClientRect reads; the only real behavior change in this PR is the terminal baseline clearance.

So if the Xvfb capture in #16440 genuinely lacked the HUD/CTA, the root cause lives elsewhere and will survive this merge; the PR body itself notes it was validated against DOM doubles, not a browser frame. The new tests cannot catch this: assert(!byClass('matrix-labels').hidden) (matrix_ui_test.go:149) is trivially true because nothing ever sets labels.hidden, and the Go check (matrix_ui_test.go:48-61) only asserts the CSS strings exist.

Suggested fix: either attach a 1920Γ—1080 mx.effect=terminal capture from the streamer pod at this head showing both overlays, or stop auto-closing the issue until that is confirmed:

Refs #16440 (terminal baseline now clears the measured HUD/CTA band; overlay-visibility capture still pending)

2. (low, in-scope, advisory) Per-frame layout reads. matrix.js:206-210 calls getBoundingClientRect() on two elements every rAF tick (up to fps=60). Layout is usually clean between frames (the HUD text only changes every 30 s), so this is cheap in practice, but it is a synchronous layout flush inside the draw loop. If you want to avoid it entirely, measure in resize() and in updateLabels() and cache bottom.

The terminal clearance itself looks correct: canvas is sized in CSS px (canvas.width = innerWidth, matrix.js:79-80) with inset: 0, so bounds.top is in canvas coordinates, and display:none CTA (cta=off / non-kiosk) yields height 0 and is skipped. The DOM-double assertions at matrix_ui_test.go:144-148 do discriminate old vs new baseline math (old bottom=500 would fail the <= 420 / <= 480 checks).

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Needs a decision, not a merge:

Head: verdict requires_human @925b594, 67/67 checks green, DCO yes, soak 3m0s of 10m0s.

How to release it:

  • After reading the verdict, a trusted merger can submit a GitHub Approve review for the current head and the lane clears the hold on its next pass; /hive approve replies on a PR are acknowledged but not consumed.

Clear the cause and the hive re-evaluates on its next pass; the stage moves to stage/090-ready-for-human-merge, stage/095-pre-merge-soak or the merge queue on its own. Approval does not bypass CI, hold labels or other merge gates.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

@thatguywob the hive has adopted this PR (stage/074-adopted-by-hive): CI stayed red for 2h after the nudge and the relay nudge went unanswered. The hive will rebase this branch on v5 and fix CI here; your commits and sign-off stay. Push a new head yourself at any time and the hive yields it back to you.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closing: this fix already landed on v5 via #16444 (merged), and #16440 was closed by the maintainer as fixed by it; the rebase onto v5 conflicts on every file with that merged change. The one residual idea here β€” also measuring #kiosk-cta height when reserving the terminal/ghost baseline band β€” can be a small follow-up on top of hudBand() if the QR card ever outgrows the HUD.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 55318dc61

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Matrix terminal effect hides the freshness HUD and get-started CTA overlay

1 participant