Repository navigation
Conversation
|
Note on the RustSec job: it fails on RUSTSEC-2026-0370 / RUSTSEC-2026-0372 |
b1876be to
bb58e16
Compare
|
Comparison build on device: I ran the current #84 design (provider futures on The blocking variant (the reference port's behaviour) works: the application So #85 keeps |
|
Rebased onto
Design notes worth a look:
Device verification (HarmonyOS 7.0.0.111, API 26, 2-in-1): IMAP IDLE sync, SMTP send, CJK bodies and the compose editor, attachments, backup and snapshot export, certificate import, external links, system notifications, wheel scrolling, and account reconnect after a credential reset. CI: the iOS lint is fixed and green; the long package jobs are still running. @iamdarkle could you take a look once the checks settle? Happy to squash the three commits into one if you prefer. |
|
Rebased onto Since the last update: the first-run privacy consent gate and the bundled five-language policy are in place (jurisdiction-specific sections, withdrawal from Settings → About), the The branch now has 18 commits. If it helps the review, I can split the privacy work into a stacked PR and leave this one as the platform host — otherwise I'll leave it as is for your pass. |
f99a5f3 to
aa01d24
Compare
|
Quick follow-up on the store side: the branch is rebased onto current On HarmonyOS both external testing and release have to go through AppGallery: debug builds only install on UDIDs registered in the profile, and release profiles are AppGallery-only. Would you be open to authorizing me to submit the HarmonyOS build to AppGallery under
I have a draft authorization letter, the five-language privacy policy and the listing materials ready and can send them over. The port stays AGPL and the platform host is in this PR. If you would rather keep the port unlisted for now, I will hold the AppGallery submission and keep this as the upstream contribution. |
|
One process question, since this is a large platform PR: would you prefer I split it up? Options I can prepare:
The current branch is green and mergeable (21 commits, including the wheel-direction fix). I am happy to keep it as one PR if that is easier for you — just let me know which structure you prefer. |
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.
- Register the XComponent UI input callback for axis events and translate wheel/touchpad deltas into Slint's PointerScrolled (50 logical pixels per wheel notch, the same step the desktop backend uses), so Slint flickables scroll under the mouse without application-side changes. - Request notification permission from EntryAbility after loadContent: the page's aboutToAppear runs too early, the system rejects the request with 1600013 and never shows the prompt. Publishing logs the outcome and the failure code through hilog. - When OH_Asset_Add fails with ASSET_CRYPTO_ERROR (a stale row from an earlier signing identity, for example after reinstalling the hap), remove the alias and retry: deletion does not need the old secret, so sign-in and reconnect recover instead of failing with 'asset add failed: 24000009'. - Document wheel input and notification behaviour in platform/ohos/README, and restore the notification_publisher and email_font_dir rows in the PlatformContext contract table.
The new PlatformContext field broke the iOS launch context (CI lint iOS: missing field notification_publisher). iOS keeps the default no-op publisher until it gains a notification backend.
Use the project's bundle name on OpenHarmony too: the Flatpak app id, the macOS/iOS bundle identifier and the Android applicationId are all com.flectar.mail. Document the AGC release-signing environment (hap-sign-tool with the release certificate and profile) and keep BUNDLE= for signing material that was issued for another name.
versionName is the root Cargo.toml version and versionCode is derived from it (major*10^7 + minor*10^5 + patch*10^3, plus the prerelease number or 999 for a release) so application-market uploads stay monotonic. The values in AppScope/app.json5 remain only as the fallback for an IDE build that skips the script.
Reading the system pasteboard requires ohos.permission.READ_PASTEBOARD (system_basic, user_grant). Declare it with a localized reason, resolve the reasonId while packing the hap (the packing tool normally does this), and let the page ask for the permission when a paste is denied; a toast explains the denial. The hap now only installs with an ACL-enabled signing profile that lists the permission; the README documents the requirement.
Review against the installed HarmonyOS skills: replace the page's console calls with hilog (public format specifiers, so values are not redacted and the tag is stable), log the unused cleanup error, and annotate the loadContent error parameter. The ArkTS compiler now reports no warnings.
Run the ArkTS rules of oxk (oxc-ark) over the shell sources: give build() an explicit return type, use the remaining catch parameters, and replace the indexed access in the staged file name with pop(). The linter reports no findings for entry/src/main/ets.
The entry page is produced by build-hap.sh from page-templates/Index.<APP>.ets, so stop tracking it and tell IDE users to copy it first. Add the oxk ArkTS lint configuration with the rules that pass today, a section on the checks run on device, and the known limitations (clipboard ACL, untested import flows, soft keyboard on 2-in-1).
The host never called platform::configure_pdfium, so PDF preview reported "PDF preview is not configured". Resolve this cdylib's own path with dladdr and register its directory, which is where the hap installs the bundled libpdfium.so. Verified on device: previewing a PDF attachment works.
PDF attachment preview is verified on device, and the READ_PASTEBOARD ACL has been approved; note the profile requirement and drop PDF from the untested list.
Ship the policy as a local page (Simplified Chinese, an English application supplement and the official Flectar text, selected from the system language) and link it from onboarding and Settings -> About. The first launch asks for consent before the native module starts, so no account or mail processing happens before the user agrees; the choice is kept in ArkData preferences. The host opens the bundled page when the shared UI asks for the published policy URL; other platforms keep opening the website.
The build resolved the zip crate's flate2 edge for the OpenHarmony workspace; keep the committed lockfile in sync with the source.
Re-extract the strings from the merged UI (account protocols, POP3 and CardDAV changes), merge them back without line wrapping, and restore the Simplified Chinese, Spanish and Russian translations for the privacy rows.
|
Thanks again for the device reports. To keep #85 moving, I pushed some commits to What I pushed:
Splitting Please move these out of #85:
Still open on the OpenHarmony side. These need the device: Rendering and lifecycle:
Input:
Host services:
Fonts:
Packaging and CI:
FYI: six of your intermediate commits don't compile ( CI is green on |
|
All four picker flows resume cleanly on the HarmonyOS 2-in-1:
I pulled Next I will merge current |
# Conflicts: # lang/da/LC_MESSAGES/flectar-mail.po # lang/de/LC_MESSAGES/flectar-mail.po # lang/es/LC_MESSAGES/flectar-mail.po # lang/flectar-mail.pot # lang/fr/LC_MESSAGES/flectar-mail.po # lang/it/LC_MESSAGES/flectar-mail.po # lang/ja/LC_MESSAGES/flectar-mail.po # lang/nl/LC_MESSAGES/flectar-mail.po # lang/ru/LC_MESSAGES/flectar-mail.po # lang/tr/LC_MESSAGES/flectar-mail.po # lang/zh_Hans/LC_MESSAGES/flectar-mail.po
main now keys CalDAV secrets by connection id and names the legacy fixed slot AccountCaldavPassword; use Slot::key() and drop the host notification publisher assignment (the seam moves to its own PR).
Remove the bundled policy, first-launch consent screen, bridge URL interception and Settings/onboarding rows; Flectar hosts the policy at https://flectar.com/mail/privacy/. Remove the notification publisher seam and the permission request so they can be reviewed separately.
|
I merged current As requested:
The device checks from I am now working through the rendering/lifecycle, input, host-service and font items on your list and will report them individually. |
- request a redraw on Surface/SurfaceShown instead of only invalidating the cache, and skip drawing while the window is hidden so the request survives until it is shown - wait for and close the acquire fence returned by RequestBuffer, and abort a rejected flush instead of leaking a dequeued buffer - key buffer geometry to the current surface size so a resize on the same native window reconfigures the queue - expose only the active renderer to Slint and re-associate the software renderer when the GPU attach or render falls back - scale mouse-wheel degrees by the user scroll step, leaving touchpad pixel deltas at 1:1
Do not change mail_setup's mobile certificate-import flow in the port PR: Android and iOS keep their existing behavior, and the OHOS picker work stays in the platform layer. Importing a certificate through DocumentProvider can be proposed separately if the shared hosts want it.
Adds the OpenHarmony host proposed in #77 as a tier-3, community-maintained
port, following the architecture in
platform/README.md.Stacked on #80 (external-link opener seam) and #84 (document provider
adaptation). Both are merged; the branch is rebased onto the current main
and adds the host tree, the fixes from device testing, a one-line iOS
launch-context update for the new publisher field, the move to the project's
bundle name, and the privacy consent and policy screens.
What the port contains
platform/ohos/— the Slint platform backend (XComponent window adapter,software renderer with the experimental femtovg/wgpu path, input/IME,
clipboard, system fonts, wheel/touchpad scrolling through the XComponent UI
input callback, which forwards axis events to Slint as pointer scrolls),
the NAPI cdylib that builds a
PlatformContext(app-private paths,DocumentProviderover the ArkTS pickers, Asset Store credential store,loopback OAuth broker) and calls
flectar_mail::run, the demo crate, theArkTS shell and the build scripts.
platform/ohos/README.mddocuments thebuild and the hap re-packing quirks, and names springmin as the maintainer.
src/platform/ohos.rs— the application-side platform module (PDFiumdirectory, renderer name, thread priority, preview lifecycle, email font
directory). Shared code keeps selecting behaviour through the capability
aliases (
mobile,desktop,linux_desktop); OpenHarmony is part ofmobile, andscripts/check-platform-gates.pypasses with the host treein the repository.
patches/fontique/+crates/fontique/— the Fontconfig opt-out forOpenHarmony as a patch queue (README with the upstream link, the pinned
0.11.1 archive checksum, the patch series), verified by
scripts/fontique-patches.sh verifyfromquality.ymlnext to theBlitz and Parley queues.
.github/workflows/ohos.yml— the tier-3 workflow: manually dispatched onlyand never triggered by pull requests; builds unsigned by default; signing
material only through the
FLECTAR_OHOS_*secrets. It targets aself-hosted runner because the HarmonyOS SDK is not anonymously
downloadable.
provides a
DocumentProvider, so the compose attach button and the Storagebackup/snapshot cards are no longer hidden on mobile.
documents::run_requestblocks the calling thread on mobilehosts: the system picker runs in a window that covers the application and
the host bridge delivers the result from its own thread, so keeping the
presentation thread idle is what OpenHarmony needs (verified on device;
desktop keeps driving the future on the local executor for the native
dialog).
through
platform::email_font_dir()and extends the Han fallback, so CJKmail bodies render with the platform fonts instead of missing glyphs.
(
PlatformContext.notification_publisher, a no-op without a publisher)fed by
CoreEvent::MailNew; the OpenHarmony host publishes through@kit.NotificationKit. The ability requests the permission afterloadContent, because a request from the page'saboutToAppearis rejectedby the system with 1600013 and never shows the prompt.
Cargo.toml:versionNameis thecrate version and
versionCodeis derived from it (prereleases sort belowtheir release), so application-market uploads stay monotonic.
ohos.permission.READ_PASTEBOARD(an ACL/restrictedpermission, system_basic + user_grant). The module declares it with a
localized reason, the hap packing resolves the numeric
reasonIdthepermission dialog needs, and the page requests it when a paste is denied.
Spanish, Turkish and Russian sections, selected from the configured language
(the selector mirrors Settings -> General); it is reachable from onboarding
and Settings -> About, and the first launch asks for consent before the
native module starts. Settings -> About can withdraw the consent, which
clears the choice and stops the app. The host serves the bundled page for the
published policy URL until the website covers the application-specific
disclosures.
OH_Asset_AddreturnsASSET_CRYPTO_ERROR(a record left by an earliersigning identity, e.g. after reinstalling the hap), it removes the alias and
retries, so first sign-in and reconnect work instead of failing with
"asset add failed: 24000009".
Validation
cargo fmt --all -- --check(root and the OHOS workspace), clean.python3 scripts/check-platform-gates.pypasses with the host treein-tree.
scripts/fontique-patches.sh verifypasses.cargo clippy -p flectar-mail --lib(mobile configuration) and both hostcrates with
-D warningsare clean.HarmonyOS 7.0.0.111 (API 26) 2-in-1.
bodies and the compose editor, compose attachments through the system
picker, account-backup export, database-snapshot export, certificate
import, external links in the system browser, system notifications,
wheel/touchpad scrolling, and Asset Store credentials including reconnect
after a credential reset.
(Simplified Chinese, English, Spanish, Turkish, Russian) with the same
language selector as the policy page; the policy renders all five languages
and the jurisdiction-specific sections; accepting starts the native module,
declining stops the application, and withdrawing the consent from
Settings → About clears the choice and stops the app.
com.flectar.mail,the same identifier as the desktop and mobile targets), verified on device
through onboarding, sign-in, sync, send and notifications. The release
hap passes
hap-sign-tool verify-app; local devices install adebug-profile build because release profiles are AppGallery-only.
Known follow-ups
desktop, so enabling it on OpenHarmony needs a capability decision first.
com.flectar.mail; release builds need theAGC-issued certificate and profile, and
BUNDLE=still overrides the namefor signing material that was issued for another identifier.
ohos.permission.READ_PASTEBOARD) needs an approvedrestricted-permission application; a hap that declares it only installs
with a signing profile whose
acls.allowed-aclslists it.website edition covers the application-specific disclosures (local storage,
credentials, clipboard, permissions, no third-party SDKs).
edition; local counsel must confirm each language version, and the related
organisational steps (KVKK/VERBİS, 152-FZ/Roskomnadzor, UK GDPR Article 27)
must be completed, before the app is distributed in those markets.
ohoslabel.Contribution and licensing
fetched at build time with a pinned SHA-256
(
platform/ohos/scripts/fetch-pdfium.sh) and ships inside the hap; thefontique patch is a queue over the pinned crates.io archive.
coding agent (LLM); I reviewed every line, ran the checks above, and tested
the behaviour on device as described.
personal information included.