Skip to content

ohos: the OctoSense desktop on a HarmonyOS 2-in-1 - #264

Open
ymote wants to merge 1 commit into
mainfrom
ohos/desktop-on-2in1
Open

ymote wants to merge 1 commit into
mainfrom
ohos/desktop-on-2in1

Conversation

@ymote

@ymote ymote commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

OpenHarmony builds were the phone shell only: crates/shell/build.rs and phone/build.rs set mobile_only for target_env = "ohos" ("cannot host desktop processes"). Every native app is an in-process module on OpenHarmony, so the desktop runs there. On a MateBook Pro (HarmonyOS 7.0, API 26) all 13 dock apps open, including Terminal, and so do a YouTube video and its system browser.

Changes

  • OCTOSENSE_OHOS_DESKTOP=1 (crates/shell/build.rs, phone/build.rs) builds the desktop shell for OpenHarmony. Without it nothing changes.
  • build-home-ohos.py --desktop sets it and declares the module for 2in1 and tablet; a phone-only module runs in a phone-sized compatibility window on a 2-in-1. EntryAbility.ets maximizes the window on a 2-in-1.
  • phone/Cargo.toml: an opt-in app-terminal feature. native-apps.json keeps Terminal off the phone shell.
  • user_home(): the platform's data directory where it has one, so a new terminal opens in the app's folder rather than a HOME the app may not use.
  • keyboard.patch: build-home-ohos.py applies it only while the framework's ArkTS bridge still drives the input method. With makepad's NDK input method there's no ArkTS keyboard code left to patch, so this works before and after the pin moves.

Depends on (for input, scroll, input method, web views, Terminal)

Without them the desktop draws but takes no clicks on a 2-in-1. This PR doesn't move the makepad pin.

Checked

  • cargo check --locked -p octosense, and -p octosense-home --features mobile-apps from phone/.
  • tools/check-shell-graph.sh for both packages; rom unittests.
  • octosense-shell tests (--features mobile-apps): 731 pass. 1 fails on my machine, sandbox::tests::a_jail_only_app_reads_its_jail_and_is_refused_everything_else: the jail probe can't start there. This branch doesn't touch the sandbox.
  • On the MateBook Pro, through an equivalent Linux build (HarmonyOS command-line tools 6.1.1, AGC debug signing, makepad docs: AI services (octos): architecture, trust model, what apps can use today, ADR 0002 status #90/setup: make .sources/ worktrees of existing local clones #91 applied): dock launches, windows, typing, Terminal, scrolling, YouTube. build-home-ohos.py --desktop itself is unverified: it needs DevEco on macOS.

🤖 Generated with Claude Code

OpenHarmony builds were the phone shell only (build.rs set mobile_only for
target_env = ohos, "cannot host desktop processes"). Every native app is an
in-process module there, so the desktop runs: on a MateBook Pro
(HarmonyOS 7.0, API 26) all 13 dock apps open, Terminal included.

- OCTOSENSE_OHOS_DESKTOP=1 (crates/shell/build.rs, phone/build.rs) builds
  the desktop shell for OpenHarmony; without it nothing changes.
- build-home-ohos.py --desktop sets it and declares the module for 2in1 and
  tablet (a phone-only module runs in a phone-sized compatibility window);
  EntryAbility maximizes the window on a 2-in-1.
- phone/Cargo.toml: an app-terminal feature (opt-in; native-apps.json keeps
  Terminal off the phone shell).
- user_home(): the platform's data directory where it has one, so a new
  terminal opens in the app's folder, not in a HOME the app may not use.
- build-home-ohos.py applies phone/ohos/keyboard.patch only while the
  framework's ArkTS bridge still drives the input method; with makepad's
  NDK input method there is no ArkTS keyboard code to patch.

Needs makepad's OpenHarmony input (mouse, keys, scroll, NDK input method)
for the desktop to take input: OctoSense-org/makepad, linked in the PR.

Checked: cargo check (octosense; octosense-home --features mobile-apps),
check-shell-graph for both, rom unittests; octosense-shell: 731 tests pass,
1 fails on this machine (its sandbox jail probe cannot start; this
branch does not touch the sandbox). Run on the MateBook from an equivalent
Linux build; build-home-ohos.py's --desktop path is unverified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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