Skip to content

feat(harmonyos): bundle offline MiniApps in native ArkWeb - #2910

Draft
wgqqqqq wants to merge 7 commits into
GCWing:mainfrom
wgqqqqq:wgq/harmony-miniapp-h5
Draft

feat(harmonyos): bundle offline MiniApps in native ArkWeb#2910
wgqqqqq wants to merge 7 commits into
GCWing:mainfrom
wgqqqqq:wgq/harmony-miniapp-h5

Conversation

@wgqqqqq

@wgqqqqq wgqqqqq commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

HarmonyOS users can open Gomoku, Regex Playground, and Daily Divination locally without signing in or connecting to a desktop. The pages reuse the existing shared MiniApp sources and run offline in ArkWeb. Their storage and clipboard writes stay on the phone.

Each IDE/CLI HAP build generates the bundled resources from the shared sources and canonical appearance tokens. The three pages, mobile bridge, theme, and catalog occupy 236,272 bytes in the verified signed HAP. Phone-specific CSS fixes Gomoku's narrow-screen board/control overlap and permits vertical scrolling on the board.

The native host owns per-app local storage with serialized, atomic writes and retains existing records across bundle upgrades. The bridge exposes only selected storage keys and clipboard writes. Pages are isolated in a sandboxed iframe with no network or local-file access; stale page revisions cannot issue calls against a replacement page. Language is provided before page initialization, and light/dark appearance and resizing update without reloading.

Desktop MiniApp catalogs, HTML transfer, and remote Worker execution are deferred. This PR changes no desktop adapter or Remote Connect protocol relative to main. Local MiniApps do not consume remote workspace or peer data and do not execute jobs on CLI/Detached Dispatch hosts. Changing or disconnecting a desktop does not invalidate local tools.

The MiniApp entry uses a quiet outlined icon and 16vp navigation label in the sidebar. The catalog follows a visual-library layout: rounded square showcase previews, app names below, two columns on phones and three on wide screens. Tapping a preview opens its app directly. Showcase artwork reuses the existing desktop assets.

Verification

  • HarmonyOS assembleHap: passed; inspected the signed HAP to verify all three pages and catalog were packaged.
  • HarmonyOS LocalTest: 491 passed, 0 failures/errors.
  • node --test miniapps/*.test.cjs: 6 passed. Covers generated executable scripts, bridge replies, legacy records and unknown fields, per-app isolation, large regex input, corrupt-record retention, and failed-write preservation.
  • pnpm run harmony:architecture: passed.
  • pnpm run theme:color-audit:all: passed.
  • Browser interaction checks with the production wrapper/pages and a mocked native host: all three apps at 390px and 1000px, live compact/wide/compact resizing, light/dark appearance, Chinese initialization, Gomoku move entry, regex editing/matching and persistence, divination drawing/persistence and clipboard requests. No page errors or horizontal overflow.
  • Diff whitespace check against upstream/main: passed.
  • pnpm run check:repo-hygiene: blocked by pre-existing untracked local research/artifact/legacy iOS directories containing retired product names; those files were retained and are not included in this PR.

Updated UI verified on a connected HarmonyOS phone: sidebar entry, two-column preview gallery, and opening Gomoku in ArkWeb. A foldable emulator verified light/dark navigation, two/three-column gallery layouts, and live folded/unfolded transitions. Native storage/clipboard persistence and physical folding on a real device remain unverified.

@wgqqqqq
wgqqqqq marked this pull request as draft September 9, 2026 07:00
@wgqqqqq wgqqqqq changed the title feat(harmonyos): preview desktop MiniApps in native ArkWeb feat(harmonyos): bundle offline MiniApps in native ArkWeb Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant