feat(app,learn): invite to a shared studyset by email or link, and join

The apps' half of ADR 0044's step 5 (D37 to D40), on the instance's
half of the commit before.

halkyon_app's SharedSpaceGateway asks for inviting by mail, the
preview of a link, the code proving an address, accepting a mailed
invitation, a space's link (read, switched, joined) and marking a
share seen; SpaceInfo says whether a share is new and who made it,
a member whether they were invited by mail. joinTokenOf reads a link
or its token as pasted. The fake keeps the mails and codes it would
send, for the apps' tests.

In Learn:
- the Owner's Share sheet invites by handle or by email, lists an
  invitation mailed by its role alone, and switches the space's link,
  copying it while on;
- the Library's menu has Join with a link, and a link opened on
  Android (/join/<token> on learn.halkyon.eu, verified through the
  instance's assetlinks) opens the same on a screen of its own: who
  invites and as whom, then Join, or for a mailed invitation the
  address and the code mailed there;
- a studyset someone shared is new until opened: in the Inbox
  ("@alice shared Japanese with you", Open or Leave), on the Profile
  tab's badge and as New on its library card (NewSharesCubit, read
  again after every merge).

Whats-New: Invite people to a shared studyset by email or with a link, join one from the Library's Join with a link, and see in the Inbox what was shared with you.
Whats-New-De: Lade Leute per E-Mail oder Link zu einem geteilten Lernset ein, tritt einem über „Mit einem Link beitreten“ in der Bibliothek bei und sieh im Posteingang, was mit dir geteilt wurde.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-11-11 19:09:12 +01:00
commit fb6b78fa19
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64
5 changed files with 2443 additions and 54 deletions

View file

@ -2270,5 +2270,43 @@
"safetyCodeMarkCompared": "Als verglichen markieren",
"safetyCodeTrustNew": "Den neuen Schlüsseln vertrauen",
"studysetViewOnly": "Du kannst es ansehen und lernen, aber nicht ändern.",
"studysetViewOnlyRefused": "Dieses Lernset kannst du nur ansehen."
"studysetViewOnlyRefused": "Dieses Lernset kannst du nur ansehen.",
"shareInviteByHandle": "Handle",
"shareInviteByEmail": "E-Mail",
"shareInviteAddress": "E-Mail-Adresse",
"shareInviteEmailHint": "Sie bekommen einen Link per Mail. Beitreten kann nur, wer dieses Postfach liest, und die Instanz behält die Adresse nur als Fingerabdruck.",
"shareInviteMailed": "Einladung an {address} geschickt",
"shareInvitedByEmail": "Per E-Mail eingeladen",
"shareLinkTitle": "Beitritt per Link",
"shareLinkHint": "Wer den Link hat, kann als Betrachter:in beitreten. Ausgeschaltet gilt der Link nie wieder.",
"shareLinkCopy": "Link kopieren",
"shareLinkCopied": "Link kopiert",
"shareRefusedNotAnAddress": "Das ist keine E-Mail-Adresse.",
"shareRefusedTooManyMails": "Gerade zu viele Mails an diese Adresse. Versuch es in einer Stunde noch einmal.",
"shareRefusedMailFailed": "Die Mail ließ sich nicht verschicken. Versuch es später noch einmal.",
"shareRefusedHandleNeeded": "Eine Einladung per Mail nennt dich mit deinem Handle: Wähl zuerst eines in deinem Profil.",
"libraryJoin": "Mit einem Link beitreten",
"joinLinkLabel": "Link oder Code",
"joinContinue": "Weiter",
"joinInvites": "{inviter} möchte ein Lernset mit dir teilen",
"joinSomeone": "Jemand",
"joinAsViewer": "Du kannst es ansehen und damit lernen.",
"joinAsEditor": "Du kannst es ansehen, damit lernen und es ändern.",
"joinEmailHint": "Diese Einladung ging an eine E-Mail-Adresse. Gib sie ein, und du bekommst dorthin einen Code, der zeigt, dass sie dir gehört.",
"joinSendCode": "Code senden",
"joinCodeSent": "Ein Code ist unterwegs an {address}.",
"joinCodeLabel": "Code aus der Mail",
"joinAction": "Beitreten",
"joinDone": "Du bist beigetreten. Das Lernset kommt mit der nächsten Synchronisierung in deine Bibliothek.",
"joinAlreadyMember": "Du bist schon Mitglied.",
"joinNotFound": "Dieser Link gilt nicht mehr: Er wurde abgeschaltet, ist abgelaufen oder wurde schon benutzt.",
"joinWrongCode": "Dieser Code stimmt nicht.",
"joinCodeExpired": "Dieser Code gilt nicht mehr. Lass dir einen neuen schicken.",
"joinOtherAddress": "Diese Einladung ging an eine andere Adresse.",
"inboxShared": "Mit dir geteilt",
"inboxSharedBy": "@{handle} hat {title} mit dir geteilt",
"inboxSharedNoHandle": "{title} wurde mit dir geteilt",
"inboxSharedArriving": "Ein Lernset, das noch unterwegs ist",
"inboxSharedOpen": "Öffnen",
"studysetNew": "Neu"
}

View file

@ -2870,5 +2870,81 @@
"studysetViewOnly": "You can view and study this, not change it.",
"@studysetViewOnly": {"description": "Line on a shared studyset where the person is a Viewer"},
"studysetViewOnlyRefused": "You can only view this studyset.",
"@studysetViewOnlyRefused": {"description": "A write in a studyset shared with the person as a Viewer was refused"}
"@studysetViewOnlyRefused": {"description": "A write in a studyset shared with the person as a Viewer was refused"},
"shareInviteByHandle": "Handle",
"@shareInviteByHandle": {"description": "Inviting someone by their @handle, a choice in the invite dialog"},
"shareInviteByEmail": "Email",
"@shareInviteByEmail": {"description": "Inviting someone by email address, a choice in the invite dialog"},
"shareInviteAddress": "Email address",
"@shareInviteAddress": {"description": "Label of the invite dialog's address field"},
"shareInviteEmailHint": "They get a link by mail. Only whoever reads that mailbox can join, and the instance keeps the address only as a fingerprint.",
"@shareInviteEmailHint": {"description": "Below the address field of the invite dialog"},
"shareInviteMailed": "Invitation mailed to {address}",
"@shareInviteMailed": {"description": "Snack bar once an invitation by email went out", "placeholders": {"address": {"type": "String"}}},
"shareInvitedByEmail": "Invited by email",
"@shareInvitedByEmail": {"description": "A member row's name for an invitation mailed to an address, which members never see"},
"shareLinkTitle": "Join by link",
"@shareLinkTitle": {"description": "Switch on the Share sheet letting people join by the studyset's link"},
"shareLinkHint": "Anyone with the link can join as a Viewer. Switching it off ends the link for good.",
"@shareLinkHint": {"description": "Below the switch for joining by link"},
"shareLinkCopy": "Copy link",
"@shareLinkCopy": {"description": "Button copying the studyset's join link"},
"shareLinkCopied": "Link copied",
"@shareLinkCopied": {"description": "Snack bar once the join link is copied"},
"shareRefusedNotAnAddress": "That isn't an email address.",
"@shareRefusedNotAnAddress": {"description": "An invitation or code refused for an address that isn't one"},
"shareRefusedTooManyMails": "Too many mails to that address for now. Try again in an hour.",
"@shareRefusedTooManyMails": {"description": "An invitation or code refused as too many went out this hour"},
"shareRefusedMailFailed": "The mail couldn't be sent. Try again later.",
"@shareRefusedMailFailed": {"description": "An invitation or code whose mail failed"},
"shareRefusedHandleNeeded": "An invitation by mail names you by your handle: choose one in your profile first.",
"@shareRefusedHandleNeeded": {"description": "An invitation by email refused as the person has no handle"},
"libraryJoin": "Join with a link",
"@libraryJoin": {"description": "The Library's menu entry joining a studyset shared by link or invitation"},
"joinLinkLabel": "Link or code",
"@joinLinkLabel": {"description": "Field of the Join sheet taking a pasted link"},
"joinContinue": "Continue",
"@joinContinue": {"description": "Button looking up a pasted join link"},
"joinInvites": "{inviter} wants to share a studyset with you",
"@joinInvites": {"description": "What a join link offers", "placeholders": {"inviter": {"type": "String"}}},
"joinSomeone": "Someone",
"@joinSomeone": {"description": "Who invites, where they have no public profile"},
"joinAsViewer": "You can view and study it.",
"@joinAsViewer": {"description": "What joining as a Viewer gives"},
"joinAsEditor": "You can view, study and change it.",
"@joinAsEditor": {"description": "What joining as an Editor gives"},
"joinEmailHint": "This invitation went to an email address. Type it, and you'll get a code there that shows it's yours.",
"@joinEmailHint": {"description": "Above the address field of an invitation by email"},
"joinSendCode": "Send code",
"@joinSendCode": {"description": "Button mailing a code to accept an invitation"},
"joinCodeSent": "A code is on its way to {address}.",
"@joinCodeSent": {"description": "Once a code to join was mailed", "placeholders": {"address": {"type": "String"}}},
"joinCodeLabel": "Code from the mail",
"@joinCodeLabel": {"description": "Field taking the mailed code"},
"joinAction": "Join",
"@joinAction": {"description": "Button joining the shared studyset"},
"joinDone": "You joined. The studyset arrives in your Library with the next sync.",
"@joinDone": {"description": "Once joined"},
"joinAlreadyMember": "You're a member already.",
"@joinAlreadyMember": {"description": "A join link to a studyset the person is in already"},
"joinNotFound": "This link holds no more: it was switched off, has lapsed or was used already.",
"@joinNotFound": {"description": "A join link that holds no more"},
"joinWrongCode": "That code isn't right.",
"@joinWrongCode": {"description": "A mailed code typed wrong"},
"joinCodeExpired": "This code is no longer valid. Send a new one.",
"@joinCodeExpired": {"description": "A mailed code used, tried too often or too old"},
"joinOtherAddress": "This invitation went to another address.",
"@joinOtherAddress": {"description": "A code proving another address than the one invited"},
"inboxShared": "Shared with you",
"@inboxShared": {"description": "Heading of the Inbox's studysets shared with the person"},
"inboxSharedBy": "@{handle} shared {title} with you",
"@inboxSharedBy": {"description": "An Inbox entry of a studyset shared with the person", "placeholders": {"handle": {"type": "String"}, "title": {"type": "String"}}},
"inboxSharedNoHandle": "{title} was shared with you",
"@inboxSharedNoHandle": {"description": "An Inbox entry of a studyset shared by someone without a public profile", "placeholders": {"title": {"type": "String"}}},
"inboxSharedArriving": "A studyset on its way",
"@inboxSharedArriving": {"description": "The title of a studyset shared with the person that hasn't synced yet"},
"inboxSharedOpen": "Open",
"@inboxSharedOpen": {"description": "Button opening a studyset shared with the person"},
"studysetNew": "New",
"@studysetNew": {"description": "Mark on a library card of a studyset someone shared with the person, until opened"}
}

View file

@ -13405,6 +13405,234 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'You can only view this studyset.'**
String get studysetViewOnlyRefused;
/// Inviting someone by their @handle, a choice in the invite dialog
///
/// In en, this message translates to:
/// **'Handle'**
String get shareInviteByHandle;
/// Inviting someone by email address, a choice in the invite dialog
///
/// In en, this message translates to:
/// **'Email'**
String get shareInviteByEmail;
/// Label of the invite dialog's address field
///
/// In en, this message translates to:
/// **'Email address'**
String get shareInviteAddress;
/// Below the address field of the invite dialog
///
/// In en, this message translates to:
/// **'They get a link by mail. Only whoever reads that mailbox can join, and the instance keeps the address only as a fingerprint.'**
String get shareInviteEmailHint;
/// Snack bar once an invitation by email went out
///
/// In en, this message translates to:
/// **'Invitation mailed to {address}'**
String shareInviteMailed(String address);
/// A member row's name for an invitation mailed to an address, which members never see
///
/// In en, this message translates to:
/// **'Invited by email'**
String get shareInvitedByEmail;
/// Switch on the Share sheet letting people join by the studyset's link
///
/// In en, this message translates to:
/// **'Join by link'**
String get shareLinkTitle;
/// Below the switch for joining by link
///
/// In en, this message translates to:
/// **'Anyone with the link can join as a Viewer. Switching it off ends the link for good.'**
String get shareLinkHint;
/// Button copying the studyset's join link
///
/// In en, this message translates to:
/// **'Copy link'**
String get shareLinkCopy;
/// Snack bar once the join link is copied
///
/// In en, this message translates to:
/// **'Link copied'**
String get shareLinkCopied;
/// An invitation or code refused for an address that isn't one
///
/// In en, this message translates to:
/// **'That isn\'t an email address.'**
String get shareRefusedNotAnAddress;
/// An invitation or code refused as too many went out this hour
///
/// In en, this message translates to:
/// **'Too many mails to that address for now. Try again in an hour.'**
String get shareRefusedTooManyMails;
/// An invitation or code whose mail failed
///
/// In en, this message translates to:
/// **'The mail couldn\'t be sent. Try again later.'**
String get shareRefusedMailFailed;
/// An invitation by email refused as the person has no handle
///
/// In en, this message translates to:
/// **'An invitation by mail names you by your handle: choose one in your profile first.'**
String get shareRefusedHandleNeeded;
/// The Library's menu entry joining a studyset shared by link or invitation
///
/// In en, this message translates to:
/// **'Join with a link'**
String get libraryJoin;
/// Field of the Join sheet taking a pasted link
///
/// In en, this message translates to:
/// **'Link or code'**
String get joinLinkLabel;
/// Button looking up a pasted join link
///
/// In en, this message translates to:
/// **'Continue'**
String get joinContinue;
/// What a join link offers
///
/// In en, this message translates to:
/// **'{inviter} wants to share a studyset with you'**
String joinInvites(String inviter);
/// Who invites, where they have no public profile
///
/// In en, this message translates to:
/// **'Someone'**
String get joinSomeone;
/// What joining as a Viewer gives
///
/// In en, this message translates to:
/// **'You can view and study it.'**
String get joinAsViewer;
/// What joining as an Editor gives
///
/// In en, this message translates to:
/// **'You can view, study and change it.'**
String get joinAsEditor;
/// Above the address field of an invitation by email
///
/// In en, this message translates to:
/// **'This invitation went to an email address. Type it, and you\'ll get a code there that shows it\'s yours.'**
String get joinEmailHint;
/// Button mailing a code to accept an invitation
///
/// In en, this message translates to:
/// **'Send code'**
String get joinSendCode;
/// Once a code to join was mailed
///
/// In en, this message translates to:
/// **'A code is on its way to {address}.'**
String joinCodeSent(String address);
/// Field taking the mailed code
///
/// In en, this message translates to:
/// **'Code from the mail'**
String get joinCodeLabel;
/// Button joining the shared studyset
///
/// In en, this message translates to:
/// **'Join'**
String get joinAction;
/// Once joined
///
/// In en, this message translates to:
/// **'You joined. The studyset arrives in your Library with the next sync.'**
String get joinDone;
/// A join link to a studyset the person is in already
///
/// In en, this message translates to:
/// **'You\'re a member already.'**
String get joinAlreadyMember;
/// A join link that holds no more
///
/// In en, this message translates to:
/// **'This link holds no more: it was switched off, has lapsed or was used already.'**
String get joinNotFound;
/// A mailed code typed wrong
///
/// In en, this message translates to:
/// **'That code isn\'t right.'**
String get joinWrongCode;
/// A mailed code used, tried too often or too old
///
/// In en, this message translates to:
/// **'This code is no longer valid. Send a new one.'**
String get joinCodeExpired;
/// A code proving another address than the one invited
///
/// In en, this message translates to:
/// **'This invitation went to another address.'**
String get joinOtherAddress;
/// Heading of the Inbox's studysets shared with the person
///
/// In en, this message translates to:
/// **'Shared with you'**
String get inboxShared;
/// An Inbox entry of a studyset shared with the person
///
/// In en, this message translates to:
/// **'@{handle} shared {title} with you'**
String inboxSharedBy(String handle, String title);
/// An Inbox entry of a studyset shared by someone without a public profile
///
/// In en, this message translates to:
/// **'{title} was shared with you'**
String inboxSharedNoHandle(String title);
/// The title of a studyset shared with the person that hasn't synced yet
///
/// In en, this message translates to:
/// **'A studyset on its way'**
String get inboxSharedArriving;
/// Button opening a studyset shared with the person
///
/// In en, this message translates to:
/// **'Open'**
String get inboxSharedOpen;
/// Mark on a library card of a studyset someone shared with the person, until opened
///
/// In en, this message translates to:
/// **'New'**
String get studysetNew;
}
class _AppLocalizationsDelegate

View file

@ -8580,4 +8580,138 @@ class AppLocalizationsDe extends AppLocalizations {
@override
String get studysetViewOnlyRefused => 'Dieses Lernset kannst du nur ansehen.';
@override
String get shareInviteByHandle => 'Handle';
@override
String get shareInviteByEmail => 'E-Mail';
@override
String get shareInviteAddress => 'E-Mail-Adresse';
@override
String get shareInviteEmailHint =>
'Sie bekommen einen Link per Mail. Beitreten kann nur, wer dieses Postfach liest, und die Instanz behält die Adresse nur als Fingerabdruck.';
@override
String shareInviteMailed(String address) {
return 'Einladung an $address geschickt';
}
@override
String get shareInvitedByEmail => 'Per E-Mail eingeladen';
@override
String get shareLinkTitle => 'Beitritt per Link';
@override
String get shareLinkHint =>
'Wer den Link hat, kann als Betrachter:in beitreten. Ausgeschaltet gilt der Link nie wieder.';
@override
String get shareLinkCopy => 'Link kopieren';
@override
String get shareLinkCopied => 'Link kopiert';
@override
String get shareRefusedNotAnAddress => 'Das ist keine E-Mail-Adresse.';
@override
String get shareRefusedTooManyMails =>
'Gerade zu viele Mails an diese Adresse. Versuch es in einer Stunde noch einmal.';
@override
String get shareRefusedMailFailed =>
'Die Mail ließ sich nicht verschicken. Versuch es später noch einmal.';
@override
String get shareRefusedHandleNeeded =>
'Eine Einladung per Mail nennt dich mit deinem Handle: Wähl zuerst eines in deinem Profil.';
@override
String get libraryJoin => 'Mit einem Link beitreten';
@override
String get joinLinkLabel => 'Link oder Code';
@override
String get joinContinue => 'Weiter';
@override
String joinInvites(String inviter) {
return '$inviter möchte ein Lernset mit dir teilen';
}
@override
String get joinSomeone => 'Jemand';
@override
String get joinAsViewer => 'Du kannst es ansehen und damit lernen.';
@override
String get joinAsEditor =>
'Du kannst es ansehen, damit lernen und es ändern.';
@override
String get joinEmailHint =>
'Diese Einladung ging an eine E-Mail-Adresse. Gib sie ein, und du bekommst dorthin einen Code, der zeigt, dass sie dir gehört.';
@override
String get joinSendCode => 'Code senden';
@override
String joinCodeSent(String address) {
return 'Ein Code ist unterwegs an $address.';
}
@override
String get joinCodeLabel => 'Code aus der Mail';
@override
String get joinAction => 'Beitreten';
@override
String get joinDone =>
'Du bist beigetreten. Das Lernset kommt mit der nächsten Synchronisierung in deine Bibliothek.';
@override
String get joinAlreadyMember => 'Du bist schon Mitglied.';
@override
String get joinNotFound =>
'Dieser Link gilt nicht mehr: Er wurde abgeschaltet, ist abgelaufen oder wurde schon benutzt.';
@override
String get joinWrongCode => 'Dieser Code stimmt nicht.';
@override
String get joinCodeExpired =>
'Dieser Code gilt nicht mehr. Lass dir einen neuen schicken.';
@override
String get joinOtherAddress => 'Diese Einladung ging an eine andere Adresse.';
@override
String get inboxShared => 'Mit dir geteilt';
@override
String inboxSharedBy(String handle, String title) {
return '@$handle hat $title mit dir geteilt';
}
@override
String inboxSharedNoHandle(String title) {
return '$title wurde mit dir geteilt';
}
@override
String get inboxSharedArriving => 'Ein Lernset, das noch unterwegs ist';
@override
String get inboxSharedOpen => 'Öffnen';
@override
String get studysetNew => 'Neu';
}

View file

@ -8504,6 +8504,138 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get studysetViewOnlyRefused => 'You can only view this studyset.';
@override
String get shareInviteByHandle => 'Handle';
@override
String get shareInviteByEmail => 'Email';
@override
String get shareInviteAddress => 'Email address';
@override
String get shareInviteEmailHint =>
'They get a link by mail. Only whoever reads that mailbox can join, and the instance keeps the address only as a fingerprint.';
@override
String shareInviteMailed(String address) {
return 'Invitation mailed to $address';
}
@override
String get shareInvitedByEmail => 'Invited by email';
@override
String get shareLinkTitle => 'Join by link';
@override
String get shareLinkHint =>
'Anyone with the link can join as a Viewer. Switching it off ends the link for good.';
@override
String get shareLinkCopy => 'Copy link';
@override
String get shareLinkCopied => 'Link copied';
@override
String get shareRefusedNotAnAddress => 'That isn\'t an email address.';
@override
String get shareRefusedTooManyMails =>
'Too many mails to that address for now. Try again in an hour.';
@override
String get shareRefusedMailFailed =>
'The mail couldn\'t be sent. Try again later.';
@override
String get shareRefusedHandleNeeded =>
'An invitation by mail names you by your handle: choose one in your profile first.';
@override
String get libraryJoin => 'Join with a link';
@override
String get joinLinkLabel => 'Link or code';
@override
String get joinContinue => 'Continue';
@override
String joinInvites(String inviter) {
return '$inviter wants to share a studyset with you';
}
@override
String get joinSomeone => 'Someone';
@override
String get joinAsViewer => 'You can view and study it.';
@override
String get joinAsEditor => 'You can view, study and change it.';
@override
String get joinEmailHint =>
'This invitation went to an email address. Type it, and you\'ll get a code there that shows it\'s yours.';
@override
String get joinSendCode => 'Send code';
@override
String joinCodeSent(String address) {
return 'A code is on its way to $address.';
}
@override
String get joinCodeLabel => 'Code from the mail';
@override
String get joinAction => 'Join';
@override
String get joinDone =>
'You joined. The studyset arrives in your Library with the next sync.';
@override
String get joinAlreadyMember => 'You\'re a member already.';
@override
String get joinNotFound =>
'This link holds no more: it was switched off, has lapsed or was used already.';
@override
String get joinWrongCode => 'That code isn\'t right.';
@override
String get joinCodeExpired => 'This code is no longer valid. Send a new one.';
@override
String get joinOtherAddress => 'This invitation went to another address.';
@override
String get inboxShared => 'Shared with you';
@override
String inboxSharedBy(String handle, String title) {
return '@$handle shared $title with you';
}
@override
String inboxSharedNoHandle(String title) {
return '$title was shared with you';
}
@override
String get inboxSharedArriving => 'A studyset on its way';
@override
String get inboxSharedOpen => 'Open';
@override
String get studysetNew => 'New';
}
/// The translations for English, as used in the United Kingdom (`en_GB`).