Commit Graph
33 Commits
Author SHA1 Message Date
Tomás Romero c5930233bf perf: forward memory pressure from the mobile hosts 2026-11-06 00:27:47 +01:00
Tomás Romero f39cd58537 chore: merge main
# Conflicts:
#	platform/ohos/shell/page-templates/Index.mail.ets
2026-11-04 21:43:24 +01:00
Tomás Romero 58141a5d05 chore: merge main 2026-11-03 23:47:35 +01:00
Tomás Romero 30c6cbd67c chore: merge main
# Conflicts:
#	platform/ohos/mail/src/bridge.rs
2026-11-03 23:47:11 +01:00
Tomás Romero f835ce6923 ohos: place the IME caret from the surface position 2026-11-03 20:02:19 +01:00
Tomás Romero 0992c98e6e ohos: match the Android picker limits 2026-11-03 20:00:03 +01:00
Tomás Romero 137bf96364 ohos: open this app from notifications 2026-11-03 16:48:59 +01:00
springmin 0681283a13 ohos: publish new-mail notifications through NotificationKit
Reconnect the OHOS host publisher to the core notification dispatcher: forward the raw sender, subject, thread and message ids, use NotificationKit with localized fallback text and a START_ABILITY wantAgent, and request notification permission after the page loads.
2026-11-03 12:25:07 +08:00
springmin 17410f4290 ohos: refresh the IME cursor offset with the window
The caret rectangle is relative to the XComponent, but the cached window origin was only read when the page appeared. After maximizing a floating 2-in-1 window, the old floating origin was still added to every cursor update, so the IME candidate stayed at the previous window position. Listen for window rect/status changes and use a zero origin for maximized or full-screen windows.
2026-11-02 14:23:49 +08:00
springmin 1f58ef3c29 ohos: polish document picker limits and naming
Raise the mail-import selection and file-size limits, use a one-hour picker timeout, prefer FileUri.name for the display name, and align the bridge result argument order with the native signature.
2026-11-02 13:48:53 +08:00
springmin f9ace0e1b1 ohos: support multi-select in the document picker
Expose pickOpenMany on the bridge, stage selected files as one JSON result, and implement DocumentProvider::import_many so compose attachments can import several files in one picker action.
2026-10-31 09:05:32 +08:00
springmin 8335f7852e ohos: pass the original picker name through the attachment bridge
Carry the staged path and display name together from the ArkTS picker through the NAPI bridge. Keep the cache name random and only use the decoded original name as attachment metadata.
2026-10-31 06:50:22 +08:00
springmin 90f87c2d0a ohos: read the clipboard on the ArkTS UI thread
Cache plain text from the page's pasteboard listener and let Slint read that cache, so a cross-device pasteboard read cannot stall the Slint thread. Writes keep the cache coherent, and permission grants trigger a fresh read.
2026-10-28 19:08:26 +08:00
springmin 9463ab674b ohos: place IME candidates at the focused caret
Slint reports the initial caret rectangle with InputMethodRequest::Enable, not a separate Update. Forward it too, cache cursor updates while attach/showTextInput is pending, and replay the latest rectangle after the IME becomes editable.\n\nOnly mark a rectangle as applied after updateCursor succeeds, retry transient 12800016 errors, and ignore late completions for an older caret.
2026-10-28 18:44:19 +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
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
Tomás Romero 85ae2a4d70 ohos: fix the shell metadata 2026-10-24 23:14:48 +02: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 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