Files
amethyst/commons
Vitor PamplonaandClaude Opus 4.8 2b4148ef19 feat(concord): scroll-back history pagination for channels
Concord channels only showed the recent tail the relay served for the
channel plane and never loaded older messages on scroll. Add backward
`until`+`limit` paging, per relay, on demand — the same model as the
NIP-04 per-conversation history.

Reuses the shared paging stack as-is (BackwardRelayPager,
RelayLoadingCursors, the RelayReach* markers/sentinels and
DmHistoryLoadingCard); only the Concord-specific data layer is new:

- ConcordChannel holds a per-channel RelayLoadingCursors (`history`), so
  cursors share the channel's cache lifetime.
- ConcordChannelHistory{FilterAssembler,SubAssembler} binds a pager to the
  open channel, builds `{kinds:[1059], authors:[planePk], until, limit}`
  per armed relay, and forwards relay callbacks; registered in
  RelaySubscriptionsCoordinator and mounted by the channel screen.
- ConcordCommunitySession.channelPlaneAddress() resolves a channel's REQ
  author from the fold.
- ConcordChannelScreen wires the olderBoundary/markersInGap/sentinels feed
  hooks and bootstraps an empty channel.

The history floor is `now` (not the DM 7-day tail): the Concord live sub
isn't a strict recent-tail (it asks the plane author unbounded and the
relay caps the result), so paging must walk the whole history from the top
to reach recent-but-capped messages. Overlap with the live tail is
harmless — wraps dedup by id on ingest.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-13 14:04:21 -04:00
..