feat(ratings): Wallapop-style ratings in chat and offer detail

- SocialSession grows a ratings transport (fifth interface on the one
  shared channel).
- PeerRatingCubit: count, locale-aware average, and circleCount — how
  many ratings come from your own circle (reuses the ego-centric trust
  rule), the signal that makes strangers' review-stuffing irrelevant.
- Chat: slim rating strip under the trust banner; you can rate only
  someone you've talked with (soft anchor until the signed bilateral
  exchange form lands). Sheet with 5 stars + optional comment,
  pre-filled for editing, with a take-back action.
- Offer detail: author's stars under their name, with 'N from people
  you know' when your circle rated them; nothing shown when unrated.
- i18n ratings.* (en/es/pt/ast); tests for cubit and sheet.
This commit is contained in:
vjrj 2026-07-11 13:13:43 +02:00
parent acdacf1821
commit 1926e3bd98
18 changed files with 873 additions and 12 deletions

View file

@ -89,13 +89,14 @@ class SocialService {
}
}
/// One relay channel with the three transports on top the
/// "one channel, three interfaces" shape, at the app layer.
/// One relay channel with the transports on top the
/// "one channel, N interfaces" shape, at the app layer.
class SocialSession {
SocialSession(this._channel, {String deviceId = ''})
: offers = NostrOfferTransport(_channel),
messages = NostrMessageTransport(_channel),
trust = NostrTrustTransport(_channel),
ratings = NostrRatingTransport(_channel),
profile = NostrProfileTransport(_channel),
sync = NostrSyncTransport(
_channel,
@ -108,6 +109,7 @@ class SocialSession {
final OfferTransport offers;
final MessageTransport messages;
final TrustTransport trust;
final RatingTransport ratings;
final ProfileTransport profile;
/// Device-to-device inventory sync for THIS identity's own devices.