Skip to content

Share conquered cards with what they were, and ask who to tell about a finished deck - #110

Merged
float3 merged 4 commits into
mainfrom
share-conquests-and-decks
Nov 4, 2026
Merged

float3 merged 4 commits into
mainfrom
share-conquests-and-decks

Conversation

@float3

@float3 float3 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Fixes #103
Fixes #102

Needs float3/ankiquest#138 for the first-person wording, the card label on shared cards and the finished-deck endpoint. Against an older server a conquered card shares as before, and telling friends about a deck says the server can't do it yet.

Conquered cards (#103)

  • Share on a conquered card first asks Show the card, unticked by default. The text field starts with the card's first field (sounds and markup dropped, one line, 120 characters, as the desktop add-on does), or with the label saved before, and the player can edit it. Only when ticked is it saved as the conquest's label (POST /api/conquests/{user}/{at}/label); sharing unticked removes an earlier label. The card's text never leaves the phone otherwise.
  • The server's card, page, link text and friends' rows now say "I just conquered a card" / "I forgot it 5 times, and now it stays with me for weeks." (with the card: "I forgot “der Hund” 5 times, …"), and the "138 cards" chip is gone from conquered cards (server PR).
  • Android's share sheet: on Android 14 and later Share goes straight to the system share sheet with the card image and text, and AnkiQuest friends sits in the sheet as its own entry (EXTRA_CHOOSER_CUSTOM_ACTIONS, an immutable PendingIntent back to the non-exported share activity). Before Android 14 there is no way to add an entry, so the friends / other apps question stays and "Somewhere else…" opens the share sheet. This applies to every win, not only conquered cards.
  • The public link is now made when the share sheet opens, before the player picks a target. Sharing with friends made one anyway, and the token can't be guessed.

Finished decks (#102)

  • After a review session that finishes the selected deck for the day, the app lists everyone in the player's groups (recipients of GET /api/decks), with nobody ticked, and sends the completion to the people picked (POST /api/decks/{user}/share). It shows after the session summary, or on its own when the summary is off or AnkiQuest navigation isn't used.
  • It asks once per deck and Anki day, only while signed in, and not for decks that already announce themselves to chosen people.
  • Friends & sharing → Ask to share finished decks turns it off (on by default), as does Don't ask again in the question.
  • The deck's name only goes to the server for the people picked. It isn't added to the deck notification settings.

Strings in en/de/es/fr/pt. Tests: AnkiquestShareTest (win key, label read/write/remove, finished deck request, card text cleaning, chosen label, share sheet entry on SDK 36 and none on 33, topic on the Share button), new AnkiquestDeckShareTest (who is asked, decks already shared, once a day, the switch), AnkiquestNotifierTest, AnkiquestSettingsMenuTest, PreferencesAnalyticsTest. The dialogs themselves and the Android 14 sheet entry haven't been tried on a device.

A conquered card's Share first asks whether to show the card: unticked
by default, prefilled with its first field (or the label saved before),
editable, and saved as the conquest's label on the server only when
ticked; sharing without it removes an earlier label. On Android 14 and
later the share sheet itself offers AnkiQuest friends next to the other
apps; older versions keep asking first.
After a review session that finishes the selected deck, once per deck and
Anki day, the app lists the people in the player's groups (none ticked)
and sends the completion to those picked through the server. Decks that
already announce themselves to chosen people are left alone. A switch in
Friends & sharing turns the question off, as does Don't ask again.
@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Snapshot diff report vs main. Open screenshot-diff for diffs.

  • PreferencesScreenshotTest: 1 change
All 1 changed screenshots

PreferencesScreenshotTest

  • AnkiquestSharingSettingsFragment_compare.png

# Conflicts:
#	AnkiDroid/src/test/java/com/ichi2/anki/analytics/PreferencesAnalyticsTest.kt
@float3
float3 merged commit 7eeeaac into main Nov 4, 2026
26 checks passed
@float3
float3 deleted the share-conquests-and-decks branch November 4, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

conquered cards deck sharing

1 participant