Issue #718 - Witness Dashboard Feature

Witness Dashboard – Implementation Summary

Witnesses page (/witnesses)

  • Added an Actions column at the right of the table with two icon buttons per row:
    • Heart for voting — outline when you haven't voted, filled bright red when you have.
    • Handshake / ArrowLeftRight / Unlink for proxy — shows different icon depending on whether this witness is your proxy, someone else is, or no proxy is set.
  • Both buttons enforce real rules:
    • You can't vote when a proxy is set (tooltip explains).
    • You can't add a 31st vote (tooltip explains).
    • The vote column only appears for the logged-in user's own view (others can't see action buttons on someone else's filter).
  • Clicking Heart (outline) casts a vote; clicking Heart (filled) removes the vote. Works with both Keychain and Hivesigner.
  • Clicking Handshake sets that witness as your proxy. If you already have a different proxy, the icon becomes ArrowLeftRight ("Replace Proxy"). If this witness is your proxy, the icon becomes Unlink ("Remove Proxy").
  • Voter filter (?voter=libanista) is preserved across the Hivesigner round-trip — you stay in the filtered view.

Voter filter banner

  • A single banner at the top of the witnesses page in two flavours:
    • Blue when you're filtering by a voter who has no proxy: "Showing witness votes for @libanista (28/30)".
    • Amber when a proxy is involved: "@libanista uses @gtg, who uses @actifit as a voting proxy" (renders the full multi-hop chain, matches the existing AccountWitnessVotesCard phrasing).
  • Right-side pill: "Show all witnesses" chip to clear the filter — styled to match the action buttons.
  • When the banner is for your own proxy, it also shows a compact Unlink button to remove the proxy in one click.

Witness profile page (/@witnessname)

  • New pill buttons in the header right under the avatar:
    • Vote / Unvote pill (Heart icon, green or red).
    • Set Proxy / Replace Proxy / Remove Proxy pill (Handshake / ArrowLeftRight / Unlink).
  • Both pills show the same state logic as the table buttons.

Hivesigner flow

  • For Active-key operations (vote/proxy), Hivesigner can't sign through its API, so the button redirects to the Hivesigner sign page.
  • After signing successfully, Hivesigner sends you back to /witnesses?hsAction=…&hsWitness=….
  • On arrival, the page:
    1. Toasts a success message (8 seconds, dark-mode aware).
    2. Invalidates witness caches so the table reflects the new state.
    3. Scrolls to the affected witness's row.
    4. Strips the hsAction / hsWitness params from the URL.
  • For unvote inside a ?voter=… filter, the scroll is skipped (the row is gone).
  • If you reject on Hivesigner, you never come back — no false-success toast.

Keychain flow

  • Broadcasts in place, no redirect.
  • Optimistic cache update so the button state flips instantly.
  • 6 s later a refetch pulls the canonical chain state.
  • Toast shows immediately (8 seconds).

Empty filtered view

  • When /witnesses?voter=… returns no results (voter has no votes and no proxy), the page shows the standard NoResult component plus a prominent "Browse all witnesses" button to clear the filter.

Dashboard widget — "My Witness Votes"

  • New widget surfaces the logged-in user's voted witnesses (or their proxy's votes if a proxy is set).
  • Shows a status summary: X/30 votes used · Y active · Z inactive.
  • If a proxy is set, an amber banner above the list shows the full chain (@you uses @proxy1, who uses @proxy2 as a voting proxy).
  • Per-row info: avatar, name, status dot, rank, missed blocks, feed age (localised, matches witnesses page formatting).
  • Sortable by Status / Rank / Missed / Feed Age — click the column header. Sort preference is persisted per user in localStorage.
  • Scrollable list (caps at ~7 rows visible).
  • Empty state when no votes: shieldOff icon + link to the witnesses page.
  • Distinct empty state when a proxy is set but the proxy itself hasn't voted yet.

Toasts

  • All vote / unvote / proxy / remove-proxy actions toast for 8 seconds.
  • Toasts now respect the active theme (dark/light) instead of always rendering light.

Navigation

  • New "My Witness Votes" entry in the user dropdown menu — links to /witnesses?voter=<you>.
  • New "witness-health" widget registered in the dashboard widget registry so it can be added to the modular dashboard.
  • Widget also placed in the right sidebar of the standard home page for logged-in users.

Merge request reports

Loading
Loading