feat: sparser robot nudges, typed unread badge, lobby unread bump #87

Merged
developer merged 1 commits from feature/robot-nudge-badge-sort into development 2026-06-19 18:36:34 +00:00
Owner

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.go asleep) 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-viewer unread_messages flag (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 a chat_message does not raise it). Badge decision extracted to ui/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.chatUnread flag — no new backend field for sorting.

Notes

  • No DB migration (chat_messages.kind already exists); the new wire bool is backward-compatible, so no contour schema wipe.
  • Docs updated in the same PR: docs/ARCHITECTURE.md §7 + unread mask, docs/FUNCTIONAL.md (+ _ru mirror).
  • All R-phases in PRERELEASE.md are done; this standalone tweak is not part of an open phase, so no tracker line.

Tests (all green locally)

  • Go: build, vet, gofmt, unit, full -tags=integration suite (re-baselined TestRobotProactiveNudge to 8 h→0 / 24 h→1 with drift-robust daytime drives; TestProactiveNudgeGap to the flat band; chatread_test.go asserts the message/nudge split; gateway transcode_test.go asserts unread_messages).
  • UI: pnpm check (0/0), pnpm test:unit (290, incl. new unread.test.ts + lobbysort bump case), pnpm build, pnpm test:e2e (150, Chromium + WebKit).
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.go` `asleep`) 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-viewer `unread_messages` flag (`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 a `chat_message` does not raise it). Badge decision extracted to `ui/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.chatUnread` flag — no new backend field for sorting. ### Notes - **No DB migration** (`chat_messages.kind` already exists); the new wire bool is backward-compatible, so **no contour schema wipe**. - Docs updated in the same PR: `docs/ARCHITECTURE.md` §7 + unread mask, `docs/FUNCTIONAL.md` (+ `_ru` mirror). - All R-phases in `PRERELEASE.md` are done; this standalone tweak is not part of an open phase, so no tracker line. ### Tests (all green locally) - Go: build, vet, `gofmt`, unit, **full** `-tags=integration` suite (re-baselined `TestRobotProactiveNudge` to 8 h→0 / 24 h→1 with drift-robust daytime drives; `TestProactiveNudgeGap` to the flat band; `chatread_test.go` asserts the message/nudge split; gateway `transcode_test.go` asserts `unread_messages`). - UI: `pnpm check` (0/0), `pnpm test:unit` (290, incl. new `unread.test.ts` + lobbysort bump case), `pnpm build`, `pnpm test:e2e` (150, Chromium + WebKit).
developer added 1 commit 2026-06-19 14:51:16 +00:00
feat: sparser robot nudges, typed unread badge, lobby unread bump
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 9s
CI / integration (pull_request) Successful in 13s
CI / ui (pull_request) Successful in 53s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m26s
6e77de4c1e
Three owner-requested polish changes:

- robot: replace the lengthening 60-90 min -> 6 h proactive-nudge ramp with a
  flat uniform 9-12 h wait before every nudge; the existing sleep-window gate
  still skips and defers a nudge that would land in the robot's night.
- ui: colour the lobby/in-game unread dot by type -- the regular danger colour
  when a chat message is unread, a softer amber (--warn) when only nudges are.
  Adds a per-viewer unread_messages flag (chat_messages.kind='message') across
  the backend DTO, FlatBuffers wire, gateway transcode and the UI store.
- ui: float games with any unread notification to the top of the lobby's
  your-turn and opponent-turn sections (finished keeps its order), reusing the
  existing unread_chat flag.

Docs (ARCHITECTURE 7, FUNCTIONAL + _ru) updated. No DB migration; the new wire
field is backward-compatible.
owner approved these changes 2026-06-19 18:35:59 +00:00
developer merged commit 9ded5d3d86 into development 2026-06-19 18:36:34 +00:00
developer deleted branch feature/robot-nudge-badge-sort 2026-06-19 18:36:34 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#87