feat(harmonyos): bundle offline MiniApps in native ArkWeb - #2910
Draft
wgqqqqq wants to merge 7 commits into
Draft
Conversation
wgqqqqq
marked this pull request as draft
September 9, 2026 07:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
assembleHap: passed; inspected the signed HAP to verify all three pages and catalog were packaged.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.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.