Repository navigation
documents: route attachments, backups and snapshots through the host provider - #84
Conversation
c5d4461 to
624af0e
Compare
…provider Compose attachments, account-backup export/import and database-snapshot export still opened desktop file dialogs directly, so on mobile they reported "no picker" even though the host provides a DocumentProvider. - DocumentProvider::import_many() imports several documents for one action (default: repeat import() until the picker is cancelled; the desktop provider uses one multi-select dialog). Imported documents stay alive in the composer until Core has staged the attachments. - Compose attachments use import_many() instead of rfd::FileDialog. - Backup export/import stage one app-private file and hand it to the provider; the existing import logic keeps its synchronous shape on the UI thread executor. - Database snapshots keep Core's verified snapshot, archive it as one zip (hosts export files, not folders) and pass it to the provider. Staging stays outside the data/cache roots Core requires. - Desktop behavior is unchanged: same dialogs and file names.
624af0e to
2116909
Compare
|
Note on the RustSec job: it fails on RUSTSEC-2026-0370 / RUSTSEC-2026-0372 |
|
FYI for the mobile hosts (not a request to change anything here): on The reference OpenHarmony port blocked the calling thread while the picker was |
|
Thanks for the heads-up on the OpenHarmony picker, and for this contribution, routing these flows through the document provider is a solid step for the mobile hosts. I added follow-up commits that run the requests on the Tokio runtime (backup export panicked on every platform, and the mobile pickers panicked on their timers outside it), restore the desktop dialog titles and filters, keep the folder picker for desktop snapshots, guard against repeated clicks, and stop mobile snapshot export early when the archive would exceed the 512 MiB transfer limit. CI is green, so this is ready to merge. For #85, every picker and export now goes through |
Tier-3 community port (maintainer: springmin), rebased onto the merged document-provider abstraction (flectar#84) and the opener seam (flectar#80). - platform/ohos: Slint backend (XComponent window adapter, software renderer with the experimental femtovg/wgpu path, input/IME, clipboard, system fonts), the NAPI cdylib that builds a PlatformContext (app-private paths, DocumentProvider over the ArkTS pickers, Asset Store credential store, loopback OAuth broker, external URL opener, notification publisher) and calls flectar_mail::run, the demo crate, the ArkTS shell and the build and packaging scripts (bundle name configurable, defaults to com.flectar.mail_ohos). - src/platform/ohos.rs: PDFium directory, renderer name, thread priority, preview lifecycle, email font directory; OpenHarmony stays under the mobile capability alias. - patches/fontique + crates/fontique: the Fontconfig opt-out as a patch queue applied by the platform/ohos workspace, verified from quality.yml. - .github/workflows/ohos.yml: manually dispatched tier-3 workflow, unsigned by default, signing material only from the FLECTAR_OHOS_* secrets. - src/documents.rs: run_request blocks the calling thread on mobile hosts; the picker covers the window, and keeping the presentation thread idle is what OpenHarmony needs (verified on device; desktop keeps the runtime request for the native dialog). - The email renderer and the compose editor load platform::email_font_dir() and the Han fallback, so CJK mail bodies and composed text render with the platform fonts. - New-mail notifications: a publisher seam fed by CoreEvent::MailNew; the host publishes through @kit.NotificationKit.
Tier-3 community port (maintainer: springmin), rebased onto the merged document-provider abstraction (flectar#84) and the opener seam (flectar#80). - platform/ohos: Slint backend (XComponent window adapter, software renderer with the experimental femtovg/wgpu path, input/IME, clipboard, system fonts), the NAPI cdylib that builds a PlatformContext (app-private paths, DocumentProvider over the ArkTS pickers, Asset Store credential store, loopback OAuth broker, external URL opener, notification publisher) and calls flectar_mail::run, the demo crate, the ArkTS shell and the build and packaging scripts (bundle name configurable, defaults to com.flectar.mail_ohos). - src/platform/ohos.rs: PDFium directory, renderer name, thread priority, preview lifecycle, email font directory; OpenHarmony stays under the mobile capability alias. - patches/fontique + crates/fontique: the Fontconfig opt-out as a patch queue applied by the platform/ohos workspace, verified from quality.yml. - .github/workflows/ohos.yml: manually dispatched tier-3 workflow, unsigned by default, signing material only from the FLECTAR_OHOS_* secrets. - src/documents.rs: run_request blocks the calling thread on mobile hosts; the picker covers the window, and keeping the presentation thread idle is what OpenHarmony needs (verified on device; desktop keeps the runtime request for the native dialog). - The email renderer and the compose editor load platform::email_font_dir() and the Han fallback, so CJK mail bodies and composed text render with the platform fonts. - New-mail notifications: a publisher seam fed by CoreEvent::MailNew; the host publishes through @kit.NotificationKit.
Tier-3 community port (maintainer: springmin), rebased onto the merged document-provider abstraction (flectar#84) and the opener seam (flectar#80). - platform/ohos: Slint backend (XComponent window adapter, software renderer with the experimental femtovg/wgpu path, input/IME, clipboard, system fonts), the NAPI cdylib that builds a PlatformContext (app-private paths, DocumentProvider over the ArkTS pickers, Asset Store credential store, loopback OAuth broker, external URL opener, notification publisher) and calls flectar_mail::run, the demo crate, the ArkTS shell and the build and packaging scripts (bundle name configurable, defaults to com.flectar.mail_ohos). - src/platform/ohos.rs: PDFium directory, renderer name, thread priority, preview lifecycle, email font directory; OpenHarmony stays under the mobile capability alias. - patches/fontique + crates/fontique: the Fontconfig opt-out as a patch queue applied by the platform/ohos workspace, verified from quality.yml. - .github/workflows/ohos.yml: manually dispatched tier-3 workflow, unsigned by default, signing material only from the FLECTAR_OHOS_* secrets. - src/documents.rs: run_request blocks the calling thread on mobile hosts; the picker covers the window, and keeping the presentation thread idle is what OpenHarmony needs (verified on device; desktop keeps the runtime request for the native dialog). - The email renderer and the compose editor load platform::email_font_dir() and the Han fallback, so CJK mail bodies and composed text render with the platform fonts. - New-mail notifications: a publisher seam fed by CoreEvent::MailNew; the host publishes through @kit.NotificationKit.
Tier-3 community port (maintainer: springmin), rebased onto the merged document-provider abstraction (flectar#84) and the opener seam (flectar#80). - platform/ohos: Slint backend (XComponent window adapter, software renderer with the experimental femtovg/wgpu path, input/IME, clipboard, system fonts), the NAPI cdylib that builds a PlatformContext (app-private paths, DocumentProvider over the ArkTS pickers, Asset Store credential store, loopback OAuth broker, external URL opener, notification publisher) and calls flectar_mail::run, the demo crate, the ArkTS shell and the build and packaging scripts (bundle name configurable, defaults to com.flectar.mail_ohos). - src/platform/ohos.rs: PDFium directory, renderer name, thread priority, preview lifecycle, email font directory; OpenHarmony stays under the mobile capability alias. - patches/fontique + crates/fontique: the Fontconfig opt-out as a patch queue applied by the platform/ohos workspace, verified from quality.yml. - .github/workflows/ohos.yml: manually dispatched tier-3 workflow, unsigned by default, signing material only from the FLECTAR_OHOS_* secrets. - src/documents.rs: run_request blocks the calling thread on mobile hosts; the picker covers the window, and keeping the presentation thread idle is what OpenHarmony needs (verified on device; desktop keeps the runtime request for the native dialog). - The email renderer and the compose editor load platform::email_font_dir() and the Han fallback, so CJK mail bodies and composed text render with the platform fonts. - New-mail notifications: a publisher seam fed by CoreEvent::MailNew; the host publishes through @kit.NotificationKit.
Tier-3 community port (maintainer: springmin), rebased onto the merged document-provider abstraction (flectar#84) and the opener seam (flectar#80). - platform/ohos: Slint backend (XComponent window adapter, software renderer with the experimental femtovg/wgpu path, input/IME, clipboard, system fonts), the NAPI cdylib that builds a PlatformContext (app-private paths, DocumentProvider over the ArkTS pickers, Asset Store credential store, loopback OAuth broker, external URL opener, notification publisher) and calls flectar_mail::run, the demo crate, the ArkTS shell and the build and packaging scripts (bundle name configurable, defaults to com.flectar.mail_ohos). - src/platform/ohos.rs: PDFium directory, renderer name, thread priority, preview lifecycle, email font directory; OpenHarmony stays under the mobile capability alias. - patches/fontique + crates/fontique: the Fontconfig opt-out as a patch queue applied by the platform/ohos workspace, verified from quality.yml. - .github/workflows/ohos.yml: manually dispatched tier-3 workflow, unsigned by default, signing material only from the FLECTAR_OHOS_* secrets. - src/documents.rs: run_request blocks the calling thread on mobile hosts; the picker covers the window, and keeping the presentation thread idle is what OpenHarmony needs (verified on device; desktop keeps the runtime request for the native dialog). - The email renderer and the compose editor load platform::email_font_dir() and the Han fallback, so CJK mail bodies and composed text render with the platform fonts. - New-mail notifications: a publisher seam fed by CoreEvent::MailNew; the host publishes through @kit.NotificationKit.
Tier-3 community port (maintainer: springmin), rebased onto the merged document-provider abstraction (flectar#84) and the opener seam (flectar#80). - platform/ohos: Slint backend (XComponent window adapter, software renderer with the experimental femtovg/wgpu path, input/IME, clipboard, system fonts), the NAPI cdylib that builds a PlatformContext (app-private paths, DocumentProvider over the ArkTS pickers, Asset Store credential store, loopback OAuth broker, external URL opener, notification publisher) and calls flectar_mail::run, the demo crate, the ArkTS shell and the build and packaging scripts (bundle name configurable, defaults to com.flectar.mail_ohos). - src/platform/ohos.rs: PDFium directory, renderer name, thread priority, preview lifecycle, email font directory; OpenHarmony stays under the mobile capability alias. - patches/fontique + crates/fontique: the Fontconfig opt-out as a patch queue applied by the platform/ohos workspace, verified from quality.yml. - .github/workflows/ohos.yml: manually dispatched tier-3 workflow, unsigned by default, signing material only from the FLECTAR_OHOS_* secrets. - src/documents.rs: run_request blocks the calling thread on mobile hosts; the picker covers the window, and keeping the presentation thread idle is what OpenHarmony needs (verified on device; desktop keeps the runtime request for the native dialog). - The email renderer and the compose editor load platform::email_font_dir() and the Han fallback, so CJK mail bodies and composed text render with the platform fonts. - New-mail notifications: a publisher seam fed by CoreEvent::MailNew; the host publishes through @kit.NotificationKit.
Compose attachments, account-backup export/import and database-snapshot
export still opened desktop file dialogs (
rfd) directly, so on mobile theyreported "no picker" even though the host provides a
DocumentProvider. Thisroutes all three through the provider.
What changes
document_apis_supportedis true on every host now that all of them providea
DocumentProvider, so the compose attach button and the Storagebackup/snapshot cards show up on phones and tablets.
DocumentProvider::import_many()imports several documents for one useraction. The default imports one document per request, so a single-document
picker (Android, iOS, OpenHarmony) never opens twice for one tap; the desktop
provider overrides it with one multi-select dialog. The composer keeps the returned documents alive until
Core has staged the attachments, which is how the trait already describes
owned import copies.
import_many(); the duplicate, size and 25 MB totalchecks and their notices are unchanged.
hands it to
export(); import awaitsimport()and then runs the existingverified import logic on the UI-thread executor, so the state updates keep
their current shape.
archives it as one zip (hosts export files, not folders) and hands it to
export(). Staging is created outside the data/cache roots Core requires forsnapshots, which also covers hosts whose
TMPDIRis the app cache. Thearchiver skips symlinks and declares no path outside the snapshot directory.
backup limit. Nothing about the JSON formats or the credential exclusion
changes.
Validation
cargo fmt --all -- --check: clean.python3 scripts/check-platform-gates.py: passes.cargo clippyfor the shared application with the mobile configuration(OpenHarmony target): clean.
import_many(cancellation ends the loop,the limit is honored, and dropped imports release their copies).
these paths wired to the ArkTS pickers; the interactive flows are part of the
port's manual test matrix (tracked in OpenHarmony (HarmonyOS) platform support — interest in a port contribution? #77).
Contribution and licensing
zip9.0.4 (MIT, already in thedependency graph through
flectar-mail-core; the root crate now declares itdirectly with default features off and uses Stored compression only) for the
snapshot archive. No new asset.
coding agent (LLM); I reviewed every line, ran the checks above, and tested
the behavior as described.
personal information included.