Skip to content

🌱 chore(dashboard): extract the tracker row-presentation asset into a shared embeddable module - #16066

Merged
hivecommons-hive[bot] merged 4 commits into
v5from
scanner/fix-16062
Oct 31, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
v5from
scanner/fix-16062

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Closes #16062

Part of #15965, the fourth child of RFC #15861 by @hanthor.

Why

The hub Fleet activity page (#15965) has to draw tracker rows the same way the spoke does. The owner decision on #15861 was to share the smallest pure row-presentation code rather than copy the tracker or rewrite the renderer. The hub must not import pkg/dashboard, so that code has to live somewhere both binaries can go:embed. A test also has to catch the two copies drifting apart.

Decision: byte-identical parts, no change to the pipeline

ParseIndexManifest rejects .. paths, and ConcatIndex reads only static-src/, so the manifest cannot point at a file outside it. I did not widen the generator. Instead:

  • tracker-row.js and tracker-row-layout.js are split at existing function boundaries into tracker-row-anchor.js (stageTrackerAnchor, stage → strip column), tracker-row-title.js (stageTrackerSplitTitleTag / stageTrackerTitleHtml, escaped text-only title) and tracker-row-render.js (the rest of the old layout file, unchanged). They are listed in the manifest in the original order, so the committed static/index.html is byte-identical: there is no artifact diff and no CSP hash change.
  • src/pkg/webassets/trackerrow embeds byte-identical copies of the two shared parts (FS, Files). It imports only embed. The hub can embed it later without depending on pkg/dashboard.
  • Not moved: segments/words, action menus, sound, motion, popout, filters and queue. They depend on spoke-only state and the hub stays visibility-only. A test in the shared package rejects data-action, DOM, fetch and storage code in the shared assets.

Compatibility coverage

  • TestTrackerRowSharedAssetCompat checks that each shared file matches its static-src/js part exactly, is listed in manifest.txt, and appears verbatim in static/index.html.
  • TestTrackerRowSharedAssetRendersSpokeFixtures follows the existing node harness pattern. It renders stage, kind, merge-gate and merge-train fixtures and title fixtures through the functions lifted from the spoke page and through the shared files. It asserts that both give the same output and pins that output to the spoke's current columns and markup.
  • integration_execution_ui_test.go now reads the layout seams from tracker-row-layout.js and tracker-row-render.js.
  • Docs (dashboard-source-layout.md, dashboard-copy-inventory.md) and changelog.d/changed-16062-shared-tracker-row-asset.md are updated.

Shipped vs. activation

What this PR ships: the shared module, the split source parts and the compatibility tests. Nothing activates: the hub does not embed or serve the asset yet (that is #16063), and the spoke serves the same bytes as before. #15965 is not complete until its remaining children merge. CI has not run on this PR yet, so it is not a verdict on the work.


Filed by hive agent scanner.

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

… shared embeddable module

Signed-off-by: scanner <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 Oct 31, 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 danathar 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

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 31, 2026
@hivecommons-hive

hivecommons-hive Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

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

hive/awaiting-ci: pushed 758e844 — the two vm-based row-adapter test loaders now take stageTrackerRowHtml from tracker-row-render.js (where this PR moved it). CI pending — sweep will merge when green.


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

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

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 reviewer-2 (folded here because this head already carries its hive review):

Read the split against the v5 tree and checked the central claim rather than the description: this looks correct to me.

Verified at 177b7b5:

  • cat tracker-row-anchor.js tracker-row.js is byte-identical to the old static-src/js/tracker-row.js on v5, and cat tracker-row-layout.js tracker-row-title.js tracker-row-render.js is byte-identical to the old tracker-row-layout.js. With the manifest order (manifest.txt:74,80-82) that is exactly the old concatenation, so static/index.html has no diff in this PR — the CSP-hash claim holds.
  • pkg/webassets/trackerrow/*.js are cmp-identical to their static-src/js parts, and trackerrow.go imports only embed.
  • tracker_row_shared_asset_test.go type-checks against the existing helpers (indexHTML, jsConstLine, jsFunc, runNodeStdin in acmm_per_repo_ui_test.go et al.); go build ./pkg/webassets/trackerrow/ ./pkg/dashboard/ passes.
  • The two node harnesses now load stageTrackerRowHtml from tracker-row-render.js (tracker-row-render.js:91); stage_tracker_human_attention.test.js and stage_tracker_preparation_visual.test.js both pass locally.

One note, not a defect: tracker-row-anchor.js:22-50 resolves STAGE_TRACKER_* constants and the literal 50 from the host page at call time, so the hub child (#16063) will need to supply the same constants (tracker-words-core.js/agent-now.js on the spoke) before loading this file — the package doc already says so.

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

Verified the two claims this PR rests on, from the tree at 6183008 rather than the diff:

  • static/index.html is byte-identical. go run ./pkg/dashboard/webstatic/gen -src pkg/dashboard/static-src -out pkg/dashboard/static/index.html -check exits 0 on this head. ConcatIndex (src/pkg/dashboard/webstatic/indexgen.go:55-74) writes the manifest files with no separators, and the new manifest order (anchor, tracker-row, …, layout, title, render) reproduces the old bytes because the anchor was the head of tracker-row.js and title+render were the tail of tracker-row-layout.js. No CSP hash change.
  • The shared copies match. cmp of src/pkg/webassets/trackerrow/{tracker-row-anchor,tracker-row-title}.js against static-src/js/ reports identical, and TestTrackerRowSharedAssetCompat (src/pkg/dashboard/tracker_row_shared_asset_test.go:18-49) pins exactly that plus the manifest listing and verbatim presence in index.html, so the hand-kept duplication is enforced, not hoped for.

trackerrow.go imports only embed, so the hub can take it without a pkg/dashboard dependency; the pkg/dashboard → trackerrow import is test-only. integration_execution_ui_test.go:54-61 now reads its seams from layout + render concatenated, which is where they moved. The split lands at existing function boundaries and nothing in the moved code changed. Looks correct to me; nothing activates here, as the body says — the hub side is #16063.

Not a finding, just for whoever picks up #16063: the two-copies rule is documented in dashboard-source-layout.md and in the package doc, and the compat test is the only thing that keeps them honest, so it should stay in the dashboard test shard rather than being moved behind a node skip.

Evidence bundle `#16066177b7b5` sha256:812da1446179c4f55a4b6f673c39d092db95c2240b88cc4cb2d6417e440963f7 — download from the dashboard or `hivectl review evidence #16066`.

@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.

PR Title Relation Files
#16027 🐛 fix: keep the preparation train connector continuous between adjacent members CONFLICT src/pkg/dashboard/static-src/js/tracker-row-layout.js

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Oct 31, 2026
@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 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 stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Oct 31, 2026
@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 Oct 31, 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.

Intent alignment vs #16062 (read at head fb5dce0)

The acceptance bullets are met: static/index.html is byte-identical (manifest keeps the original order, static-src/manifest.txt:74-81), TestTrackerRowSharedAssetCompat pins both copies to the committed HTML (tracker_row_shared_asset_test.go:18-47), and pkg/webassets/trackerrow imports only embed (trackerrow.go:19). The "two byte-identical copies" approach instead of a real move is justified — webstatic/indexgen.go:36 rejects .. and ConcatIndex reads only the static-src fs.FS (indexgen.go:55-66) — and the drift test covers it.

One in-scope gap — the shared asset is not actually self-contained for the hub

tracker-row-anchor.js references ten STAGE_TRACKER_* globals (PATH, PR_COLUMN, MERGE_COLUMN, NEEDS_DECISION, ISSUE_NEEDS_DECISION, ISSUE_DECISION_COLUMN, TRIAGE_NEEDED, POSSIBLY_EXISTS, PRE_MERGE_SOAK, TERMINAL; webassets/trackerrow/tracker-row-anchor.js:21-46) that are defined only in spoke files that were not shared: static-src/js/agent-now.js:472-476 and static-src/js/tracker-words-core.js:67-105. trackerrow.go:12-16 acknowledges "a host page supplies" them. That means #16063 must hand-copy the stage path/column numbers out of pkg/dashboard — exactly the kind of drift the issue's compatibility test exists to prevent, and it isn't covered: the compat test only pins the two function files, and TestTrackerRowSharedAssetRendersSpokeFixtures lifts the constants from the spoke HTML (tracker_row_shared_asset_test.go:66-75) so a hub redefinition can diverge silently.

Requested change: split the STAGE_TRACKER_* constants the anchor uses into a tracker-row-constants.js manifest part (same split pattern already used here), add a byte-identical copy to trackerrow.Files ahead of tracker-row-anchor.js, and have the fixture test load the shared copy instead of jsConstLine from the spoke page.

Advisory (not blocking): #16062 lists "row layout" and "stage → strip segment mapping" in the subset to extract, and #16063 says it will "render rows with the extracted asset". What shipped is a column selector and a title span; stageTrackerSegments and the row shell stayed spoke-side (justifiably — tracker-row.js:6-7,69-71 depend on ctx.trains/nowMs/words). The PR body states this, but #16063 should be re-scoped to expect building its own row/strip markup around these two helpers.

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

…the row adapters tests

The row renderer moved out of tracker-row-layout.js in this PR; the two
vm-based test loaders still looked for it there.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) and removed 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 labels Oct 31, 2026
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/060-reviewed Review swarm verdict approve; a gate is still pending (CI running, soak not started) labels Oct 31, 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.

Verified the refactor is a pure move, at 6183008:

  • cat tracker-row-anchor.js tracker-row.js is byte-identical to v5's tracker-row.js, and cat tracker-row-layout.js tracker-row-title.js tracker-row-render.js is byte-identical to v5's tracker-row-layout.js.
  • manifest.txt inserts the three parts exactly where their bytes used to be (anchor before tracker-row.js; title/render after tracker-row-layout.js), which is why static/index.html has no diff and the CSP hash is unchanged.
  • The two files under src/pkg/webassets/trackerrow/ are byte-identical to their static-src/js counterparts, and the package imports only embed (trackerrow.go:19), so the hub can embed it without pulling pkg/dashboard.
  • integration_execution_ui_test.go and the two .test.js files just concatenate the split parts; no behaviour assertion changed.

Looks correct to me. The only thing a maintainer should be aware of is sequencing: because this moves the first 49 lines of tracker-row.js and the last 202 of tracker-row-layout.js, any open PR editing those regions (the conflicts-with-open-pr label) will need a rebase once this lands, and the copy in webassets/trackerrow must be edited together with it from now on — TestTrackerRowSharedAssetCompat enforces that.

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

@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.

Looks correct to me — read the split sources, the manifest, the new package and the tests against the tree at 177b7b5.

What I verified:

  • Pure code motion, byte-identical artifact. static-src/js/tracker-row-anchor.js is exactly the old head of tracker-row.js (the stageTrackerAnchor block); tracker-row-title.js + tracker-row-render.js are exactly the old tail of tracker-row-layout.js from stageTrackerSplitTitleTag onward. The manifest.txt insertions (js/tracker-row-anchor.js before js/tracker-row.js; js/tracker-row-title.js, js/tracker-row-render.js after js/tracker-row-layout.js) keep the bytes in the original order, and git diff origin/v5... on static/index.html is empty. webstatic/indexgen_test.go:15 (TestIndexHTMLIsGenerated) already gates that, and it is green on this head.
  • Shared copies match. pkg/webassets/trackerrow/tracker-row-{anchor,title}.js are md5-identical to their static-src/js parts, and tracker_row_shared_asset_test.go:18 pins that plus manifest listing plus verbatim presence in index.html, so drift fails a test rather than silently diverging.
  • No dependency leak toward the hub. trackerrow.go imports only embed; pkg/dashboard references the new package only from _test.go. The anchor's calls to stageTrackerUnderRepair / stageTrackerMergeRefusalFromRaw are typeof === 'function'-guarded (tracker-row-anchor.js:25,29), matching the package doc's "only when defined" claim, so a hub page that lacks those helpers will not throw.
  • integration_execution_ui_test.go:54 now concatenates tracker-row-layout.js + tracker-row-render.js before seam-checking, so the moved seams are still covered.

Body matches the diff: nothing activates (no hub embed, no served-asset change); that is correctly left to #16063. No findings.

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

@hivecommons-hive
hivecommons-hive Bot merged commit 0a67a30 into v5 Oct 31, 2026
75 of 76 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-16062 branch October 31, 2026 17:02
@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 Oct 31, 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 conflicts-with-open-pr Open PR has a merge conflict with another open PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] Extract the tracker row-presentation asset into a shared embeddable module with a compatibility test

0 participants