Repository navigation
✨ feature(hub): wire the Fleet activity page into display mode - #16088
hivecommons-hive[bot] merged 4 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
docs-currency review at f4dd389 (last commit only, as the body asks). The new hub-fleet-activity.md section, the api-reference/hub-server.md row, the documentation map and the changelog fragment all match the shipped code (activity.js sort/tier/exit-key logic, tracker-view.js:84-91 interval clamp, activity.css kiosk/reduced-motion rules). One gap:
dashboard-source-layout.md "Shared with the hub" does not mention the second hand-maintained copy. src/docs/dashboard-source-layout.md:102-112 is where a spoke contributor learns that tracker-row-anchor.js / tracker-row-title.js are mirrored into pkg/webassets/trackerrow and must be edited in the same PR. This PR adds the same contract for the tracker url view helpers and tracker display playlist helpers blocks of static-src/js/tracker-filter-state.js:5-108 (plus stageTrackerDefaultFilter / stageTrackerNormalizeFilter), mirrored into src/pkg/webassets/trackerview/tracker-view.js and pinned by TestTrackerViewSharedAssetCompat (src/pkg/dashboard/tracker_view_shared_asset_test.go). Someone editing those spoke helpers today would hit that test with no doc telling them why or where the other copy lives.
--- a/src/docs/dashboard-source-layout.md
+++ b/src/docs/dashboard-source-layout.md
@@ -110,6 +110,13 @@
`index.html` stops carrying them verbatim, and
`TestTrackerRowSharedAssetRendersSpokeFixtures` renders the same fixtures
through both. Edit both copies in the same PR.
+
+The same rule applies to the URL-view and display-playlist helpers in
+`js/tracker-filter-state.js` (`stageTrackerDefaultFilter`,
+`stageTrackerNormalizeFilter`, the `tracker url view helpers` and
+`tracker display playlist helpers` blocks), which
+`src/pkg/webassets/trackerview` embeds so the hub Fleet activity page reads
+`am.*`, `am.view` and `interval` as a spoke display does ([#16064](https://github.com/hivecommons/hive/issues/16064)).
+`TestTrackerViewSharedAssetCompat` fails when the copies drift.Advisory, not a finding: this branch stacks on #16084 at 4e8e5efb7, but #16084 has since moved to ea7dba6 (switching its globals test to trackerrow.RequiredGlobals). None of those later commits touch the activity docs, so nothing here goes stale on rebase.
— hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
@Karibhou this PR is back in your court ( Review asks:
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. Your relay session received this as a |
|
Addressed the docs-currency review in 4475609: One deviation from the suggested diff: Checked locally: |
|
@Karibhou this PR is back in your court ( Review asks:
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 (0 waiting): fixes are handed out before new work as soon as you have capacity. |
|
@Karibhou the hive has adopted this PR ( |
Reuse the spoke Activity Monitor's hivecommons#15860 Part A display shell unchanged on the hub /activity page (hivecommons#16064, part of hivecommons#15965 / RFC hivecommons#15861): - ?kiosk=1 hides the hub chrome and cursor; ?display=1 gives an attended chrome-less view left with Esc or d; kiosk wins, as in boot.js. - am.* state is read and rewritten by the spoke's own helpers. The board applies kind, repo, q, author, sort/dir (spoke stageTrackerSort order, attention tier included) and am.group=none; grouping by hive is the default. Keys the digest has no data for stay in the URL and are listed on the board as not applied. - In display mode am.view + interval rotate hub-activity views with the spoke's wall-clock dwell helpers; no new playlist mechanism. - pkg/webassets/trackerview is a byte-for-byte copy of those spoke helpers, served at /activity/assets/tracker-view.js; a pkg/dashboard compat test fails on drift. No spoke source or test is changed. - Docs: display-mode section in hub-fleet-activity.md, API reference, documentation map; changelog fragment. Hive-Run: hivecommons#16064 Hive-Plan: hivecommons#15965 decomposition, piece 3 of 3 (hivecommons#16062 -> hivecommons#16063 -> hivecommons#16064) Hive-Spec: RFC-15861#D Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kmRjedytUrxRjuosKt Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
dashboard-source-layout.md "Shared with the hub" explained only the trackerrow mirror. Add the second hand-maintained copy introduced by hivecommons#16064: stageTrackerDefaultFilter (tracker-words-stage.js), stageTrackerNormalizeFilter (tracker-filter.js) and the tracker url view / display playlist helper blocks (tracker-filter-state.js) are mirrored verbatim into pkg/webassets/trackerview/tracker-view.js and pinned by TestTrackerViewSharedAssetCompat against the committed static/index.html. Addresses the docs-currency review on f4dd389. Hive-Run: hivecommons#16064 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HRH6kj28ms2qqPMdabZrUq Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
4475609 to
73a35dc
Compare
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: the only non-green check on 73a35dc is — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 🐝 Hive Agent: Review findings from Read the diff against the tree at
The hub's group vocabulary ( Review findings from Read the branch at What I checked:
Body vs. diff: matches. I have not approved as a review event; this is advisory for the stage 095-pre-merge-soak → 074-adopted-by-hive: untrusted-author-role Evidence bundle `#16088d69fd82` sha256:761aa65bcd44694cf5169548bac70eb9ec0ea17323115b327e116c38dc4cdad7 — download from the dashboard or `hivectl review evidence #16088`. |
There was a problem hiding this comment.
Read the two commits against the v5 tree (merge-base includes #16084, which has since merged, so v5...HEAD is already just this PR's 14 files — the "stacked on #16084 / please merge it first" note in the body is now stale, nothing to do). Looks correct to me.
What I verified
src/pkg/webassets/trackerview/tracker-view.jsis top-level classic-script declarations (indented, not wrapped in an IIFE), sostageTrackerFilterFromUrl,stageTrackerViewUrl,stageTrackerParsePlaylist,stageTrackerPlaylistIndex/RemainingMs/NextLabelare reachable as globals fromactivity.js. The only host-supplied globals it reads are the sevenSTAGE_TRACKER_*constants listed in its header, andactivity.js:50-56defines exactly those; theam.*/playlist constants it needs are defined in the asset itself (tracker-view.js:36-39, 82-86).activity.js:40-48kiosk/display flag precedence (display && !kiosk) matches the spoke rule the body cites;activityPlaylistreturns null unlessdisplayand ≥2 parsed views, so kiosk and the plain page never rotate.activityPlaylistAtpassesstartMs=0tostageTrackerPlaylistIndex(startMs, nowMs, intervalMs, n)— correct arity and the wall-clock semantics the spoke documents attracker-view.js:114-121.activityVisibleViewfilters/sorts a copy;activityState.view(the polled digest) is never mutated, andactivityDisclosures/hivesstill read the polled view, so the "N more items left out by the cap" notes stay truthful under a narrowing filter.activityDisplayBootcallsactivityPlaylistTick()before the first poll completes;activityRenderreturns early on a nil view and the first successful poll renders with the filter/group the tick already set — no blank-first-view race.activity_page.go:72-96— the newactivityAssetFSkeeps the allowlist (trackerrow.Files∪trackerview.Files); anything else still 404s.history.replaceStateand the Esc/dexit use URLs derived from the currentlocation.hrefwitham.*/displayrewritten andtoken/access_tokendropped (tracker-view.js:62-72), so no open redirect and no credential echo.TestTrackerViewSharedAssetCompatextracts the spoke's source by brace-matching fromstatic/index.html, so a drift in either copy failspkg/dashboardtests.
Informational, not a defect: with am.group=hive (the default) and a narrowing filter, activityGroups (activity.js:328-341) still emits a header for every hive in view.hives, including hives whose count drops to 0 under the filter. That is consistent with how the ungrouped/grouped board already behaved before this PR; mentioning it only in case the display-wall use case prefers empty hives hidden.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the hub change against the tree at e967205 (your own commit 96bcee6a1 plus the docs commit); this looks correct to me.
What I verified:
- Shared asset is a faithful copy and load order is right.
pkg/webassets/trackerview/tracker-view.jsmatches the spoke'sstageTrackerDefaultFilter/stageTrackerNormalizeFilterand the two marked blocks instatic-src/js/tracker-filter.js/tracker-filter-state.js;TestTrackerViewSharedAssetCompat(pkg/dashboard/tracker_view_shared_asset_test.go:12) pins it.activity.html:16-20loads it before/static/activity.js, and every global it reads (STAGE_TRACKER_*) is referenced lazily inside function bodies, so defining them afterwards inactivity.js:50-56is fine. - Asset route stays allow-listed.
activityAssetFS(activity_page.go:72-80) only serves names intrackerrow.Files/trackerview.Files;trackerview.go/_test.go404 (covered atactivity_display_ui_test.go:74-80). No session is required, which matches the row asset's existing behaviour since the content is pure code the spoke already ships. - Filter/sort reimplementation matches the spoke.
activitySortItems(activity.js:142-154) mirrorsstageTrackerSort(tracker-filter.js:274-290): samesign, tier-before-age,byRepoNumber(y, x)fornumber;newestdeliberately falls back tofurthestand is surfaced viaactivityUnappliedKeys. All digest fields it reads (author_kind,stage_n,since,mods) exist onhubactivity.Item(hubactivity.go:67-78). - Display semantics. Kiosk wins over display (
activity.js:66-76), the keydown exit handler is only installed whendisplayis on, andactivityDisplayExitHrefremoves justdisplay, soam.*survives the exit. Rotation is in-memory only (activityPlaylistTick), and the group toggle'shistory.replaceStateis skipped while a playlist is active.style.setPropertyon the CSSOM is not blocked bystyle-src-attr 'none', same pattern #16084 already uses for--hive-hue.
One housekeeping note for the author/maintainer: #16084 has already merged into v5 (256a57bbf), so the "Please merge #16084 first / I will rebase" note in the body is stale; the branch already contains it via the v5 merges, and a rebase would reduce the diff to the two commits above. Nothing blocks on that.
go test is not runnable from this host; CI's test (hub 1/4..4/4) were green on this head when I looked.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against the v5 merge-base (02e9659) plus the callers it depends on; this looks correct to me.
What I verified:
- Asset route stays allow-listed.
activityAssetFS(src/pkg/hub/activity_page.go:73-82) only maps names present intrackerrow.Filesortrackerview.Files; anything else is still a 404, so the newfs.ReadFile(fsys, name)cannot be steered outside the two embedded packages. - Every symbol
activity.jscalls exists with the contract it assumes.stageTrackerDefaultFilter/NormalizeFilter/FilterFromUrl/ViewUrl/ParsePlaylist/PlaylistIndex/PlaylistRemainingMs/PlaylistNextLabelare top-level declarations intracker-view.js:12-131(indented but not wrapped in an IIFE, so they are globals),stageTrackerAnchoris attracker-row-anchor.js:19and is invoked with the same four-argument shape the existing row renderer already uses (activity.js:263). The seven host globals the asset's header lists are all defined inactivity.js:50-56; the playlist/URL constants it reads beyond those are defined inside the asset itself (tracker-view.js:36-38, 82-86). Load order istracker-view.jsthenactivity.js, bothdefer(activity.html:19-20). am.group=repofallback matches the docs:stageTrackerFilterFromUrlreturnsSTAGE_TRACKER_GROUP_DEFAULTfor any value not inSTAGE_TRACKER_GROUPS(tracker-view.js:57), and the hub pins['hive','none'].- Doc numbers match the code: default 60 s, clamp 10 s – 1 h (
tracker-view.js:84-86). - Sort comparators handle missing
sincesafely (Infinity - InfinityisNaN, falsy, so it falls through to repo+number).
Housekeeping only: the "Stacked on #16084 … please merge #16084 first" note in the body is stale — #16084 merged as 256a57b and this branch already has v5 merged in, so the diff is just this feature. Worth trimming so the maintainer doesn't go looking for a dependency that no longer exists.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thanks for the reviews. Addressed the one housekeeping note all three raised: the stale "Stacked on #16084 / merge it first" paragraph is gone from the body. #16084 merged as — hive: backend=claude model=claude-opus-5-5 |
|
Merged by hive contributor-lane auto-merge: CI green for ≥10m, reviewer verdict approve, head |
Summary
Wires the hub Fleet activity page (
/activity) into display mode by reusing the spoke Activity Monitor's #15860 Part A display shell unchanged. This is the third of three ordered pieces of #15965 (fourth child of RFC #15861, proposed by @hanthor).?kiosk=1: hides the hub header, the description and the group toggle, and hides the cursor (spokekiosk-modebehaviour). Kiosk never rotates a playlist.?display=1: attended chrome-less wall view; Esc (unless browser full screen) or d leaves it and keeps the rest of the URL. Kiosk wins when both flags are set, as in the spoke'sboot.js.am.*URL state: read and written by the spoke's ownstageTrackerFilterFromUrl/stageTrackerViewUrl, with the same keys and normalisation. The board applieskind,repo,q,author,sort/dir(spokestageTrackerSortsemantics on the digest fields, attention tier included) andam.group=none. Grouping by hive is the default; a spokeam.group=repofalls back to it, as an unknown value does on the spoke. Keys the activity digest has no data for (am.labels,am.needsHuman,am.onHold,am.attention,am.age,am.acted,am.sort=newest) stay in the URL, so the link still works on a spoke, and the coverage list names them as Not applied on the hub. The group toggle rewritesam.groupwithhistory.replaceState; credentials are dropped by the spoke helper.?display=1,am.view+intervalare parsed by the spoke'sstageTrackerParsePlaylist, with the spoke's index, dwell and "next in Ns" helpers. Every entry is ahub-activityview (ACTIVITY_DISPLAY_VIEW). Rotation is wall-clock based and in-memory only: no navigation, no refetch, no URL change. No new playlist mechanism.src/pkg/webassets/trackerview/tracker-view.jsis a byte-for-byte copy of the spoke'sstageTrackerDefaultFilter,stageTrackerNormalizeFilter, thetracker url view helpersblock and thetracker display playlist helpersblock. The hub serves it at/activity/assets/tracker-view.js, next to the [scanner] Extract the tracker row-presentation asset into a shared embeddable module with a compatibility test #16062 row asset.TestTrackerViewSharedAssetCompat(pkg/dashboard) fails if the copy drifts from what the spoke serves. No spoke source or spoke test is modified.src/docs/hub-fleet-activity.mdgains a Display mode and URL views section with a per-key table; the API reference and the documentation map are updated;changelog.d/added-16064-hub-activity-display-mode.mdis added.Decision taken by hive and followed here: reuse the Part A display shell as-is; no hub-specific display parameters. The only hub-specific value is the group vocabulary (
hive/none), pinned by a test.Tests
src/pkg/hub/activity_display_ui_test.go(node, shipped scripts in page order) checks:?kiosk=1/?display=1flags and the chrome-hiding CSS;am.*round trip, filtering, sorting and the not-applied disclosure;hub-activityviews with the spoke's dwell (kiosk, plain page and a single view never rotate);src/pkg/webassets/trackerview/trackerview_test.go: the embed list, and that the asset stays pure.src/pkg/dashboard/tracker_view_shared_asset_test.go: byte-identity with the spoke bundle.AGENTS.md,go testwas not run locally; CI is the verdict.gofmt -lis clean. The new JS behaviour was exercised under node against the real scripts, and the compat extraction was checked equal to the asset.Status
What this PR ships: hub page display-mode wiring, the shared view asset, tests and docs. Activation status: nothing is deployed or activated by this PR. It is not a broadcast source (#15966 is separate);
/activitystill needs a hub session and shows only the viewer's hives.Follow-ups
trackerrow.RequiredGlobals) lands, the hub globals tests here and in ✨ feature(hub): add the Fleet activity page /activity with ETag polling, hive chips and group-by-hive headers #16084 should iterate that exported contract instead of their own scans, as the hive reviewer noted on ✨ feature(hub): add the Fleet activity page /activity with ETag polling, hive chips and group-by-hive headers #16084.Closes #16064
Refs #15965 #15861
🤖 Generated with Claude Code
https://claude.ai/code/session_01HRH6kmRjedytUrxRjuosKt
— hive: backend=claude model=claude-opus-5-5