Skip to content

🐛 Activity Monitor: show Let hive decide beside the lead; action pills read as buttons - #16544

Merged
clubanderson merged 2 commits into
v5from
fix/lead-delegate-inline
Nov 4, 2026
Merged

clubanderson merged 2 commits into
v5from
fix/lead-delegate-inline

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #16543

What

  • Two inline pills on a human-decision row. stageTrackerLeadCompanion adds the Decide… submenu's decide:delegate ("Let hive decide") beside the server lead when the row is parked on a human decision (decision_needed on the item / its one parked PR, stage_actor.kind == "human", or stage 085) and the lead isn't already delegate. stageTrackerLeadActionsOnRow returns [lead, delegate]; stageTrackerLeadActionHtml renders both, lead first. Rows not parked on a human decision keep a single pill; passive chips and stageTrackerLeadAction/stageTrackerLeadActionOnRow keep their single-action API (tracker-human-attention.js). Both buttons carry data-ham-act and run the existing delegated click path (stageTrackerDecisionRun), same as the ⋯ entries.
  • Action pills read as buttons. .ham-lead-act is now a filled chip (ham-act-primary amber, ham-act-secondary neutral for delegate, ham-menu-danger red for a server-led close) with a trailing ▸ ::after glyph, pointer cursor, hover brightness + focus ring; disabled stays dashed/faint and drops the glyph. Record pills (.ham-badge: adopted from, base branch, …) are untouched muted outlines.
  • Tooltip. The lead's title is the server consequence; when absent, STAGE_TRACKER_ACTION_CONSEQUENCES supplies a clause per verb (re-author, delegate, adopt, accept-triage). Delegate's hover no longer says just "delegate".

Tests

  • stage_tracker_lead_action_test.go: two buttons for a lead+delegate row (order, classes, target, enabled state, reader-disabled state), one for a parked issue whose lead is delegate, Re-author fixture (✨ feat(github): enforce pin-only exception in merge-request relay #16456 shape) with consequence tooltip fallback and server override, red danger lead, record class never on actions; fixture-wide maintainer-rows test asserts 2 only when a Decide… target exists.
  • stage_tracker_decided_ui_test.go: the adopted-from record chip carries ham-badge and never ham-lead-act/<button>.
  • CSS presence assertions for the glyph, secondary and danger rules.

make dashboard-gen-check clean; go test ./pkg/dashboard/ -run StageTracker green; gofmt clean on changed Go files.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 4, 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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026 •

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
#16545 🐛 Activity Monitor: never more than two lit chevrons; unreported CI is pending, not amber same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16542 🐛 fix: limit Activity Monitor chevrons to observed motion same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16541 🐛 fix: route undeliverable fixer kicks to fallback agents same files src/pkg/dashboard/static/index.html
#16514 ✨ feat(dashboard): replace Matrix presentation with Code activity same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16500 ✨ feat(dashboard): replace Matrix presentation with Code activity same files src/pkg/dashboard/static/index.html
#16513 ✨ feat(dashboard): feed published checkpoint diff regions to Code activity same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16492 ✨ feat(dashboard): changed-paragraph reader kiosk view (part 1/3) same files src/pkg/dashboard/static-src/css/tracker.css
src/pkg/dashboard/static/index.html
#16546 🐛 fix: expose deferred PR fixer queue positions same files src/pkg/dashboard/static/index.html

@hivecommons-hive

hivecommons-hive Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (rest 3/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

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

Intent alignment (reviewed head 5f2c089; the dispatched e104cf5 was superseded)

The diff does what #16543 asks: lead + "Let hive decide" inline on a human-decision row, filled <button> pills vs. muted ham-badge records, click routed through data-ham-act → stageTrackerDecisionRun (tracker-actions.js:896-907). Two in-scope gaps where the second pill meets code that still assumes one pill per row:

  1. Delegate pill never shows its busy state. stageTrackerPendingSync syncs only the first lead pill: n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]') (tracker-actions.js:2360). The delegate preview tags its pend busy='decide:delegate' (:1889), but on a Re-author row the first pill is decide:re-author, so stageTrackerLeadBusySync (:2331) matches nothing — no spinner/"Asking the hive…" on the pill the user just pressed, and it stays visually clickable (the _stageTrackerDelegatePreviewing guard at :1879 prevents a double fire, so this is affordance only). The CSS busy rule the PR keeps (tracker.css "Busy (Let hive decide gathering its preview)") is dead for the companion pill.

            for (const lead of n.querySelectorAll(':scope > .ham-row-head .ham-lead-act[data-ham-act]')) stageTrackerLeadBusySync(lead, busy[key] ? busy[key].busy : '', busy[key] ? busy[key].caption : '');
    
  2. Companion tooltip ignores the server consequence. 🐛 Activity Monitor: needs-human row shows only "Re-author"; "Let hive decide" hidden under ⋯ and the pill reads like a record #16543 asks for "a tooltip from the server consequence". stageTrackerLeadCompanion forces hint: STAGE_TRACKER_ACTION_CONSEQUENCES['decide:delegate'] (tracker-actions.js:578), and stageTrackerLeadPillHtml reads a.hint before a.consequence (:618), so a server-sent consequence on the decide:delegate option (carried by stageTrackerDecideOptions, :967) is always shadowed by the client clause. Dropping the override is enough — the pill already falls back to the table when the server sends nothing:

          return Object.assign({}, o, { target: decide.target, enabled, why: enabled ? '' : (decide.enabled ? o.why : decide.why), companion: true });
    

    (The existing test "delegate explains itself on hover" still passes since its fixture has no consequence; worth adding one asserting the server text wins for delegate too, as the Re-author case already does.)

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

Correctness review (read at head 5f2c089, the current head; the dispatched e104cf5 has been superseded).

The two-pill render and click dispatch check out: both buttons carry data-ham-act, the row-head click handler resolves whichever .ham-lead-act was pressed (tracker-actions.js:896-907), and stageTrackerLeadCompanion returns null for passive/delegate leads so the dedupe in stageTrackerLeadActionOnRow still holds. One regression in the busy feedback path:

stageTrackerPendingSync only busies the first pill, so the inline "Let hive decide" never shows its working state — src/pkg/dashboard/static-src/js/tracker-actions.js:2360

stageTrackerPendingSync does n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]') — a single-element lookup written when a row had one pill. The only tagged pend is the delegate preview (stageTrackerDelegatePreview, line 1889, busy = 'decide:delegate'). On the rows this PR targets (lead = Re-author / Merge now, companion = delegate) the first pill's data-ham-act is the lead, so stageTrackerLeadBusySync sees on === false and does nothing: the button the user just pressed shows no spinner / "Asking the hive…" caption and keeps its enabled look while the plan is fetched. Before this PR the delegate pill, when shown, was always the first (only) one, so it did get the busy state. A second click is still swallowed by _stageTrackerDelegatePreviewing (line 1878), so this is feedback loss, not a double-fire. Suggested fix — sync every pill in the slot:

        for (const b of n.querySelectorAll(':scope > .ham-row-head .ham-lead-act[data-ham-act]')) stageTrackerLeadBusySync(b, busy[key] ? busy[key].busy : '', busy[key] ? busy[key].caption : '');

(and regenerate static/index.html). A one-line addition to the stageTrackerPendingSync fixture in stage_tracker_row_actions_test.go with two .ham-lead-act buttons in the row head, pending tagged 'decide:delegate', asserting the second gets aria-busy="true", would lock it in.

…ion pills read as buttons

A row parked on a human decision rendered only the server's lead pill
(Re-author); Let hive decide sat under ⋯ → Decide…, invisible. Both now
render inline, lead first, via stageTrackerLeadCompanion /
stageTrackerLeadActionsOnRow, wired to the same data-ham-act dispatch.

Inline action pills were the same muted outline as record pills
(adopted from #N, base branch) and read as history. They are now filled
buttons — amber primary, neutral secondary, red danger — with a trailing
▸ glyph, hover/focus ring, and a consequence tooltip (server consequence,
else a client clause per verb).

Fixes #16543

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…e ratchet)

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson force-pushed the fix/lead-delegate-inline branch from e104cf5 to 5f2c089 Compare November 4, 2026 04:32

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

Read tracker-actions.js on e104cf5 end to end for the pill path (render → click → pending/busy). The companion wiring is sound: stageTrackerLeadPillHtml emits data-ham-act="decide:delegate" and the row click handler (tracker-actions.js:896-906) dispatches by that id into stageTrackerDecisionRun, the same path the ⋯ entry uses, and the hover prefetch at :884 matches it too. stageTrackerLeadCompanion derives enable/why from the real decide submenu entry rather than a second source of truth. Looks correct to me, with one verified gap:

Finding (medium, visual only): the busy state never reaches the companion pill.

  • tracker-actions.js:2360 — stageTrackerLeadBusySync(n.querySelector(':scope > .ham-row-head .ham-lead-act[data-ham-act]'), …) passes only the first .ham-lead-act in the row head.
  • tracker-actions.js:2331 — on = busyAct && lead.getAttribute('data-ham-act') === busyAct.
  • tracker-actions.js:1889 — the delegate preview tags its pend with busy='decide:delegate'.

On exactly the row this PR targets (lead = decide:re-author, companion = decide:delegate), the first pill's id is decide:re-author ≠ decide:delegate, so on is false and the "Let hive decide" button never gets aria-busy / the Asking the hive… spinner that stageTrackerDelegatePreview's own comment (:1881-1886) and the .ham-lead-act[aria-busy="true"] CSS rule promise. Before this PR the delegate pill was always the only/first pill, so the selector was sufficient. Double-submission is still prevented by _stageTrackerDelegatePreviewing (:1876-1880), so this is feedback, not state. Fix is one line: select .ham-lead-act[data-ham-act="<busy>"] (or querySelectorAll and sync each).

The new tests in stage_tracker_lead_action_test.go cover render/ordering/tone but not the busy sync, which is why CI is green on it.

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

@clubanderson
clubanderson merged commit 425e6b9 into v5 Nov 4, 2026
82 of 84 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix/lead-delegate-inline branch November 4, 2026 04:40
@github-actions

github-actions Bot commented Nov 4, 2026

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

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/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Activity Monitor: needs-human row shows only "Re-author"; "Let hive decide" hidden under ⋯ and the pill reads like a record

1 participant