feat: v1 dashboard scaffold + WS activity feed (PR-B2)#16
Closed
AquiGorka wants to merge 1 commit into
Closed
Conversation
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.
Contributor
Author
|
Closing per PM direction — superseded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
/— right-rail activity feed (280×630 px) per the PM-signed design sketch.✓ PP joined Council Xwith provider pubkey truncated + council name resolved from the server payload.src/lib/ws-client.ts) — connect/parse/dispatch + exponential reconnect (1s → 30s cap). Subprotocolmoonlight.network.v1matching the server.deriveWsUrl(councilPlatformUrl)swaps http(s) → ws(s) and appends/api/v1/public/events/ws.Removed per Phase 0 ack
public/world-map.svgsrc/lib/world-map.ts(country-name lookup extracted tosrc/lib/country-names.ts, kept for/councils+/council/:idjurisdiction labels)src/lib/geo_test.tssrc/views/map.ts/What this PR does NOT do
PM question
/councils,/council/:id, and/transactionsare 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 filesdeno lint— 24 filesdeno task check— cleandeno task test— 33/33 (7 new WS-client tests, 4 new country-names tests)deno task build— clean bundledown → up, openhttp://localhost:3040, status should flip to "Live". Aftersetup-c.sh && setup-pp.sh, a green✓ PP joinedcard appears in the right rail and fades after 8s.deno.json bump
0.2.10 → 0.2.11