feat(chat): usable 1:1 chat — bottom-anchored, Drift-backed, dated

- Anchor the message list to the bottom (`reverse: true`) so new messages
  stay in view instead of landing below the fold.
- Move chat history from the OS keystore (O(n²) JSON blob, silent 200-msg
  cap) to a separate encrypted Drift/SQLCipher DB (`ChatDatabase`):
  indexed append, uncapped history, dedup as a unique-key invariant. It's
  an ephemeral per-device cache, isolated from the inventory schema, its
  migrations, and its sync. No data migration (pre-release).
- Add day separators (Today/Yesterday/locale date) and a per-bubble time,
  all via ICU (12/24h per locale; Localizations locale maps Asturian →
  Spanish for intl date symbols).
- Add peer avatars (deterministic colour from the pubkey + name initial),
  surface send failures that were previously silent, and make bubble text
  selectable (addresses, links).
- New i18n keys in en/es/pt/ast; tests for grouping, formatting, avatars,
  scroll anchoring, storage and send errors.

Docs: docs/design/chat-storage.md + open-decisions.md.
This commit is contained in:
vjrj 2026-07-11 06:39:39 +02:00
parent 171daabce3
commit 6cff0d0b11
27 changed files with 1793 additions and 264 deletions

View file

@ -770,6 +770,9 @@ class _Translations$chat$ast extends Translations$chat$en {
@override String get offline => 'Configura\'l compartir pa unviar mensaxes';
@override String get payG1 => 'Pagar en Ğ1';
@override String get g1Copied => 'Direición Ğ1 copiada — apégala na to cartera';
@override String get today => 'Güei';
@override String get yesterday => 'Ayeri';
@override String get sendError => 'Nun se pudo unviar — comprueba la conexón';
}
// Path: trust
@ -1620,6 +1623,9 @@ extension on TranslationsAst {
'chat.offline' => 'Configura\'l compartir pa unviar mensaxes',
'chat.payG1' => 'Pagar en Ğ1',
'chat.g1Copied' => 'Direición Ğ1 copiada — apégala na to cartera',
'chat.today' => 'Güei',
'chat.yesterday' => 'Ayeri',
'chat.sendError' => 'Nun se pudo unviar — comprueba la conexón',
'trust.none' => 'Naide los avala entá',
'trust.count' => ({required Object n}) => 'Avalada por ${n}',
'trust.vouch' => 'Conozo a esta persona',