feat: sparser robot nudges, typed unread badge, lobby unread bump #87
Reference in New Issue
Block a user
Delete Branch "feature/robot-nudge-badge-sort"
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?
Three owner-requested polish changes (one combined request, one PR).
1. Sparser robot nudges
Replace the lengthening proactive-nudge ramp (first 60-90 min, growing toward 6 h) with a flat uniform 9-12 h wait before every nudge (
proactiveNudgeGap,strategy.go). Repeated nudges of a still-idle turn reuse the same window. The existing sleep-window gate (driver.goasleep) already skips a nudge that would land in the robot's night and fires it at the first scan after wake — owner confirmed this (the robot sleep window) is the intended "absence" gate; no away-window change.2. Unread badge coloured by type
The lobby + in-game unread dot was a single red dot for any unread entry. Now: red when an unread chat message is waiting, softer amber (
--warn) when only nudges are. A new per-viewerunread_messagesflag (chat_messages.kind = 'message') is plumbed through the backend DTO, FlatBuffers wire (unread_messages:bool), gateway transcode and the UI store (seed-from-REST + bump-from-event; a nudge delivered as achat_messagedoes not raise it). Badge decision extracted toui/src/lib/unread.ts(badgeKind) for unit testing.3. Lobby unread bump
Games with any unread notification float to the top of the your-turn and opponent-turn sections; the finished section keeps its current order (owner's choice). Reuses the existing
unread_chat/app.chatUnreadflag — no new backend field for sorting.Notes
chat_messages.kindalready exists); the new wire bool is backward-compatible, so no contour schema wipe.docs/ARCHITECTURE.md§7 + unread mask,docs/FUNCTIONAL.md(+_rumirror).PRERELEASE.mdare done; this standalone tweak is not part of an open phase, so no tracker line.Tests (all green locally)
gofmt, unit, full-tags=integrationsuite (re-baselinedTestRobotProactiveNudgeto 8 h→0 / 24 h→1 with drift-robust daytime drives;TestProactiveNudgeGapto the flat band;chatread_test.goasserts the message/nudge split; gatewaytranscode_test.goassertsunread_messages).pnpm check(0/0),pnpm test:unit(290, incl. newunread.test.ts+ lobbysort bump case),pnpm build,pnpm test:e2e(150, Chromium + WebKit).