Skip to content

[scanner] Describe Activity Monitor filters in am.* URL parameters #15924

Closed

Description

@hivecommons-hive

Part of #15860

Make every Activity Monitor filter describable by URL so a display link can reproduce a view in a fresh browser profile. This is the "URL state" piece of Part A and the base that display mode, the overlay's Copy display link and playlists build on.

Decision constraints that apply (from the maintainer's /hive decision on #15860)

  • Presets are URL-only. Do not add named presets under hive.yaml or any other persisted store. Persisted named presets are deferred until usage justifies them.
  • Display mode is presentation only. It grants nothing and adds no mutation privileges. Existing authenticated read-only viewer access and per-user authorization are unchanged.
  • When no am.* parameter is present, the ordinary Activity Monitor behaves exactly as it does today, including the localStorage filter and the existing ?filter=waiting-on-you one-shot.
  • Existing headless ?kiosk=1 behaviour is preserved.

Where

  • src/pkg/dashboard/static-src/js/tracker-filter-state.js: stageTrackerLoadFilter() and stageTrackerSaveFilter(). Load reads localStorage key hive-activity-monitor-filter; save writes it back.
  • src/pkg/dashboard/static-src/js/tracker-filter.js: stageTrackerNormalizeFilter() validates every value. Reuse it and do not duplicate validation.
  • src/pkg/dashboard/static-src/js/tracker-filter-fetch.js: fetchStageTracker() calls stageTrackerLoadFilter() and then stageTrackerApplyUrlFilter() (js/tracker-waiting.js) on first load.
  • Group setting: stageTrackerGroupSetting() / stageTrackerSetGroup() in tracker-filter-state.js.
  • Regenerate src/pkg/dashboard/static/index.html with go generate ./src/pkg/dashboard/webstatic. Never hand-edit it; TestIndexHTMLIsGenerated enforces this.

What

  • Add two pure helpers between // tracker url view helpers begin / // tracker url view helpers end markers so node tests can lift them:
    • stageTrackerFilterFromUrl(href) returns { filter, group } or null.
    • stageTrackerViewUrl(href, filter, group) returns the current URL with am.* set.
  • Parameters: am.kind, am.repo, am.q, am.age, am.author, am.sort, am.dir, am.group. Also add am.labels (comma-separated), am.needsHuman, am.onHold and am.attention, so that every narrowing filter in stageTrackerFilterActive() round-trips.
  • Unknown or invalid values fall back through stageTrackerNormalizeFilter().
  • If any am.* parameter is present:
    • it wins over localStorage;
    • the tab treats its filter as session-only, so stageTrackerSaveFilter() / stageTrackerSetGroup() do not write localStorage. Two screens on one profile then cannot clobber each other.
  • stageTrackerViewUrl omits default values, preserves other query params and the hash, and never includes a token or credential.
  • Document the am.* grammar in a new "Display mode and URL views" section of src/docs/streaming-the-activity-monitor.md. Repeat the existing private-repository warning there: a link describes a view and does not grant access, and the viewer still signs in with their own access.

Decision taken by hive: an am.* URL makes the tab session-only for the whole tab, rather than only in display mode. This is the simplest rule that stops the clobbering, and it is additive, since no URL today carries am.*.

Decision taken by hive: waitingOnYou stays on the existing ?filter=waiting-on-you path and is not duplicated as an am.* key. It is per-user, so it cannot describe a shared wall view.

Acceptance

  • ?am.kind=pr&am.repo=hivecommons/hive&am.group=repo renders that filter in a fresh profile and leaves localStorage untouched.
  • stageTrackerViewUrl(stageTrackerFilterFromUrl(u)) round-trips to an equivalent URL.
  • Without am.*, load and save behave exactly as before.
  • changelog.d/added-activity-monitor-url-views.md fragment.

Tests

  • New src/pkg/dashboard/stage_tracker_url_view.test.js (node:test). Lift the helpers from static/index.html by marker, the same way sse_watchdog_helpers.test.js / stage_tracker_popout.test.js do.
  • Cover: round-trip, invalid values, am.* precedence over localStorage, and no write-back.
  • CI runs the tests; per AGENTS.md, do not run them locally.

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

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    agent/scannerCreated or modified by the scanner agent
    on Oct 31, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 31, 2026
  3. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    Folded finding. This was filed as a separate issue, but 1 open agent-filed issue (plus 2 closed as completed in the last 14 days) already cite src/docs/streaming-the-activity-monitor.md, so it was folded into the oldest of them instead of opening another. Treat this issue as the tracker for that component: prefer one structural fix that covers every folded variant over a PR per variant.

    [scanner] Add attended ?display=1 mode with a 📺 header button to the Activity Monitor

    Part of #15860

    Add an attended display mode for the Activity Monitor that is reachable from the UI and easy to leave. This is the "getting in and out" piece of Part A. It reuses the existing pop-out / full-screen shell from #15829 and leaves headless ?kiosk=1 alone.

    Decision constraints that apply (from the maintainer's /hive decision on #15860)

    • Reuse the existing pop-out/full-screen shell.
    • Preserve existing headless ?kiosk=1 behaviour. What ?kiosk=1 renders for the streamer must not change.
    • Make no change to the ordinary Activity Monitor layout or flow when display mode is off. The only visible addition is one header button.
    • Full screen and wake lock are separate explicit user controls and are not requested automatically. Entering display mode must not call requestFullscreen or navigator.wakeLock. Those controls come in a follow-up child.
    • Add no new mutation privileges and no new credential. Use the existing authenticated viewer access.

    Where

    • src/pkg/dashboard/static-src/js/boot.js: the first IIFE parses kiosk / popout into window.HIVE_KIOSK / HIVE_POPOUT and sets the body classes before first paint.
    • src/pkg/dashboard/static-src/js/sections.js: STAGE_TRACKER_HEADER_TOOLS_HTML holds the ⧉ / ⛶ buttons.
    • src/pkg/dashboard/static-src/js/tracker-popout.js: stageTrackerPopoutUrl(), stageTrackerDashboardUrl(), stageTrackerFullscreenHotkey() and the keydown listener.
    • src/pkg/dashboard/static-src/css/popout.css: the body.popout-mode / body.ham-fullscreen chrome-less rules, plus body.kiosk-mode .ham-header-tool { display:none }.
    • Regenerate src/pkg/dashboard/static/index.html with go generate ./src/pkg/dashboard/webstatic.

    What

    • New URL flag ?display=1:
      • boot.js sets window.HIVE_DISPLAY and body.display-mode before first paint.
      • Kiosk wins if both kiosk=1 and display=1 are present.
      • Display mode lands on #section-activity-monitor-section, like pop-out does.
    • popout.css: add body.display-mode to the existing chrome-less selector lists. Do not add a new stylesheet. Display mode differs from kiosk in four ways:
      • it is attended, so the cursor is not hidden;
      • sound keeps the user's normal setting, with no kiosk sound default;
      • it never writes layout or theme to localStorage;
      • it hides the row ⋯ / context-menu and multi-select affordances, so a wall view offers no actions. This is presentation only; server authorization is unchanged.
    • A third header tool, 📺 Display, sits beside ⧉ and ⛶. It navigates to the current URL with display=1 added (via a pure stageTrackerDisplayUrl(href, on)), keeping any other query such as am.* (see the sibling URL-views child) and theme.
    • Exit: Esc (when not in browser full screen, which consumes Esc itself), or d while focus is in the tracker, navigates to the URL with display removed. d also enters display mode from the tracker. Mirror stageTrackerFullscreenHotkey() in a pure stageTrackerDisplayHotkey(ev, inTracker, typing).
    • body.kiosk-mode keeps hiding all .ham-header-tools, so the streamer never shows 📺.
    • Add a short "Display mode" paragraph to src/docs/streaming-the-activity-monitor.md, in the section created by the URL-views child or a new one.

    Decision taken by hive: use a new display=1 flag instead of adding kiosk=1 as the RFC sketched. kiosk=1 hides the cursor and every header tool and forces sound on, which would make an attended display impossible to exit. Changing kiosk would also change what the headless streamer renders, which the decision forbids.

    Acceptance

    • 📺 enters display mode; Esc or d leaves it. Neither path requests full screen or a wake lock.
    • With no display param, the Activity Monitor DOM and CSS behave as today apart from the added 📺 button. TestKioskModeWiring, TestKioskSoundDefault and stage_tracker_popout.test.js still pass.
    • In ?kiosk=1, 📺 is hidden and kiosk output is unchanged.
    • changelog.d/added-activity-monitor-display-mode.md fragment.

    Tests

    • Extend src/pkg/dashboard/stage_tracker_popout.test.js, or add stage_tracker_display.test.js next to it, for stageTrackerDisplayUrl and stageTrackerDisplayHotkey.
    • Add a Go wiring assertion to src/pkg/dashboard/kiosk_mode_test.go (TestDisplayModeWiring) that boot.js sets display-mode and that kiosk still wins.
    • CI runs the tests; do not run them locally (see AGENTS.md).

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


    Folded finding. This was filed as a separate issue, but 2 open agent-filed issues (plus 1 closed as completed in the last 14 days) already cite static/index.html, so it was folded into the oldest of them instead of opening another. Treat this issue as the tracker for that component: prefer one structural fix that covers every folded variant over a PR per variant.

    [scanner] Add Matrix Rain and Cascade renderer behind ?kiosk=1&view=matrix

    Part of #15862 (Activity Monitor Matrix mode), Phase 2. This child adds the browser renderer for Rain and Cascade. It is reachable only through an explicit display URL and consumes the authorized endpoint and nudge from #15935.

    Decision constraints that apply

    • Experimental and opt-in. The normal tracker and Activity Monitor must not change. No new header tab, no default view change, and no change to ?kiosk=1 without view=matrix.
    • Ship Rain plus Cascade first, with a reduced-motion/static fallback, pause, and clear source/freshness labels.
    • Display or kiosk availability never grants code access. The renderer only shows what the authenticated /api/matrix/lines returns.
    • Text renders to <canvas> or text nodes only, never as HTML (no innerHTML with line content).

    Change

    • Entry: in src/pkg/dashboard/static-src/js/boot.js, next to the ?kiosk=1 handling (lines 24–39), read view and set window.HIVE_MATRIX = kiosk && view === 'matrix'. Only when that is true, add body.matrix-mode and call hiveMatrixStart(). Every other path behaves exactly as today.
    • static-src/js/matrix.js (new):
      • On start, call GET /api/matrix/lines?since=0. A 404 shows a small static notice ("Matrix mode is not enabled on this hive") and draws nothing else. A 401/403 shows an auth notice.
      • Listen for code-lines on the existing /api/events EventSource. Do not open a second one. On each nudge, pull ?since=<lastSeq>.
      • Rain (default): one <canvas>, glyph atlas and requestAnimationFrame. Column glyphs come from real incoming lines. The head glyph is bright and the trail fades.
      • Cascade: whole lines fall at varying speeds, with a repo#PR · path caption.
      • Select the effect with mx.effect=rain|cascade. Also support mx.speed, mx.fps (default 30) and mx.palette (green|amber|gold), with matching localStorage keys hive.matrix.*.
      • Pause: stop on document.hidden (visibilitychange) and with the p/Space key toggle. Show a visible "paused" label.
      • Reduced motion: under prefers-reduced-motion: reduce, show a static, slowly paging list of the latest lines as text nodes, with no animation loop.
      • Labels: a persistent corner label reads "Source: lines pushed by hive · public allowlisted repos", plus a freshness indicator ("last line 2m ago", or "stale" after 10 min with no new seq).
    • static-src/css/matrix.css (new): rules scoped under body.matrix-mode only.
    • Register both files in static-src/manifest.txt. Regenerate static/index.html with cd src && go generate ./pkg/dashboard/webstatic/ (Makefile target). It is a generated artifact, so commit it with the sources.
    • Add a changelog.d/added-15862-matrix-display.md fragment.

    Acceptance criteria

    • /?kiosk=1 without view=matrix, and the normal dashboard, show no matrix-mode class and no Matrix code runs, so the tracker is unchanged.
    • /?kiosk=1&view=matrix with the feature off shows only the "not enabled" notice.
    • Line content never goes through innerHTML, insertAdjacentHTML or document.write.
    • A hidden tab stops the rAF loop, and reduced motion renders the static list.
    • The source and freshness labels are always visible in Matrix mode.

    Tests

    New src/pkg/dashboard/matrix_ui_test.go, in the style of the existing *_ui_test.go tests that assert on the generated index.html/static sources. It asserts:

    • the gating (view === 'matrix' together with kiosk);
    • no innerHTML use in matrix.js;
    • visibilitychange and prefers-reduced-motion handling are present;
    • all CSS selectors are scoped under .matrix-mode;
    • manifest registration and an up-to-date index.html, which the existing -check generator guard also enforces.

    Files

    Hand-edited (5): static-src/js/matrix.js (new), static-src/css/matrix.css (new), static-src/js/boot.js, static-src/manifest.txt and src/pkg/dashboard/matrix_ui_test.go (new). Generated: static/index.html. Plus the one changelog fragment.

    Decision taken by hive: the only entry point is ?kiosk=1&view=matrix, the RFC's own parameter name. The RFC's header "Matrix tab" is deferred, because the decision says the normal tracker must not change.
    Decision taken by hive: the renderer detects the feature from /api/matrix/lines returning 404, not from a new status field, which keeps the change additive and avoids touching server.go.

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

  4. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    Note on the folded finding above: it was folded here by mistake. It is a separate sibling child of #15860 and is now tracked in #15925. This issue's scope is unchanged: only the am.* URL views described in the body. Ignore the folded display-mode text when implementing this issue.

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

  5. clubanderson commented on Oct 31, 2026

    @clubanderson
    Member

    @hanthor Tracking implementation of your RFC #15860 here. Implementer requirement: mention @hanthor in the associated PR description, link this issue and RFC #15860, and post a completion comment mentioning @hanthor after the PR actually merges, with the merge link and a clear distinction between source shipped and deployment/activation. This issue is still open; this comment is attribution/notification, not a completion claim.

  6. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated or modified by the scanner agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions