feat(m2): public shard widgets + live SSE stream #7
Reference in New Issue
Block a user
No description provided.
Delete Branch "feat/m2-public-shard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
M2 — Public shard (functional pass)
Implements M2 of
docs/android/PLAN.md§6.2: the public shard widgets over/api/v1/public/shard/*, plus the live SSE stream with reconnect/backoff and graceful degradation (§7). Functional Kotlin pass only — placeholder Compose UI; the design pass is M5.What's in it
ShardDto.kt) mirroringpublic/shard.controller.js: status / economy / feed / online / presence / champs / guilds / governors (+ history) / houses.ignoreUnknownKeyskeeps additive backend fields safe, and the live*.updateframes decode into the same board DTOs.PublicApi: the/public/shard/*GETs.ShardStreamClient: OkHttp SSE over/public/shard/stream. Unlike the browserEventSourceit reconnects itself — a coldFlow<ShardStreamEvent>with growing backoff (reset on open), no read timeout for the idle keepalive, and clean teardown on cancel, so a dropped feed degrades to "offline" rather than crashing.ShardRepository: typedApiResultsnapshot reads + the shared live feed and frame decoders.LiveBoard, mirroring the website's merge semantics. Wired into the shared navigation drawer (§5); all strings externalized (§2)./admin— only the public shard reads and the public SSE channel (safe kinds only).Tests (28, all green)
DTO + live-frame decode,
LiveBoardmerge, event-text formatting (parity withlib/shardEvents.js), and SSE frame parsing.Verification
./gradlew lint test assembleDebugpasses locally.AI-assisted: authored with Claude Code (Opus). AI-authored commit carries a
Co-Authored-By: Claudetrailer per org policy.🤖 Generated with Claude Code