Repository navigation
Share: thicket-share and -android, files served by Th 8000 icket's own provider - #135
Conversation
…ider docs/16 §16.10 item 5, to the owner's decision of 2026-11-01: a framework ContentProvider the app declares in its manifest, not AndroidX's FileProvider. - thicket-share: Share.text, Share.file, availability; SharedFiles (copies served only from their own directory, with their type; pruned after a day); RecordingShare; Share.unavailable for GTK. - thicket-share-android: ACTION_SEND through the chooser. ThicketFileProvider, not exported, read-only, serves only <cache>/thicket-shared, under FLAG_GRANT_READ_URI_PERMISSION and the intent's ClipData. Undeclared, a file share throws naming the element. Measured: - checkLinux (with-keyring, 8 GB): exit 0; ShareSpec 5/5, JVM and Native. - GTK gallery 137 (136 + 1), todo 69, under a headless gnome-shell (desktop locked). - Android gallery 85/85 (81 + 4) on s2test: build.sh taps the gallery's own share target in the real chooser; text and file (name, type, bytes) arrive, and the provider logs com.android.intentresolver reading the file through the grant. Falsified: without the grant, the share sheet's read disappears and that check fails. Found: ART has no Files.writeString/readString; the first run threw NoSuchMethodError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
An unhandled exception from the unguarded shared.put copy on the fire-and-forget share worker thread can crash the app, diverging from the established Try-wrapped I/O convention.
1 open issue
What changed in this PR
This PR implements docs/16 §16.10 item 5 (share) for the Thicket UI framework, adding a new platform-agnostic thicket-share module and its -android backend. Files are handed to other apps through Thicket's own ContentProvider (ThicketFileProvider) rather than AndroidX's FileProvider (owner's decision), declared by the app with a single <provider> manifest element. GTK has no share sheet, so it uses Share.unavailable; the Apple half is tracked separately in #134. The gallery gains a Share section and, on Android, its own share target so the self-test can be the receiving app and verify a cross-app read through the URI grant.
Changes:
- New
thicket-shareAPI (Share.text/file/availability,SharedFilescopy-store with per-day pruning and path-safety,RecordingShare,Share.unavailable) withShareSpec(5 tests, JVM + Native). - New
thicket-share-android(AndroidShareviaACTION_SEND/createChooser,ThicketFileProviderread-only/non-exported/grant-based), gallery wiring (section, Android share target + self-test, GTK unavailable check), and build/manifest wiring. - Documentation updates (README, decision log, docs 12/14/16, module README) with refreshed test/self-test counts.
| File | Description |
|---|---|
modules/share/shared/.../Share.scala |
New Share trait + Share.unavailable (GTK). |
modules/share/shared/.../SharedFiles.scala |
Copy-per-share store with path-safety (plain/safeName) and prune. |
modules/share/shared/.../testing/RecordingShare.scala |
Test double recording text/file shares. |
modules/share/shared/.../ShareSpec.scala |
Unit tests for SharedFiles, RecordingShare, unavailable. |
modules/share-android/.../AndroidShare.scala |
ACTION_SEND chooser + ThicketFileProvider; worker-thread copy flagged below. |
modules/share/README.md |
Module docs and manifest/declaration guidance. |
examples/gallery/.../ShareDemo.scala |
Gallery Share section state/model. |
examples/gallery/.../StorageDemo.scala |
Adds share to Services. |
examples/gallery/.../Gallery.scala |
Wires the Share section and currentShare. |
examples/gallery/gtk/.../GalleryGtk.scala |
GTK Share.unavailable wiring + self-test check. |
examples/gallery/android/.../GalleryActivity.scala |
Supplies AndroidShare to the gallery. |
examples/gallery/android/.../GallerySelfTest.scala |
4 Android share self-test steps. |
examples/gallery/android/.../ShareTargetActivity.scala |
In-gallery share target + ShareInbox. |
examples/gallery/android/app/src/main/AndroidManifest.xml |
Declares the provider and share-target activity. |
examples/gallery/android/build.sh + README.md |
share-pick driver and gallery notes. |
build.sbt |
Defines share/shareAndroid and aggregates them. |
docs/*, README.md |
Decision log, component status, releasing, device-services, counts. |
My review surfaced one optional robustness/convention issue on the Android worker thread (unguarded put can crash the app on an I/O failure, unlike the adjacent guarded prune and the pickers convention); it is recorded as an inline comment with a suggested fix. The rest of the change is well-scoped, internally consistent across docs/counts, and matches established per-module patterns.
Review effort: Balanced
Conflicts were both sides adding beside each other (build, gallery wiring, docs); each keeps both, camera first as on main. Measured: platforms/Test/compile clean; GTK gallery 138 (137 + share's 1), todo 69 (bin/gtk-selftests.sh); Android gallery 90/90 (86 + share's 4) on s2test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor sharing logic to use Try for error handling. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
One conflict, the decision log's top: both 2026-11-01 entries kept. Docs only; the measurements of b477aed stand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…macOS Location.unavailable (#118) (#138) * WIP #114: thicket-device-apple, its Swift library and the thk_dev ABI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: the Apple galleries' device checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: iOS DRIVE hooks, XCUITest tapper; iOS gallery 191/191 on iPhone 17e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: verify-apple shim-device step, sbt-thicket thicketDeviceApple, README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: docs, decision log, scalafmt exclude for the generated DeviceShim.scala Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: catch a leftover refusal (notYetAsked, failed DRIVE fails), settle 30 s before a fresh install Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: uninstall at the end of a fresh-install run instead of a settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #114: macOS measured unlocked: gallery 195 (185 + 10), occlusion control 4 FAIL hidden -> Background 49 ms, unhidden -> Foreground 33 ms, minimised 595 ms, restored 528 ms. bin/verify-apple.sh "iPhone 17e": 17/17 steps on 9cff276; iOS gallery 191 (179 + 12), macOS gallery 195 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: thicket-location-apple over CLLocationManager in libthicketdevice; gallery location checks Untested on the simulator yet. thk_dev_location_* (5 functions) in DeviceAbi; DeviceConsistencySpec 7/7. libthicketdevice.a 91 KB macOS / 92 KB simulator (43 / 46 KB before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: iOS gallery waits up to 6 min Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: iOS location self-test passes on iPhone Air, 199 checks (191 + 8) The background check records what the section shows while away: iOS suspends the app, so a 3 s timer set in the background never fired (the first runs timed out there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: docs 14, 16, the location, device and gallery READMEs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #118: decision log and docs/12: iOS gallery 199 (191 + 8), macOS 192 locked (191 + 1) Control: without WhileInFront's background stop, 1 FAIL (1 counted, 2 in libthicketdevice) while the on-screen check passes. Found: on a just-booted simulator getNotificationSettings exceeds the 5 s cap on 3 of 7 boots (with or without CoreLocation), read as Denied (#114). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #118: decision log: verify-apple.sh "iPhone Air" 17/17 on 2e2d61a Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #118: decision log: it was the first full run that failed getting-started Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apple device lifecycle and permissions: thicket-device-apple, the galleries' Device section (#114) (#132) * WIP #114: thicket-device-apple, its Swift library and the thk_dev ABI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: the Apple galleries' device checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: iOS DRIVE hooks, XCUITest tapper; iOS gallery 191/191 on iPhone 17e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: verify-apple shim-device step, sbt-thicket thicketDeviceApple, README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: docs, decision log, scalafmt exclude for the generated DeviceShim.scala Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: catch a leftover refusal (notYetAsked, failed DRIVE fails), settle 30 s before a fresh install Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: uninstall at the end of a fresh-install run instead of a settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #114: macOS measured unlocked: gallery 195 (185 + 10), occlusion control 4 FAIL hidden -> Background 49 ms, unhidden -> Foreground 33 ms, minimised 595 ms, restored 528 ms. bin/verify-apple.sh "iPhone 17e": 17/17 steps on 9cff276; iOS gallery 191 (179 + 12), macOS gallery 195 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Roberto Leibman <rleibman@magrathea.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Share: thicket-share and -android, files served by Thicket's own provider (#135) * Share: thicket-share and -android, files served by Thicket's own provider docs/16 §16.10 item 5, to the owner's decision of 2026-11-01: a framework ContentProvider the app declares in its manifest, not AndroidX's FileProvider. - thicket-share: Share.text, Share.file, availability; SharedFiles (copies served only from their own directory, with their type; pruned after a day); RecordingShare; Share.unavailable for GTK. - thicket-share-android: ACTION_SEND through the chooser. ThicketFileProvider, not exported, read-only, serves only <cache>/thicket-shared, under FLAG_GRANT_READ_URI_PERMISSION and the intent's ClipData. Undeclared, a file share throws naming the element. Measured: - checkLinux (with-keyring, 8 GB): exit 0; ShareSpec 5/5, JVM and Native. - GTK gallery 137 (136 + 1), todo 69, under a headless gnome-shell (desktop locked). - Android gallery 85/85 (81 + 4) on s2test: build.sh taps the gallery's own share target in the real chooser; text and file (name, type, bytes) arrive, and the provider logs com.android.intentresolver reading the file through the grant. Falsified: without the grant, the share sheet's read disappears and that check fails. Found: ART has no Files.writeString/readString; the first run threw NoSuchMethodError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Refactor sharing process with error handling Refactor sharing logic to use Try for error handling. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Roberto Leibman <rleibman@magrathea.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…navailable (#120) (#137) * WIP #114: thicket-device-apple, its Swift library and the thk_dev ABI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: the Apple galleries' device checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: iOS DRIVE hooks, XCUITest tapper; iOS gallery 191/191 on iPhone 17e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: verify-apple shim-device step, sbt-thicket thicketDeviceApple, README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: docs, decision log, scalafmt exclude for the generated DeviceShim.scala Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: catch a leftover refusal (notYetAsked, failed DRIVE fails), settle 30 s before a fresh install Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: uninstall at the end of a fresh-install run instead of a settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #114: macOS measured unlocked: gallery 195 (185 + 10), occlusion control 4 FAIL hidden -> Background 49 ms, unhidden -> Foreground 33 ms, minimised 595 ms, restored 528 ms. bin/verify-apple.sh "iPhone 17e": 17/17 steps on 9cff276; iOS gallery 191 (179 + 12), macOS gallery 195 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #120: thicket-motion-ios: MotionAbi (thk_mot_*, 4 functions), Swift over CMMotionManager, IosMotionProvider shimGen/testFull 37/37 (MotionConsistencySpec 7). libthicketmotion.a 15 056 bytes (ios-sim). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #120: the gallery's Motion section on Apple: IosMotion on iOS, Motion.unavailable on macOS, GalleryMotionChecks iOS gallery on iPhone 17e: 195 ok, 0 FAIL; the 5 motion checks pass (0 starts, nothing active). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #120: thicketMotionIos in sbt-thicket; MotionShim.scala excluded from scalafmt; formatted Controls on iPhone 17e: Motion.apply ignoring availability -> 1 FAIL (3 starts for 0 available). macOS gallery 196 ok (195 + 1 motion), unlocked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #120: docs: decision log, docs/09 §9.11, 12, 14, 16, motion README verify-apple.sh "iPhone 17e" on ef811a1: 18/18 (shim-motion new); iOS gallery 196, macOS 196 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #120: the verify-apple results in the decision log 18/18 on ef811a1; 17/18 twice on the merge 3f6ea69 (#114's leftover notifications refusal after a reboot; motion checks pass); iOS gallery alone 196, macOS 196 unlocked / 192 locked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apple device lifecycle and permissions: thicket-device-apple, the galleries' Device section (#114) (#132) * WIP #114: thicket-device-apple, its Swift library and the thk_dev ABI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: the Apple galleries' device checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: iOS DRIVE hooks, XCUITest tapper; iOS gallery 191/191 on iPhone 17e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: verify-apple shim-device step, sbt-thicket thicketDeviceApple, README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: docs, decision log, scalafmt exclude for the generated DeviceShim.scala Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: catch a leftover refusal (notYetAsked, failed DRIVE fails), settle 30 s before a fresh install Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: uninstall at the end of a fresh-install run instead of a settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #114: macOS measured unlocked: gallery 195 (185 + 10), occlusion control 4 FAIL hidden -> Background 49 ms, unhidden -> Foreground 33 ms, minimised 595 ms, restored 528 ms. bin/verify-apple.sh "iPhone 17e": 17/17 steps on 9cff276; iOS gallery 191 (179 + 12), macOS gallery 195 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Roberto Leibman <rleibman@magrathea.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Share: thicket-share and -android, files served by Thicket's own provider (#135) * Share: thicket-share and -android, files served by Thicket's own provider docs/16 §16.10 item 5, to the owner's decision of 2026-11-01: a framework ContentProvider the app declares in its manifest, not AndroidX's FileProvider. - thicket-share: Share.text, Share.file, availability; SharedFiles (copies served only from their own directory, with their type; pruned after a day); RecordingShare; Share.unavailable for GTK. - thicket-share-android: ACTION_SEND through the chooser. ThicketFileProvider, not exported, read-only, serves only <cache>/thicket-shared, under FLAG_GRANT_READ_URI_PERMISSION and the intent's ClipData. Undeclared, a file share throws naming the element. Measured: - checkLinux (with-keyring, 8 GB): exit 0; ShareSpec 5/5, JVM and Native. - GTK gallery 137 (136 + 1), todo 69, under a headless gnome-shell (desktop locked). - Android gallery 85/85 (81 + 4) on s2test: build.sh taps the gallery's own share target in the real chooser; text and file (name, type, bytes) arrive, and the provider logs com.android.intentresolver reading the file through the grant. Falsified: without the grant, the share sheet's read disappears and that check fails. Found: ART has no Files.writeString/readString; the first run threw NoSuchMethodError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Refactor sharing process with error handling Refactor sharing logic to use Try for error handling. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Apple location: thicket-location-apple over CLLocationManager (iOS); macOS Location.unavailable (#118) (#138) * WIP #114: thicket-device-apple, its Swift library and the thk_dev ABI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: the Apple galleries' device checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: iOS DRIVE hooks, XCUITest tapper; iOS gallery 191/191 on iPhone 17e Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: verify-apple shim-device step, sbt-thicket thicketDeviceApple, README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: docs, decision log, scalafmt exclude for the generated DeviceShim.scala Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: catch a leftover refusal (notYetAsked, failed DRIVE fails), settle 30 s before a fresh install Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: uninstall at the end of a fresh-install run instead of a settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #114: macOS measured unlocked: gallery 195 (185 + 10), occlusion control 4 FAIL hidden -> Background 49 ms, unhidden -> Foreground 33 ms, minimised 595 ms, restored 528 ms. bin/verify-apple.sh "iPhone 17e": 17/17 steps on 9cff276; iOS gallery 191 (179 + 12), macOS gallery 195 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: thicket-location-apple over CLLocationManager in libthicketdevice; gallery location checks Untested on the simulator yet. thk_dev_location_* (5 functions) in DeviceAbi; DeviceConsistencySpec 7/7. libthicketdevice.a 91 KB macOS / 92 KB simulator (43 / 46 KB before). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: iOS gallery waits up to 6 min Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: iOS location self-test passes on iPhone Air, 199 checks (191 + 8) The background check records what the section shows while away: iOS suspends the app, so a 3 s timer set in the background never fired (the first runs timed out there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #118: docs 14, 16, the location, device and gallery READMEs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #118: decision log and docs/12: iOS gallery 199 (191 + 8), macOS 192 locked (191 + 1) Control: without WhileInFront's background stop, 1 FAIL (1 counted, 2 in libthicketdevice) while the on-screen check passes. Found: on a just-booted simulator getNotificationSettings exceeds the 5 s cap on 3 of 7 boots (with or without CoreLocation), read as Denied (#114). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #118: decision log: verify-apple.sh "iPhone Air" 17/17 on 2e2d61a Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #118: decision log: it was the first full run that failed getting-started Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Apple device lifecycle and permissions: thicket-device-apple, the galleries' Device section (#114) (#132) * WIP #114: thicket-device-apple, its Swift library and the thk_dev ABI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: the Apple galleries' device checks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: iOS DRIVE hooks, XCUITest tapper; iOS gallery 191/191 on iPhone 17e Co-Authored-By: Claude 8000 Opus 5.5 <noreply@anthropic.com> * WIP #114: verify-apple shim-device step, sbt-thicket thicketDeviceApple, README Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: docs, decision log, scalafmt exclude for the generated DeviceShim.scala Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: catch a leftover refusal (notYetAsked, failed DRIVE fails), settle 30 s before a fresh install Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * WIP #114: uninstall at the end of a fresh-install run instead of a settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * #114: macOS measured unlocked: gallery 195 (185 + 10), occlusion control 4 FAIL hidden -> Background 49 ms, unhidden -> Foreground 33 ms, minimised 595 ms, restored 528 ms. bin/verify-apple.sh "iPhone 17e": 17/17 steps on 9cff276; iOS gallery 191 (179 + 12), macOS gallery 195 twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Roberto Leibman <rleibman@magrathea.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Share: thicket-share and -android, files served by Thicket's own provider (#135) * Share: thicket-share and -android, files served by Thicket's own provider docs/16 §16.10 item 5, to the owner's decision of 2026-11-01: a framework ContentProvider the app declares in its manifest, not AndroidX's FileProvider. - thicket-share: Share.text, Share.file, availability; SharedFiles (copies served only from their own directory, with their type; pruned after a day); RecordingShare; Share.unavailable for GTK. - thicket-share-android: ACTION_SEND through the chooser. ThicketFileProvider, not exported, read-only, serves only <cache>/thicket-shared, under FLAG_GRANT_READ_URI_PERMISSION and the intent's ClipData. Undeclared, a file share throws naming the element. Measured: - checkLinux (with-keyring, 8 GB): exit 0; ShareSpec 5/5, JVM and Native. - GTK gallery 137 (136 + 1), todo 69, under a headless gnome-shell (desktop locked). - Android gallery 85/85 (81 + 4) on s2test: build.sh taps the gallery's own share target in the real chooser; text and file (name, type, bytes) arrive, and the provider logs com.android.intentresolver reading the file through the grant. Falsified: without the grant, the share sheet's read disappears and that check fails. Found: ART has no Files.writeString/readString; the first run threw NoSuchMethodError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Refactor sharing process with error handling Refactor sharing logic to use Try for error handling. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Roberto Leibman <rleibman@magrathea.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Roberto Leibman <rleibman@magrathea.local> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

docs/16§16.10 item 5: share, to your decision (a). Files go to other apps through Thicket's ownContentProvider, written against the framework and declared by the app with one<provider>element. Based onmain, not stacked. It will conflict with #133 (camera) in the docs and the gallery wiring; whichever merges second, I'll mergemaininto the other. The Apple half is #134.What it adds
thicket-share:Share.text(text, subject),Share.file(path, mimeType)andavailability.SharedFiles(shared code): a copy per share at<cache>/thicket-shared/<id>/<name>, with its type. It serves nothing outside that directory, and prunes copies after a day.RecordingSharefor tests;Share.unavailablefor GTK.thicket-share-android:ACTION_SENDthroughIntent.createChooser.ThicketFileProvideris not exported, is read-only, and serves only those copies. The chosen app reads a file throughFLAG_GRANT_READ_URI_PERMISSION, and the URI also goes inClipDataso the chooser's preview can read it.ShareTargetActivity), so the self-test can be the app on the other end.Measured
bin/with-keyring.sh sbt -J-Xmx8G --error checkLinuxShareSpec5/5, JVM and NativeWAYLAND_DISPLAY=thicket-headless bin/with-keyring.sh bin/gtk-selftests.shSELFTEST=1 examples/gallery/android/build.sh(s2test, API 36)The GTK run was under a headless
gnome-shellbecause the desktop was locked. Locked, the Device foreground check fails while every other check passes.On Android,
build.shtaps the gallery's own target in the real chooser (DRIVE share-pick):com.android.intentresolver: query thicket-share.txt: the share sheet, a different app, reading the file through the grant.Falsified. Without the grant, the share sheet's read disappears, and the check that another app read the file fails. The inbox still got the file, because it's the same app and needs no grant. That's why the other-app check is there.
Found on the way
Files.writeStringorreadString(Java 11), though-release 17compiles them. The first run threwNoSuchMethodError.SharedFilesuseswriteandreadAllBytes.Not measured
IllegalStateExceptionfor an undeclared provider. It needs a gallery build without the<provider>element.🤖 Generated with Claude Code