From fb5dce044fd55d691e566937fce07391f00a267f Mon Sep 17 00:00:00 2001 From: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Date: Sat, 31 Oct 2026 11:48:05 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8C=B1=20chore(dashboard):=20extract?= =?UTF-8?q?=20the=20tracker=20row-presentation=20asset=20into=20a=20shared?= =?UTF-8?q?=20embeddable=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> --- .../changed-16062-shared-tracker-row-asset.md | 1 + src/docs/dashboard-copy-inventory.md | 2 +- src/docs/dashboard-source-layout.md | 17 +- .../integration_execution_ui_test.go | 10 +- .../static-src/js/tracker-row-anchor.js | 49 +++++ .../static-src/js/tracker-row-layout.js | 202 ------------------ .../static-src/js/tracker-row-render.js | 184 ++++++++++++++++ .../static-src/js/tracker-row-title.js | 18 ++ .../dashboard/static-src/js/tracker-row.js | 49 ----- src/pkg/dashboard/static-src/manifest.txt | 3 + .../tracker_row_shared_asset_test.go | 124 +++++++++++ .../trackerrow/tracker-row-anchor.js | 49 +++++ .../webassets/trackerrow/tracker-row-title.js | 18 ++ src/pkg/webassets/trackerrow/trackerrow.go | 32 +++ .../webassets/trackerrow/trackerrow_test.go | 64 ++++++ 15 files changed, 565 insertions(+), 257 deletions(-) create mode 100644 changelog.d/changed-16062-shared-tracker-row-asset.md create mode 100644 src/pkg/dashboard/static-src/js/tracker-row-anchor.js create mode 100644 src/pkg/dashboard/static-src/js/tracker-row-render.js create mode 100644 src/pkg/dashboard/static-src/js/tracker-row-title.js create mode 100644 src/pkg/dashboard/tracker_row_shared_asset_test.go create mode 100644 src/pkg/webassets/trackerrow/tracker-row-anchor.js create mode 100644 src/pkg/webassets/trackerrow/tracker-row-title.js create mode 100644 src/pkg/webassets/trackerrow/trackerrow.go create mode 100644 src/pkg/webassets/trackerrow/trackerrow_test.go diff --git a/changelog.d/changed-16062-shared-tracker-row-asset.md b/changelog.d/changed-16062-shared-tracker-row-asset.md new file mode 100644 index 0000000000..ef115fa541 --- /dev/null +++ b/changelog.d/changed-16062-shared-tracker-row-asset.md @@ -0,0 +1 @@ +- The tracker's stage-to-column mapping and text-only row title now live in a shared embeddable module (`src/pkg/webassets/trackerrow`) that both the spoke dashboard and the hub can load, with a compatibility test that fails if the spoke's rows and the shared copy drift. The spoke dashboard serves byte-identical HTML; nothing changes for operators yet — this is groundwork for the hub Fleet activity page ([#16062](https://github.com/hivecommons/hive/issues/16062), part of [#15965](https://github.com/hivecommons/hive/issues/15965)). diff --git a/src/docs/dashboard-copy-inventory.md b/src/docs/dashboard-copy-inventory.md index a4cc31f2db..66ad8b9ebd 100644 --- a/src/docs/dashboard-copy-inventory.md +++ b/src/docs/dashboard-copy-inventory.md @@ -112,7 +112,7 @@ old name). | `stageTrackerTrainQueueTip` | chevron hover | *Behind #15253 … Estimated turn: ~25m.* / *Front of the merge queue* | *2nd of 6 in the merge queue · behind #15253 · ETA ~25m.* / *1st of 6 in the merge queue · merges next · ETA ~4m.*; *· merge sweep running* lives here only (one label per chevron, #15416) | same | | `stageTrackerTrainHeaderText` + `stageTrackerTrainIconHtml` | train header chip | `⛓ merge train · 2 PRs · front #15400` | 🚆 (inline-SVG railcar, hover *Merge queue*) `merge train · 2 PRs · 1st: #15400` | `TestStageTrackerMergeTrain` | | `stageTrackerQueueMemberState` (`tracker-queue.js`) | Merge queue popover | *front of the queue* | *merges next* | `TestStageTrackerMergeQueuePopover` | -| `stageTrackerAnchor` (`tracker-row.js`) | which column lights | a 1st-in-train head at 050/070 lit **CI / Review** | every train state lights **Merge queue** | `TestStageTrackerMergeTrainStatesLightMergeColumn` | +| `stageTrackerAnchor` (`tracker-row-anchor.js`) | which column lights | a 1st-in-train head at 050/070 lit **CI / Review** | every train state lights **Merge queue** | `TestStageTrackerMergeTrainStatesLightMergeColumn` | | `stageTrackerHeaderHtml` | column header | *Merge gate* | 🚆 *Merge queue* (same icon as the chip and the 080 chevron) | `TestStageTrackerHeader…` | | Go: `prstage.MergeTrain.Sentence`, `stageTrackerMergeTrainFrontCaption`, `eta_basis` | gate reason, caption, hover | *front of the merge train (1st of 3)*, *Front of a merge train of N PRs* | *1st in the merge queue; merges next (1st of 3)*, *1st in a merge queue of N PRs* | `TestParseMergeTrainRejectsMalformed` | | "merge gate" in decision copy (`delegatedecision` glossary, ladder, dashboard decided/new/vocabulary) | glossary, ⋯ hints, PR comments | *the merge gate merges it once every check passes* | *the merge queue merges it …* | `TestStageTrackerDecisionGlossaryMirrorsGo` | diff --git a/src/docs/dashboard-source-layout.md b/src/docs/dashboard-source-layout.md index 35dfc964bf..66c04266ed 100644 --- a/src/docs/dashboard-source-layout.md +++ b/src/docs/dashboard-source-layout.md @@ -76,8 +76,9 @@ Body HTML (`html/`): `auth`, `root-notices`, `chat`, `dialogs`, `sidebar`, JS (`js/`): `boot`, `core`, `feedback`, `sections`, `layout`, `agent-detail`, `sidebar`, `history-sparklines`, `cost-trend`, `stats`, `agent-now`, `tracker-words-core`, `tracker-words-stage`, `tracker-words-gate`, -`tracker-words`, `tracker-row`, `tracker-row-strip`, `tracker-row-acted`, -`tracker-row-layout`, `tracker-motion`, `tracker-filter`, +`tracker-words`, `tracker-row-anchor`, `tracker-row`, `tracker-row-strip`, +`tracker-row-acted`, `tracker-row-layout`, `tracker-row-title`, +`tracker-row-render`, `tracker-motion`, `tracker-filter`, `tracker-filter-state`, `nav-count-delta`, `tracker-preparation`, `tracker-native-queue`, `tracker-filter-render`, `tracker-filter-fetch`, `tracker-actions`, `tracker-merged`, `tracker-queue`, @@ -98,6 +99,18 @@ clearly belongs to another area than the file it sits in, move it — the generator does not care about order inside a region as long as the manifest order still yields a document where every definition precedes its first use. +### Shared with the hub + +`js/tracker-row-anchor.js` (which strip column a stage lights) and +`js/tracker-row-title.js` (the escaped, text-only row title) are also embedded +by `src/pkg/webassets/trackerrow`, so the hub can draw rows with the same +code without importing `pkg/dashboard`. The generator only reads +`static-src/`, so the two copies are kept byte-identical by hand: +`TestTrackerRowSharedAssetCompat` fails when they drift or when +`index.html` stops carrying them verbatim, and +`TestTrackerRowSharedAssetRendersSpokeFixtures` renders the same fixtures +through both. Edit both copies in the same PR. + ## Working with it ```sh diff --git a/src/pkg/dashboard/integration_execution_ui_test.go b/src/pkg/dashboard/integration_execution_ui_test.go index 57f7ffc1f9..8de52ec99c 100644 --- a/src/pkg/dashboard/integration_execution_ui_test.go +++ b/src/pkg/dashboard/integration_execution_ui_test.go @@ -51,9 +51,13 @@ assert.ok(!stageTrackerExecutionHtml(item).includes('