Skip to content

feat: v1 dashboard scaffold + WS activity feed (PR-B2)#16

Closed
AquiGorka wants to merge 1 commit into
mainfrom
feat/network-dashboard-activity-feed-scaffold
Closed

feat: v1 dashboard scaffold + WS activity feed (PR-B2)#16
AquiGorka wants to merge 1 commit into
mainfrom
feat/network-dashboard-activity-feed-scaffold

Conversation

@AquiGorka
Copy link
Copy Markdown
Contributor

Summary

First UI vertical slice for the network-dashboard build. Coordinated with council-platform #42 (PR-B1: public WS + provider_added emit) and local-dev #(B3: config wiring). Merge order: A → B1 → B2 → B3.

What ships

  • New landing view at / — right-rail activity feed (280×630 px) per the PM-signed design sketch.
  • One card kind: green ✓ PP joined Council X with provider pubkey truncated + council name resolved from the server payload.
  • Up to 5 visible cards. Each fades out at 8s via CSS keyframe.
  • WS client (src/lib/ws-client.ts) — connect/parse/dispatch + exponential reconnect (1s → 30s cap). Subprotocol moonlight.network.v1 matching the server.
  • deriveWsUrl(councilPlatformUrl) swaps http(s) → ws(s) and appends /api/v1/public/events/ws.
  • Connection status indicator in the feed header ("Connecting…" / "Live" / "Reconnecting…").

Removed per Phase 0 ack

  • public/world-map.svg
  • src/lib/world-map.ts (country-name lookup extracted to src/lib/country-names.ts, kept for /councils + /council/:id jurisdiction labels)
  • src/lib/geo_test.ts
  • src/views/map.ts
  • Nav "Map" link → "Dashboard" link to /

What this PR does NOT do

  • Zone 1 (counter strip) and Zone 2 (topology) — future vertical slices.
  • Other five event kinds — future vertical slices, one or two kinds per PR.

PM question

/councils, /council/:id, and /transactions are kept for now. Design sketch says v1 is aggregate-only with no drill-down. Decision time for a follow-up vertical slice that retires those routes — flag here, not deciding unilaterally.

Test plan

  • deno fmt --check — 31 files
  • deno lint — 24 files
  • deno task check — clean
  • deno task test — 33/33 (7 new WS-client tests, 4 new country-names tests)
  • deno task build — clean bundle
  • PM merge B1 → B2 → B3, run down → up, open http://localhost:3040, status should flip to "Live". After setup-c.sh && setup-pp.sh, a green ✓ PP joined card appears in the right rail and fades after 8s.

deno.json bump

0.2.10 → 0.2.11

Coordinated PR-B2 with council-platform PR-B1 (public WS + provider_added
emit) and local-dev PR-B3 (config wiring). Merge order: A → B1 → B2 → B3.

What this adds (SPA side):

- src/lib/network-events.ts — wire-frame types matching council-platform's
  server-side types module. NetworkEventKind union, NetworkEventFrame,
  ServerFrame discriminated union.
- src/lib/ws-client.ts — connectNetworkEvents() opens the WS, parses
  frames, dispatches to onHello/onEvent handlers, reconnects with
  exponential backoff (1s → 30s cap). deriveWsUrl() swaps http(s) → ws(s)
  and appends /api/v1/public/events/ws. 7 unit tests covering parse +
  derive paths.
- src/views/dashboard.ts — new landing view. Right-rail activity feed
  (280×630 box). Renders one card kind for now: green ✓ PP joined Council
  X, with provider pubkey truncated and council name resolved from the
  payload (denormalized server-side). Up to 5 visible cards; each fades
  out after 8s via CSS keyframe. WS connection status surfaces via the
  feed header.
- Routing: / now renders the dashboard scaffold directly. /map route +
  view + assets (public/world-map.svg, src/lib/world-map.ts,
  src/lib/geo_test.ts) deleted per Phase 0 ack. Country-name lookup
  extracted into src/lib/country-names.ts (still used by /councils +
  /council/:id).
- Nav: Map link replaced with Dashboard. /councils + /council/:id +
  /transactions routes preserved for now — PM question surfaced in PR
  report.

CI rollup (local): fmt 31 files clean, lint 24 clean, deno task check
clean, deno task test 33/33 (7 new ws-client + 4 new country-names).
deno task build clean. deno.json patch bump 0.2.10 → 0.2.11.

What this PR explicitly does NOT do:
- Zone 1 (counter strip) and Zone 2 (topology) are future vertical slices.
- Other 5 event kinds (council_formed, provider_removed, asset_registered,
  channel_deposit, channel_settlement) wait for their own slices.
@AquiGorka
Copy link
Copy Markdown
Contributor Author

Closing per PM direction — superseded.

@AquiGorka AquiGorka closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant