feat(sharing): make going online opt-in, and show what it unlocks

Tane dialled its four default relays at launch, before anyone had asked
for anything — an F-Droid reviewer spotted it, and they were right. The
seed book needs no network at all, so the app should not have one until
the person joins the sharing side.

- SocialSettings gains a three-state `sharingEnabled`. `null` means
  "never asked", which is what lets `migrateSharingEnabled` keep an
  existing install exactly as it was: anyone past the intro was on a
  build that connected at launch, so they keep messaging, device sync
  and offer alerts. A fresh install starts fully offline.
- bootstrap only starts the shared connection when sharing is on. The
  inbox/sync/plantaré/alert listeners are untouched: they react to a
  session, and none arrives.
- SharingSwitch is the single place that moves the stored choice, the
  live connection and the flag the UI listens to, so they cannot drift.
- Agreeing to the community rules is the opt-in — one consent surface,
  reached from the market or from the drawer's invitation.
- SocialConnection.start is now idempotent and gains stop(), so turning
  sharing off goes offline immediately instead of at the next launch.
- The social drawer entries stay visible but padlocked while sharing is
  off; tapping one explains what wakes up and offers to join. Hiding
  them would have kept the tool a secret. "Coming soon" is gone for
  good — everything it labelled is built.

Covered by tests for the migration in both directions, start/stop
lifecycle, the gate turning sharing on, the invitation, and the drawer
in all three states (no social layer / off / on).
This commit is contained in:
vjrj 2026-07-25 16:47:56 +02:00
parent 62123582f5
commit fed0e8200e
35 changed files with 926 additions and 173 deletions

View file

@ -58,8 +58,7 @@
"cancel": "Encaboxar",
"delete": "Desaniciar",
"edit": "Editar",
"type": "Triba",
"comingSoon": "Aína"
"type": "Triba"
},
"home": {
"tagline": "Comparte y cultiva simiente llocal",

View file

@ -59,7 +59,6 @@
"delete": "Löschen",
"edit": "Bearbeiten",
"type": "Typ",
"comingSoon": "Bald",
"offline": "Offline - Teilen ist unterbrochen"
},
"home": {

View file

@ -72,7 +72,6 @@
"delete": "Delete",
"edit": "Edit",
"type": "Type",
"comingSoon": "Coming soon",
"offline": "You're offline — sharing is paused"
},
"home": {
@ -572,7 +571,9 @@
"noProfile": "This person hasn't shared a profile yet",
"copyId": "Copy code",
"idCopied": "Code copied",
"photo": "Photo"
"photo": "Photo",
"sharingOnLabel": "Sharing is on",
"sharingOnHelp": "Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same."
},
"profile": {
"title": "Your profile",
@ -780,7 +781,8 @@
"publicNote": "What you publish here is public, and copies may remain even if you remove it later.",
"viewLegal": "Privacy & rules",
"accept": "I agree",
"decline": "Not now"
"decline": "Not now",
"networkNote": "To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn't connect to anything."
},
"report": {
"offer": "Report this offer",
@ -806,5 +808,14 @@
"manageTitle": "Blocked people",
"manageEmpty": "You haven't blocked anyone",
"unblock": "Unblock"
},
"sharingInvite": {
"title": "This wakes up when you start sharing",
"perkChat": "Write to whoever has seeds near you",
"perkFavorites": "Keep the offers you like",
"perkPeople": "Your circle of people you trust",
"networkNote": "For that, Tane needs to go online. Until you say yes, it doesn't talk to anyone.",
"start": "Start sharing",
"notNow": "Not now"
}
}

View file

@ -72,7 +72,6 @@
"delete": "Eliminar",
"edit": "Editar",
"type": "Tipo",
"comingSoon": "Pronto",
"offline": "Sin conexión — el compartir está en pausa"
},
"home": {
@ -571,7 +570,9 @@
"noProfile": "Esta persona aún no ha compartido su perfil",
"copyId": "Copiar código",
"idCopied": "Código copiado",
"photo": "Foto"
"photo": "Foto",
"sharingOnLabel": "Compartir está activado",
"sharingOnHelp": "Si lo desactivas, Tane deja de conectarse a ningún servidor. Tu cuaderno de semillas sigue funcionando igual."
},
"profile": {
"title": "Tu perfil",
@ -779,7 +780,8 @@
"publicNote": "Lo que publiques aquí es público, y pueden quedar copias aunque lo retires después.",
"viewLegal": "Privacidad y normas",
"accept": "Acepto",
"decline": "Ahora no"
"decline": "Ahora no",
"networkNote": "Para llevar las ofertas y los mensajes de unas personas a otras, Tane necesita conectarse y dejarlos en servidores comunitarios. Hasta que aceptes, no se conecta a nada."
},
"report": {
"offer": "Denunciar esta oferta",
@ -805,5 +807,14 @@
"manageTitle": "Personas bloqueadas",
"manageEmpty": "No has bloqueado a nadie",
"unblock": "Desbloquear"
},
"sharingInvite": {
"title": "Esto se enciende cuando empiezas a compartir",
"perkChat": "Escribirte con quien tiene semillas cerca",
"perkFavorites": "Guardar las ofertas que te gustan",
"perkPeople": "Tu círculo de gente de confianza",
"networkNote": "Para eso Tane necesita conectarse. Hasta que digas que sí, no habla con nadie.",
"start": "Empezar a compartir",
"notNow": "Ahora no"
}
}

View file

@ -59,7 +59,6 @@
"delete": "Supprimer",
"edit": "Modifier",
"type": "Type",
"comingSoon": "À venir",
"offline": "Vous êtes hors ligne — le partage est en pause"
},
"home": {

View file

@ -8,7 +8,6 @@
"delete": "削除",
"edit": "編集",
"type": "種類",
"comingSoon": "近日公開",
"offline": "オフラインです — 共有を一時停止しています"
},
"menu": {

View file

@ -72,7 +72,6 @@
"delete": "Eliminar",
"edit": "Editar",
"type": "Tipo",
"comingSoon": "Em breve",
"offline": "Sem ligação — a partilha está em pausa"
},
"home": {

View file

@ -72,7 +72,6 @@
"delete": "Eliminar",
"edit": "Editar",
"type": "Tipo",
"comingSoon": "Em breve",
"offline": "Sem ligação — a compartilha está em pausa"
},
"home": {

View file

@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 8
/// Strings: 4287 (535 per locale)
/// Strings: 4299 (537 per locale)
///
/// Built on 2026-07-22 at 11:02 UTC
/// Built on 2026-07-25 at 14:38 UTC
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import

View file

@ -199,7 +199,6 @@ class _Translations$common$ast extends Translations$common$en {
@override String get delete => 'Desaniciar';
@override String get edit => 'Editar';
@override String get type => 'Triba';
@override String get comingSoon => 'Aína';
}
// Path: home
@ -1465,7 +1464,6 @@ extension on TranslationsAst {
'common.delete' => 'Desaniciar',
'common.edit' => 'Editar',
'common.type' => 'Triba',
'common.comingSoon' => 'Aína',
'home.tagline' => 'Comparte y cultiva simiente llocal',
'home.openMarket' => 'Mercáu',
'home.openMarketSubtitle' => 'Descubri y comparte simiente cerca',
@ -1930,9 +1928,9 @@ extension on TranslationsAst {
'handover.promiseGave' => 'Van devolveme semiente',
'handover.promiseReceived' => 'Voi devolver semiente',
'sale.title' => 'Ventes',
'sale.help' => 'Rexistra semilla vendida o mercada — dineru, Ğ1 o cualquier moneda. Un modelu aparte del regalu y del Plantare. Enxamás se cobra comisión poles semilles.',
_ => null,
} ?? switch (path) {
'sale.help' => 'Rexistra semilla vendida o mercada — dineru, Ğ1 o cualquier moneda. Un modelu aparte del regalu y del Plantare. Enxamás se cobra comisión poles semilles.',
'sale.add' => 'Rexistrar venta',
'sale.empty' => 'Entá nun hai ventes. Anota equí lo que vendes o merques.',
'sale.iSold' => 'Vendí',

View file

@ -199,7 +199,6 @@ class _Translations$common$de extends Translations$common$en {
@override String get delete => 'Löschen';
@override String get edit => 'Bearbeiten';
@override String get type => 'Typ';
@override String get comingSoon => 'Bald';
@override String get offline => 'Offline - Teilen ist unterbrochen';
}
@ -1461,7 +1460,6 @@ extension on TranslationsDe {
'common.delete' => 'Löschen',
'common.edit' => 'Bearbeiten',
'common.type' => 'Typ',
'common.comingSoon' => 'Bald',
'common.offline' => 'Offline - Teilen ist unterbrochen',
'home.tagline' => 'Teile und baue lokale Samen an',
'home.openMarket' => 'Markt',
@ -1926,9 +1924,9 @@ extension on TranslationsDe {
'sale.add' => 'Verkauf notieren',
'sale.empty' => 'Noch keine Verkäufe. Notiere hier, was du verkaufst oder kaufst.',
'sale.iSold' => 'Ich verkaufte',
'sale.iBought' => 'Ich kaufte',
_ => null,
} ?? switch (path) {
'sale.iBought' => 'Ich kaufte',
'sale.direction' => 'Verkauft oder gekauft?',
'sale.counterparty' => 'Mit wem?',
'sale.counterpartyHint' => 'Eine Person oder ein Kollektiv (optional)',

View file

@ -93,6 +93,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
late final Translations$marketGate$en marketGate = Translations$marketGate$en.internal(_root);
late final Translations$report$en report = Translations$report$en.internal(_root);
late final Translations$block$en block = Translations$block$en.internal(_root);
late final Translations$sharingInvite$en sharingInvite = Translations$sharingInvite$en.internal(_root);
}
// Path: avatar
@ -340,9 +341,6 @@ class Translations$common$en {
/// en: 'Type'
String get type => 'Type';
/// en: 'Coming soon'
String get comingSoon => 'Coming soon';
/// en: 'You're offline sharing is paused'
String get offline => 'You\'re offline — sharing is paused';
}
@ -1578,6 +1576,12 @@ class Translations$market$en {
/// en: 'Photo'
String get photo => 'Photo';
/// en: 'Sharing is on'
String get sharingOnLabel => 'Sharing is on';
/// en: 'Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same.'
String get sharingOnHelp => 'Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same.';
}
// Path: profile
@ -2241,6 +2245,9 @@ class Translations$marketGate$en {
/// en: 'Not now'
String get decline => 'Not now';
/// en: 'To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn't connect to anything.'
String get networkNote => 'To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn\'t connect to anything.';
}
// Path: report
@ -2324,6 +2331,36 @@ class Translations$block$en {
String get unblock => 'Unblock';
}
// Path: sharingInvite
class Translations$sharingInvite$en {
Translations$sharingInvite$en.internal(this._root);
final Translations _root; // ignore: unused_field
// Translations
/// en: 'This wakes up when you start sharing'
String get title => 'This wakes up when you start sharing';
/// en: 'Write to whoever has seeds near you'
String get perkChat => 'Write to whoever has seeds near you';
/// en: 'Keep the offers you like'
String get perkFavorites => 'Keep the offers you like';
/// en: 'Your circle of people you trust'
String get perkPeople => 'Your circle of people you trust';
/// en: 'For that, Tane needs to go online. Until you say yes, it doesn't talk to anyone.'
String get networkNote => 'For that, Tane needs to go online. Until you say yes, it doesn\'t talk to anyone.';
/// en: 'Start sharing'
String get start => 'Start sharing';
/// en: 'Not now'
String get notNow => 'Not now';
}
// Path: intro.slides
class Translations$intro$slides$en {
Translations$intro$slides$en.internal(this._root);
@ -2839,7 +2876,6 @@ extension on Translations {
'common.delete' => 'Delete',
'common.edit' => 'Edit',
'common.type' => 'Type',
'common.comingSoon' => 'Coming soon',
'common.offline' => 'You\'re offline — sharing is paused',
'home.tagline' => 'Share and grow local seeds',
'home.openMarket' => 'Market',
@ -3218,6 +3254,8 @@ extension on Translations {
'market.copyId' => 'Copy code',
'market.idCopied' => 'Code copied',
'market.photo' => 'Photo',
'market.sharingOnLabel' => 'Sharing is on',
'market.sharingOnHelp' => 'Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same.',
'profile.title' => 'Your profile',
'profile.name' => 'Display name',
'profile.nameHint' => 'How others see you',
@ -3292,9 +3330,9 @@ extension on Translations {
'plantare.delete' => 'Remove',
'plantare.statusReturned' => 'Returned',
'plantare.statusForgiven' => 'Settled',
'plantare.openSection' => 'Open',
_ => null,
} ?? switch (path) {
'plantare.openSection' => 'Open',
'plantare.settledSection' => 'Done',
'plantare.removeConfirm' => 'Remove this commitment?',
'plantare.returnBy' => ({required Object date}) => 'Return by ${date}',
@ -3402,6 +3440,7 @@ extension on Translations {
'marketGate.viewLegal' => 'Privacy & rules',
'marketGate.accept' => 'I agree',
'marketGate.decline' => 'Not now',
'marketGate.networkNote' => 'To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn\'t connect to anything.',
'report.offer' => 'Report this offer',
'report.person' => 'Report this person',
'report.title' => 'Report',
@ -3423,6 +3462,13 @@ extension on Translations {
'block.manageTitle' => 'Blocked people',
'block.manageEmpty' => 'You haven\'t blocked anyone',
'block.unblock' => 'Unblock',
'sharingInvite.title' => 'This wakes up when you start sharing',
'sharingInvite.perkChat' => 'Write to whoever has seeds near you',
'sharingInvite.perkFavorites' => 'Keep the offers you like',
'sharingInvite.perkPeople' => 'Your circle of people you trust',
'sharingInvite.networkNote' => 'For that, Tane needs to go online. Until you say yes, it doesn\'t talk to anyone.',
'sharingInvite.start' => 'Start sharing',
'sharingInvite.notNow' => 'Not now',
_ => null,
};
}

View file

@ -92,6 +92,7 @@ class TranslationsEs extends Translations with BaseTranslations<AppLocale, Trans
@override late final _Translations$marketGate$es marketGate = _Translations$marketGate$es._(_root);
@override late final _Translations$report$es report = _Translations$report$es._(_root);
@override late final _Translations$block$es block = _Translations$block$es._(_root);
@override late final _Translations$sharingInvite$es sharingInvite = _Translations$sharingInvite$es._(_root);
}
// Path: avatar
@ -222,7 +223,6 @@ class _Translations$common$es extends Translations$common$en {
@override String get delete => 'Eliminar';
@override String get edit => 'Editar';
@override String get type => 'Tipo';
@override String get comingSoon => 'Pronto';
@override String get offline => 'Sin conexión — el compartir está en pausa';
}
@ -839,6 +839,8 @@ class _Translations$market$es extends Translations$market$en {
@override String get copyId => 'Copiar código';
@override String get idCopied => 'Código copiado';
@override String get photo => 'Foto';
@override String get sharingOnLabel => 'Compartir está activado';
@override String get sharingOnHelp => 'Si lo desactivas, Tane deja de conectarse a ningún servidor. Tu cuaderno de semillas sigue funcionando igual.';
}
// Path: profile
@ -1138,6 +1140,7 @@ class _Translations$marketGate$es extends Translations$marketGate$en {
@override String get viewLegal => 'Privacidad y normas';
@override String get accept => 'Acepto';
@override String get decline => 'Ahora no';
@override String get networkNote => 'Para llevar las ofertas y los mensajes de unas personas a otras, Tane necesita conectarse y dejarlos en servidores comunitarios. Hasta que aceptes, no se conecta a nada.';
}
// Path: report
@ -1179,6 +1182,22 @@ class _Translations$block$es extends Translations$block$en {
@override String get unblock => 'Desbloquear';
}
// Path: sharingInvite
class _Translations$sharingInvite$es extends Translations$sharingInvite$en {
_Translations$sharingInvite$es._(TranslationsEs root) : this._root = root, super.internal(root);
final TranslationsEs _root; // ignore: unused_field
// Translations
@override String get title => 'Esto se enciende cuando empiezas a compartir';
@override String get perkChat => 'Escribirte con quien tiene semillas cerca';
@override String get perkFavorites => 'Guardar las ofertas que te gustan';
@override String get perkPeople => 'Tu círculo de gente de confianza';
@override String get networkNote => 'Para eso Tane necesita conectarse. Hasta que digas que sí, no habla con nadie.';
@override String get start => 'Empezar a compartir';
@override String get notNow => 'Ahora no';
}
// Path: intro.slides
class _Translations$intro$slides$es extends Translations$intro$slides$en {
_Translations$intro$slides$es._(TranslationsEs root) : this._root = root, super.internal(root);
@ -1578,7 +1597,6 @@ extension on TranslationsEs {
'common.delete' => 'Eliminar',
'common.edit' => 'Editar',
'common.type' => 'Tipo',
'common.comingSoon' => 'Pronto',
'common.offline' => 'Sin conexión — el compartir está en pausa',
'home.tagline' => 'Comparte y cultiva semillas locales',
'home.openMarket' => 'Mercado',
@ -1956,6 +1974,8 @@ extension on TranslationsEs {
'market.copyId' => 'Copiar código',
'market.idCopied' => 'Código copiado',
'market.photo' => 'Foto',
'market.sharingOnLabel' => 'Compartir está activado',
'market.sharingOnHelp' => 'Si lo desactivas, Tane deja de conectarse a ningún servidor. Tu cuaderno de semillas sigue funcionando igual.',
'profile.title' => 'Tu perfil',
'profile.name' => 'Nombre',
'profile.nameHint' => 'Cómo te ven los demás',
@ -2031,9 +2051,9 @@ extension on TranslationsEs {
'plantare.statusReturned' => 'Devuelto',
'plantare.statusForgiven' => 'Saldado',
'plantare.openSection' => 'Pendientes',
'plantare.settledSection' => 'Hechos',
_ => null,
} ?? switch (path) {
'plantare.settledSection' => 'Hechos',
'plantare.removeConfirm' => '¿Quitar este compromiso?',
'plantare.returnBy' => ({required Object date}) => 'Devolver antes del ${date}',
'plantare.overdue' => 'vencido',
@ -2140,6 +2160,7 @@ extension on TranslationsEs {
'marketGate.viewLegal' => 'Privacidad y normas',
'marketGate.accept' => 'Acepto',
'marketGate.decline' => 'Ahora no',
'marketGate.networkNote' => 'Para llevar las ofertas y los mensajes de unas personas a otras, Tane necesita conectarse y dejarlos en servidores comunitarios. Hasta que aceptes, no se conecta a nada.',
'report.offer' => 'Denunciar esta oferta',
'report.person' => 'Denunciar a esta persona',
'report.title' => 'Denunciar',
@ -2161,6 +2182,13 @@ extension on TranslationsEs {
'block.manageTitle' => 'Personas bloqueadas',
'block.manageEmpty' => 'No has bloqueado a nadie',
'block.unblock' => 'Desbloquear',
'sharingInvite.title' => 'Esto se enciende cuando empiezas a compartir',
'sharingInvite.perkChat' => 'Escribirte con quien tiene semillas cerca',
'sharingInvite.perkFavorites' => 'Guardar las ofertas que te gustan',
'sharingInvite.perkPeople' => 'Tu círculo de gente de confianza',
'sharingInvite.networkNote' => 'Para eso Tane necesita conectarse. Hasta que digas que sí, no habla con nadie.',
'sharingInvite.start' => 'Empezar a compartir',
'sharingInvite.notNow' => 'Ahora no',
_ => null,
};
}

View file

@ -199,7 +199,6 @@ class _Translations$common$fr extends Translations$common$en {
@override String get delete => 'Supprimer';
@override String get edit => 'Modifier';
@override String get type => 'Type';
@override String get comingSoon => 'À venir';
@override String get offline => 'Vous êtes hors ligne — le partage est en pause';
}
@ -1461,7 +1460,6 @@ extension on TranslationsFr {
'common.delete' => 'Supprimer',
'common.edit' => 'Modifier',
'common.type' => 'Type',
'common.comingSoon' => 'À venir',
'common.offline' => 'Vous êtes hors ligne — le partage est en pause',
'home.tagline' => 'Partagez et cultivez des graines locales',
'home.openMarket' => 'Marché',
@ -1926,9 +1924,9 @@ extension on TranslationsFr {
'sale.add' => 'Enregistrer une vente',
'sale.empty' => 'Pas encore de ventes. Notez ici ce que vous vendez ou achetez.',
'sale.iSold' => 'J\'ai vendu',
'sale.iBought' => 'J\'ai acheté',
_ => null,
} ?? switch (path) {
'sale.iBought' => 'J\'ai acheté',
'sale.direction' => 'Vendu ou acheté ?',
'sale.counterparty' => 'Avec qui ?',
'sale.counterpartyHint' => 'Une personne ou un collectif (optionnel)',

View file

@ -68,7 +68,6 @@ class _Translations$common$ja extends Translations$common$en {
@override String get delete => '削除';
@override String get edit => '編集';
@override String get type => '種類';
@override String get comingSoon => '近日公開';
@override String get offline => 'オフラインです — 共有を一時停止しています';
}
@ -140,7 +139,6 @@ extension on TranslationsJa {
'common.delete' => '削除',
'common.edit' => '編集',
'common.type' => '種類',
'common.comingSoon' => '近日公開',
'common.offline' => 'オフラインです — 共有を一時停止しています',
'menu.tagline' => 'あなたの種子バンク',
'menu.inventory' => '在庫',

View file

@ -222,7 +222,6 @@ class Translations$common$pt extends Translations$common$en {
@override String get delete => 'Eliminar';
@override String get edit => 'Editar';
@override String get type => 'Tipo';
@override String get comingSoon => 'Em breve';
@override String get offline => 'Sem ligação — a partilha está em pausa';
}
@ -1579,7 +1578,6 @@ extension on TranslationsPt {
'common.delete' => 'Eliminar',
'common.edit' => 'Editar',
'common.type' => 'Tipo',
'common.comingSoon' => 'Em breve',
'common.offline' => 'Sem ligação — a partilha está em pausa',
'home.tagline' => 'Partilha e cultiva sementes locais',
'home.openMarket' => 'Mercado',
@ -2033,9 +2031,9 @@ extension on TranslationsPt {
'plantare.statusReturned' => 'Devolvido',
'plantare.statusForgiven' => 'Saldado',
'plantare.openSection' => 'Pendentes',
'plantare.settledSection' => 'Feitos',
_ => null,
} ?? switch (path) {
'plantare.settledSection' => 'Feitos',
'plantare.removeConfirm' => 'Remover este compromisso?',
'plantare.returnBy' => ({required Object date}) => 'Devolver até ${date}',
'plantare.overdue' => 'vencido',

View file

@ -223,7 +223,6 @@ class _Translations$common$pt_BR extends Translations$common$pt {
@override String get delete => 'Eliminar';
@override String get edit => 'Editar';
@override String get type => 'Tipo';
@override String get comingSoon => 'Em breve';
@override String get offline => 'Sem ligação — a compartilha está em pausa';
}
@ -1580,7 +1579,6 @@ extension on TranslationsPtBr {
'common.delete' => 'Eliminar',
'common.edit' => 'Editar',
'common.type' => 'Tipo',
'common.comingSoon' => 'Em breve',
'common.offline' => 'Sem ligação — a compartilha está em pausa',
'home.tagline' => 'Compartilha e cultiva sementes locais',
'home.openMarket' => 'Mercado',
@ -2034,9 +2032,9 @@ extension on TranslationsPtBr {
'plantare.statusReturned' => 'Devolvido',
'plantare.statusForgiven' => 'Saldado',
'plantare.openSection' => 'Pendentes',
'plantare.settledSection' => 'Feitos',
_ => null,
} ?? switch (path) {
'plantare.settledSection' => 'Feitos',
'plantare.removeConfirm' => 'Remover este compromisso?',
'plantare.returnBy' => ({required Object date}) => 'Devolver até ${date}',
'plantare.overdue' => 'vencido',