Commit Graph
194 Commits
Author SHA1 Message Date
springmin 8dbcb76907 ohos: reject surface events from a torn-down generation
Tag surface events with a gate epoch, invalidate it in OnSurfaceDestroyed, and ignore queued Surface/Destroyed events that cross the 500ms teardown timeout. A stale acknowledgement can no longer detach a newer surface.
2026-10-26 20:35:05 +08:00
springmin 6f657eb748 ohos: keep readable asset secrets on a failed overwrite
A crypto error can mean the row belongs to a previous signing identity, but deleting it before verifying loses a readable secret if the overwrite fails for another reason. Query the existing value first; only remove a confirmed stale entry.
2026-10-26 20:35:05 +08:00
springmin a0061c948e ohos: clarify the picker cache guard
The 50 MiB constant only keeps an accidental huge selection out of the app cache; the shared core still enforces the 25 MiB total compose/draft attachment limit.
2026-10-26 10:57:46 +08:00
springmin 062ba5da20 ohos: complete the P1 picker, IME and lifecycle fixes
- use async fileIo open/stat/mkdir/close in both picker paths so slow content providers do not block the ArkUI thread
- add the window origin to IME updateCursor coordinates, since CursorInfo is in absolute physical screen coordinates
- subscribe the page to UIAbility.onBackground through the ability eventHub so preview resources are released on every background path, while keeping onPageHide as a fallback
- cache the latest password/type request while an IME attach or detach is in flight and replay it when the transition finishes
2026-10-26 06:20:45 +08:00
springmin a9714fa1a7 ohos: harden picker, fonts, input and system integration
- chunk Asset Store secrets above its 1024-byte limit with generation-suffixed entries; publish the marker last and cover the chunked path in the self-test and unit tests
- picker: copy asynchronously, cap imports at 50 MiB, stage under a random UUID (no picked filename in the cache), and let the native side report whether a late result was accepted so the page cleans up orphaned copies
- register the native mouse callback for right-click/ContextMenuArea and reset Shift/CapsLock/auto-repeat state when the window hides or is destroyed
- register non-Latin script fallbacks for the Slint UI and the email renderer from the platform font directory
- report the system light/dark scheme through AppStorage, the NAPI bridge and SlintContext; throttle repeated IME cursor/color updates and guard overlapping IME attach calls
- expose suspendPreview for the page lifecycle so preview resources are released
2026-10-25 23:33:04 +08:00
springmin 8022c58c16 ohos: forward IME password type, action key and cursor updates
- pass the focused field's InputType::Password through the show hook, use VISIBLE_PASSWORD/DONE, and detach/attach when the keyboard type changes
- subscribe sendFunctionKey and send a full Return press/release for the keyboard action key; the reported enter-key value varies by keyboard and is not a fixed code
- forward InputMethodRequest::Update's caret rectangle to the OHOS controller's updateCursor
- remove the remaining privacy bridge closures and URL interception left after the privacy UI was dropped
2026-10-25 22:53:37 +08:00
Tomás Romero aabd902ce8 chore: merge main 2026-10-25 15:20:34 +01:00
springmin a4125207a3 ohos: fix surface lifecycle, fences and wheel scaling
- 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
2026-10-25 22:12:49 +08:00
springmin 6b2076977e feat: add a notification publisher seam
Sync already records chime-worthy arrivals in the notification outbox. This adds the shared dispatcher that applies the Important/All/tabs scope, waits for pending AI routing, and hands raw sender/subject/thread ids to a host publisher. Hosts format and translate the notification and attach the platform action (slot type, wantAgent); the default publisher keeps the whole path a no-op.
2026-10-25 20:55:21 +08:00
Tomás Romero 34adcd9ab3 feat: pick several files on phones 2026-10-25 13:42:46 +01:00
springmin 5c88d455f9 ohos: move privacy and notification seams out of the port
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.
2026-10-25 20:26:35 +08:00
springmin a11d552430 ohos: adapt credential storage to per-connection slots
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).
2026-10-25 20:26:34 +08:00
springmin 018de4b51a Merge remote-tracking branch 'origin/main' into ohos-alias
# 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
2026-10-25 20:02:56 +08:00
Tomás Romero ba89e9cfc3 feat: sync several calendar servers per account 2026-10-25 01:05:50 +02:00
Tomás Romero 85ae2a4d70 ohos: fix the shell metadata 2026-10-24 23:14:48 +02:00
Tomás Romero 2818b7d4e0 ohos: use the Android version code sequence 2026-10-24 23:14:29 +02:00
Tomás Romero 8b0b3d39b3 ohos: keep empty secrets in the Asset Store 2026-10-24 23:13:49 +02:00
Tomás Romero 79e0c67fbf docs: correct the OpenHarmony backend notes 2026-10-24 23:12:44 +02:00
Tomás Romero 5774b84483 ohos: keep build output out of the repository 2026-10-24 23:11:50 +02:00
Tomás Romero a2f9514c62 fix: update vulnerable crates in the OpenHarmony lockfile 2026-10-24 23:10:50 +02:00
Tomás Romero df5c590f5b ohos: repeat the winit patch 2026-10-24 23:10:49 +02:00
Tomás Romero 78f98d3680 ohos: don't click on cancelled touches 2026-10-24 23:08:04 +02:00
Tomás Romero 7ff4385470 ohos: stop logging key codes 2026-10-24 23:08:04 +02:00
Tomás Romero 59a8b6cc9a ohos: ignore the selection clipboard 2026-10-24 23:08:04 +02:00
Tomás Romero 1c1c7aee52 ohos: hold presentation while a picker is open 2026-10-24 23:06:35 +02:00
Tomás Romero 95ff8882eb Merge branch 'main' into ohos-alias 2026-10-24 23:01:38 +02:00
Tomás Romero 795ebace35 feat: choose the app icon in settings 2026-10-24 19:06:22 +02:00
Tomás Romero a207c25fc1 feat: add app icon variants 2026-10-24 19:05:52 +02:00
Tomás Romero dd276ff8c2 fix: use the core Wayland clipboard protocol 2026-10-24 03:20:46 +02:00
Tomás Romero fd291250f6 chore: update tokio and clipboard-win 2026-10-23 18:34:27 +02:00
springmin fd6d1cd96e chore(ohos): refresh the lockfile for the zip dependency edge
The build resolved the zip crate's flate2 edge for the OpenHarmony
workspace; keep the committed lockfile in sync with the source.
2026-10-23 08:42:43 +08:00
springmin a5160c5f29 ohos: fix the inverted mouse wheel direction
OHOS reports positive axis values toward the end of the content (wheel
down, or a touchpad swipe up under natural scrolling), while Slint's
positive delta scrolls toward the start. Invert both axes so the wheel
matches the rest of the system.
2026-10-23 08:42:43 +08:00
springmin 136940e708 chore(deps): update webpki crates for RUSTSEC-2026-0381/0382/0383
The advisory database published three root-certificate/verification fixes
on 2026-10-19/20 and the quality job denies warnings, so update
rustls-webpki to 0.103.16 and webpki-roots/webpki-root-certs to 1.0.10 in
the root, Android and OpenHarmony lockfiles.
2026-10-23 08:42:43 +08:00
springmin ec69115da9 ohos: revise the privacy policy wording
Each language version now states that it applies to its market and prevails
there, instead of the Chinese version claiming precedence over English.

Clarify the controller split (Flectar for support correspondence; local mail
processing on device; the mail provider as an independent controller), the
retention of support correspondence and the international-transfer basis.

Replace the English block's appended website policy with an application
policy of the same structure as the other languages (UK GDPR bases, ICO,
CCPA/CPRA), and link to the website policy instead. Children's age now
reflects each market (14 in Spain and China, 18 in Türkiye and Russia).
2026-10-23 08:42:43 +08:00
springmin 557c84e0a3 ohos: localise the consent screen and polish its layout
The consent gate now resolves its language the same way the bundled policy
does: the system language (zh/es/tr/ru, English otherwise) through the same
language dropdown, with every label, bullet and action translated. Opening
the policy from the gate reuses the selected language.

Restyle the three actions as 48px provider-style rows (icon, label and
chevron) with Lucide assets, add the highlight card, and replace the text
Back button on the policy viewer with a back-arrow icon.
2026-10-23 08:42:43 +08:00
springmin d823705bf6 ohos: add jurisdiction-specific privacy disclosures
Spanish (GDPR): legal bases, the full data-subject rights including
restriction, objection and portability, the AEPD complaint route and the
one-month response deadline; the Spanish version applies to users in Spain
and the EU. Turkish (KVKK): legal bases, the Article 11 rights, the 30-day
deadline and the KVKK complaint route. Russian (152-FZ): legal bases, the
Article 14 rights, the 10-working-day deadline and Roskomnadzor. English:
UK ICO and California CCPA/CPRA statements.
2026-10-23 08:42:43 +08:00
springmin 9b81216c79 ohos: localise the privacy policy and let consent be withdrawn
The policy page now carries Simplified Chinese, English, Spanish, Turkish
and Russian sections and a selector that mirrors Settings -> General; the
application passes the configured language (system, en, es, tr, zh_Hans,
ru) when it opens the page. Settings -> About gains a "Withdraw privacy
consent" row that clears the stored choice and stops the app, so consent can
be changed at any time.

Regenerate the catalogs without line wrapping: gettext versions wrap the
Language-Team header differently, which made the translation check fail on
CI.
2026-10-23 08:42:43 +08:00
springmin 754487188d ohos: add the privacy policy and first-run consent
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.
2026-10-23 08:42:43 +08:00
springmin 95cd321002 ohos: record the PDF preview and clipboard ACL status
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.
2026-10-23 08:42:43 +08:00
springmin 0327bf04ee ohos: configure the PDFium directory from the loaded module
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.
2026-10-23 08:42:43 +08:00
springmin 9bfd7a287a ohos: ignore the generated shell page, document lint and device status
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).
2026-10-23 08:42:43 +08:00
springmin cdea28675f ohos: clear ArkTS lint findings
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.
2026-10-23 08:42:43 +08:00
springmin 2c653187cc ohos: log through hilog and type the ability callback
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.
2026-10-23 08:42:43 +08:00
springmin 0784cf06d3 ohos: request the pasteboard ACL permission for paste
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.
2026-10-23 08:42:43 +08:00
springmin 81d76c3427 ohos: derive the hap version from the workspace crate
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.
2026-10-23 08:42:43 +08:00
springmin f163107e29 ohos: default to com.flectar.mail
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.
2026-10-23 08:42:43 +08:00
springmin 4b510307f4 ohos: wheel scrolling, notification permission timing, asset recovery
- 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.
2026-10-23 08:42:43 +08:00
springmin 8861d4b7f2 ohos: add the OpenHarmony platform host
Tier-3 community port (maintainer: springmin), rebased onto the merged
document-provider abstraction (#84) and the opener seam (#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.
2026-10-23 08:42:42 +08:00
Tomás Romero 4632c5c7f9 refactor: share mail connection setup across protocols 2026-10-22 23:28:48 +02:00
Tomás Romero ed48fcebed chore: update webpki crates 2026-10-21 00:46:49 +02:00