Files
buzz/docs
Duncan d61d8b1178 refactor(readState): extract drain helpers into readStateDrain.ts
Split the 427-line-over-ratchet readStateManager.ts by moving the
drain-path logic (drainPendingIntents, markChannelUnreadDirect,
markChannelReadDirect, markChannelUnread, markChannelRead) into a new
readStateDrain.ts module. The manager methods become thin delegations
that cast `this` to the DrainContext interface.

readStateDrain.ts exports a DrainContext interface (the public subset of
ReadStateManager state and methods needed for drain operations) and five
standalone functions that implement the Amendment A/B/C drain semantics
verbatim — no behavior change.

File-size ratchet (merge-base 2ea938501):
  readStateManager.ts: 959 → 1000 (allowed 1000) ✓
  readStateDrain.ts: 0 → 313 (new file, ≤1000) ✓
  useUnreadChannels.ts: 1021 → 1021 (allowed 1021) ✓

Tests: 4566/4566 ✓  tsc --noEmit clean ✓
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-07 16:37:45 -04:00
..
2026-07-21 17:16:23 +00:00