ai-assisted-todolist

Sharing into the app#

Another app's Share offers TaskFest (#279): text, a link, an image or a PDF shared to it opens Add a task, filled in, to be finished there — a due date chosen, at least. Android has it (#355), and iOS through a share extension (#356). Why expo-sharing, and why the app reads only the raw share, is in decisions/mobile-app.md.

What is offered#

How a share reaches the app#

What a share becomes#

mobile/src/incoming.ts turns a share into a task to add:

When the form opens#

TaskFestApp takes a share when the app starts and whenever it comes back to the foreground, and opens the form once the board can take it. Until its form is closed, the share stays where the platform keeps it (#432, sharesFrom in mobile/src/incoming.ts): it is read but not cleared, and the files the iOS extension left are not let go, so an app the system ends meanwhile — while the user signs in, or is off in another app for a password with the form open — finds it again when it next starts. It is taken once a run, however often the app comes back meanwhile, and cleared once its form is closed — added, cancelled, or closed by a sign-out — unless a newer share has replaced it there. A share replaced there before its form ever opened, in a run that then ended, leaves its files in the App Group: nothing names them any more. The platform keeps one share, so a share waiting behind another lives only as long as the run. On Android the share is the intent that started the app, held in memory: whether Android hands it over again to an app it ended depends on how the user comes back to it.

The copies go once the form is closed — added, cancelled, or closed by a sign-out — and none of its files is uploading any more; copies the form does not keep go at once; and copies a run left behind go before the next run's first share. On iOS the extension's own copies, in the App Group, go when the share's form is closed, with their folders (releaseShared in Main.tsx).

Tested#