diff --git a/crates/shell/Cargo.toml b/crates/shell/Cargo.toml index fe181331..5c2743bc 100644 --- a/crates/shell/Cargo.toml +++ b/crates/shell/Cargo.toml @@ -118,7 +118,7 @@ octos-core = ["octosense-ai-host/octos-core"] # assistant is the shell's (they imply `octos-core`); App Hub brings the host # services its system apps call. AppCard is opt-in only, on every target. # BEGIN native-apps: features (generated by tools/native_apps.py from native-apps.json; do not edit) -mobile-apps = ["app-rinx", "app-reference", "app-sheets", "app-hub", "octos-core"] +mobile-apps = ["app-rinx", "app-reference", "app-sheets", "app-hub", "app-calculator", "app-clock", "app-notes", "app-reminders", "app-weather", "octos-core"] app-rinx = ["dep:rinx", "octos-core"] app-reference = ["dep:octosense-reference"] app-sheets = ["dep:makepad-sheets"] diff --git a/crates/shell/src/lib.rs b/crates/shell/src/lib.rs index 24c2263a..0e50e646 100644 --- a/crates/shell/src/lib.rs +++ b/crates/shell/src/lib.rs @@ -5363,6 +5363,18 @@ impl App { i += 2; continue; } + // style:: switch to that phone shell first, + // so a later launch- opens the app at a phone's + // size (an app's phone layout, checked on a desktop). + if let Some(style) = name.strip_prefix("style:") { + match style.trim() { + "android" => self.set_desktop_style(cx, desktop::DesktopStyle::Android), + "ios" => self.set_desktop_style(cx, desktop::DesktopStyle::Ios), + other => log!("wm: --test-action style: no phone style {other:?} (android or ios)"), + } + i += 2; + continue; + } // shade:: open the shade on that // side (switching to the Android phone shell first when // the desk is up), for scripted screenshots. diff --git a/desktop/README.md b/desktop/README.md index 8178c02e..b3f3715b 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -281,7 +281,7 @@ Open **App Hub**, choose the app, **Get**, scroll to **Install**, then **Open**: ### Developer programs and the catalog -`config/apps.json` lists Reference and the Makepad apps OctoSense picked (Browser, Files, Task, Terminal, Sheets, Clock, Weather, Finance, Notes, Reminders, Calculator, Route, and the Image and PDF viewers). Calculator, Clock, Notes, Reminders and Weather are native apps ([`../native-apps.json`](../native-apps.json)): linked by default and opened in-process, with their read tools offered to the system agent while they are open. Task is a native app that runs only as its own process (`"module": null`), sandboxed. Terminal is also linked (`app-terminal`, on by default); its `config/apps.json` row is the process form it opens in on macOS and Windows, and the linked module is the in-process form. The `aichat` row is the assistant pane's own process (F10), which the pane starts; no list shows it. A launcher row whose id is listed in `wm/launcher.hides` under the state directory is hidden. +`config/apps.json` lists Reference and the Makepad apps OctoSense picked (Browser, Files, Task, Terminal, Sheets, Clock, Weather, Finance, Notes, Reminders, Calculator, Route, and the Image and PDF viewers). Calculator, Clock, Notes, Reminders and Weather are native apps ([`../native-apps.json`](../native-apps.json)): linked by default and opened in-process, on the desktop and on the phone, with their read tools offered to the system agent while they are open. Task is a native app that runs only as its own process (`"module": null`), sandboxed. Terminal is also linked (`app-terminal`, on by default); its `config/apps.json` row is the process form it opens in on macOS and Windows, and the linked module is the in-process form. The `aichat` row is the assistant pane's own process (F10), which the pane starts; no list shows it. A launcher row whose id is listed in `wm/launcher.hides` under the state directory is hidden. Catalog lookup: `--apps ` if given, else `~/.octosense/apps.json` if it exists, else `config/apps.json`. A catalog is a JSON array; each entry picks one launch target: diff --git a/desktop/README.zh-CN.md b/desktop/README.zh-CN.md index dac37377..09d0d6df 100644 --- a/desktop/README.zh-CN.md +++ b/desktop/README.zh-CN.md @@ -278,7 +278,7 @@ OCTOSENSE_HUB= OCTOSENSE_HUB_ANCHOR= \ ### 开发者程序与目录 -`config/apps.json` 列出 Reference 和 OctoSense 挑选的 Makepad 应用(Browser、Files、Task、Terminal、Sheets、Clock、Weather、Finance、Notes、Reminders、Calculator、Route,以及 Image 和 PDF 查看器)。Calculator、Clock、Notes、Reminders 和 Weather 是原生应用([`../native-apps.json`](../native-apps.json)):默认链接、在进程内打开,打开期间它们的只读工具提供给系统 Agent。Task 是只作为独立进程运行的原生应用(`"module": null`),在沙箱中运行。Terminal 同时以链接方式提供(`app-terminal`,默认开启);它在 `config/apps.json` 中的条目是它在 macOS 和 Windows 上使用的独立进程形式,链接的模块是进程内形式。`aichat` 条目是助手面板自己的进程(F10),由面板启动;任何列表都不显示它。id 写在状态目录下 `wm/launcher.hides` 中的 launcher 条目会被隐藏。 +`config/apps.json` 列出 Reference 和 OctoSense 挑选的 Makepad 应用(Browser、Files、Task、Terminal、Sheets、Clock、Weather、Finance、Notes、Reminders、Calculator、Route,以及 Image 和 PDF 查看器)。Calculator、Clock、Notes、Reminders 和 Weather 是原生应用([`../native-apps.json`](../native-apps.json)):在桌面端和手机上都默认链接、在进程内打开,打开期间它们的只读工具提供给系统 Agent。Task 是只作为独立进程运行的原生应用(`"module": null`),在沙箱中运行。Terminal 同时以链接方式提供(`app-terminal`,默认开启);它在 `config/apps.json` 中的条目是它在 macOS 和 Windows 上使用的独立进程形式,链接的模块是进程内形式。`aichat` 条目是助手面板自己的进程(F10),由面板启动;任何列表都不显示它。id 写在状态目录下 `wm/launcher.hides` 中的 launcher 条目会被隐藏。 目录查找顺序:给了 `--apps ` 就用它;否则若存在 `~/.octosense/apps.json` 就用它;否则用 `config/apps.json`。目录是一个 JSON 数组,每个条目选择一种启动目标: diff --git a/native-apps.json b/native-apps.json index 07ac1c96..afdba8f1 100644 --- a/native-apps.json +++ b/native-apps.json @@ -123,7 +123,7 @@ "crate_features": [], "implies": [], "hosting": { "macos": "module", "windows": "module", "linux": "module", "android": "module", "ios": "module", "ohos": "module" }, - "shells": { "desktop": "default", "phone": "off" }, + "shells": { "desktop": "default", "phone": "default" }, "native_mobile": "feature", "sandbox": { "network": "none", "processes": false }, "storage": { "accounts": false, "agent_workspace": "none", "external": [] }, @@ -146,7 +146,7 @@ "crate_features": [], "implies": [], "hosting": { "macos": "module", "windows": "module", "linux": "module", "android": "module", "ios": "module", "ohos": "module" }, - "shells": { "desktop": "default", "phone": "off" }, + "shells": { "desktop": "default", "phone": "default" }, "native_mobile": "feature", "sandbox": { "network": "none", "processes": false }, "storage": { "accounts": false, "agent_workspace": "none", "external": [] }, @@ -169,7 +169,7 @@ "crate_features": [], "implies": [], "hosting": { "macos": "module", "windows": "module", "linux": "module", "android": "module", "ios": "module", "ohos": "module" }, - "shells": { "desktop": "default", "phone": "off" }, + "shells": { "desktop": "default", "phone": "default" }, "native_mobile": "feature", "sandbox": { "network": "none", "processes": false }, "storage": { "accounts": false, "agent_workspace": "none", "external": [] }, @@ -193,7 +193,7 @@ "crate_features": [], "implies": [], "hosting": { "macos": "module", "windows": "module", "linux": "module", "android": "module", "ios": "module", "ohos": "module" }, - "shells": { "desktop": "default", "phone": "off" }, + "shells": { "desktop": "default", "phone": "default" }, "native_mobile": "feature", "sandbox": { "network": "none", "processes": false }, "storage": { "accounts": false, "agent_workspace": "none", "external": [] }, @@ -217,7 +217,7 @@ "crate_features": [], "implies": [], "hosting": { "macos": "module", "windows": "module", "linux": "module", "android": "module", "ios": "module", "ohos": "module" }, - "shells": { "desktop": "default", "phone": "off" }, + "shells": { "desktop": "default", "phone": "default" }, "native_mobile": "feature", "sandbox": { "network": "any", "processes": false }, "storage": { "accounts": false, "agent_workspace": "none", "external": [] }, diff --git a/phone/Cargo.toml b/phone/Cargo.toml index 1a104d88..6165a6d5 100644 --- a/phone/Cargo.toml +++ b/phone/Cargo.toml @@ -80,13 +80,18 @@ octos-core = ["octosense-shell/octos-core"] # phone builds link, also usable on a desktop; AppCard is not among them # (`--features app-appcard`). # BEGIN native-apps: features (generated by tools/native_apps.py from native-apps.json; do not edit) -default = ["octos-core", "toolbox-peers", "app-rinx", "app-hub"] +default = ["octos-core", "toolbox-peers", "app-rinx", "app-hub", "app-calculator", "app-clock", "app-notes", "app-reminders", "app-weather"] mobile-apps = ["app-reference", "app-hub", "octosense-shell/mobile-apps"] app-rinx = ["octosense-shell/app-rinx"] app-reference = ["dep:octosense-reference", "octosense-shell/app-reference"] app-sheets = ["octosense-shell/app-sheets"] app-appcard = ["octosense-shell/app-appcard"] app-hub = ["dep:octosense-app-hub-app", "octosense-shell/app-hub"] +app-calculator = ["octosense-shell/app-calculator"] +app-clock = ["octosense-shell/app-clock"] +app-notes = ["octosense-shell/app-notes"] +app-reminders = ["octosense-shell/app-reminders"] +app-weather = ["octosense-shell/app-weather"] # END native-apps: features app-aichat = ["dep:makepad-aichat", "octosense-shell/app-aichat"] dev-mode = ["octosense-shell/dev-mode"] diff --git a/phone/README.md b/phone/README.md index 7d4876c3..211b7491 100644 --- a/phone/README.md +++ b/phone/README.md @@ -10,8 +10,9 @@ The OctoSense phone shell: a Makepad app that is the device's Home screen. Home pages with live tiles and app pairs, a gesture layer, the shade (notifications left, controls right), Recents, a live island for ongoing activities, and hosted apps drawn in-process inside its tiles: App Hub and -the apps it runs, the system apps, Reference and Sheets, and the octos agent -kernel as a service. (AppCard is not shipped for now; it links only with +the apps it runs, the system apps, Reference and Sheets, the Makepad apps +Calculator, Clock, Notes, Reminders and Weather (each with its own agent), +and the octos agent kernel as a service. (AppCard is not shipped for now; it links only with `--features app-appcard`.) Home is one of the three products in this repository (the diff --git a/phone/README.zh-CN.md b/phone/README.zh-CN.md index 682632f2..722a1059 100644 --- a/phone/README.zh-CN.md +++ b/phone/README.zh-CN.md @@ -6,7 +6,7 @@ > **在整个系统中的位置。**在手机上,OctoSense 托管的原生模块和脚本应用在 Home 进程内运行(不使用桌面式进程托管);普通 Android 应用仍在各自的 Android 进程中运行。octos 内核在 Android 上是 APK 中作为子进程运行的 `liboctos.so`,在 OpenHarmony 上是进程内的任务,在 iOS 上没有。应用仍然只能通过 Shell 使用自己的 Agent。进程、应用 Agent 的两条通道以及一次带审批的工具调用的图示:[整体如何运作](../README.zh-CN.md#整体如何运作);详细说明:[docs/architecture.zh-CN.md](../docs/architecture.zh-CN.md) 和 [ADR 0004(英文)](../docs/adr/0004-native-apps-hosting-and-peers.md)。 -OctoSense 手机 Shell:一个 Makepad 应用,也就是设备的桌面。它包括带实时磁贴和应用组合的桌面页面、手势层、通知面板(左侧通知,右侧控制)、最近任务、用于展示进行中活动的实时岛,以及在进程内绘制于磁贴中的托管应用:App Hub 及其运行的应用、系统应用、Reference 和 Sheets,另外还有作为服务的 octos Agent 内核。(AppCard 目前不随产品发布,只有使用 `--features app-appcard` 时才会链接。) +OctoSense 手机 Shell:一个 Makepad 应用,也就是设备的桌面。它包括带实时磁贴和应用组合的桌面页面、手势层、通知面板(左侧通知,右侧控制)、最近任务、用于展示进行中活动的实时岛,以及在进程内绘制于磁贴中的托管应用:App Hub 及其运行的应用、系统应用、Reference 和 Sheets、Makepad 应用 Calculator、Clock、Notes、Reminders 和 Weather(各自有自己的 Agent),另外还有作为服务的 octos Agent 内核。(AppCard 目前不随产品发布,只有使用 `--features app-appcard` 时才会链接。) Home 是本仓库的三个产品之一(环境准备、目录结构和 CI 见[根目录 README](../README.zh-CN.md))。把它与具有特权的系统部分一起预装的 ROM 镜像位于 [`rom/`](../rom/README.zh-CN.md)。 diff --git a/runtime-patches.lock.json b/runtime-patches.lock.json index ea4b4967..be249908 100644 --- a/runtime-patches.lock.json +++ b/runtime-patches.lock.json @@ -4,7 +4,7 @@ "base_revision": "c155f61d0e1600d2ec474209374444a38a09a470", "patch": "tools/runtime-patches/makepad-settings.patch", "sha256": "b17352ebf59e50ab3db6ff1cb825c4e006bcdff47d83522e372b8fe585e57570", - "tree": "7e7a9c13450eacf7f7fa8377078d71e07eca764b", + "tree": "47a8b47dfc84fb95517aeb6f5f911cb526bbf2dd", "product_fixes": [ "Settings integration: Android IME synchronization, accessibility and reduced motion, GLES program-cache validation, obscured-gesture cancellation and scroll-position observation.", "Contained-app isolation and secret-input restrictions come from the pinned upstream runtime; the Settings overlay preserves those gates.", @@ -12,7 +12,8 @@ "A cancelled search's keyboard hides once: an editor session going inactive retires its input connection without restarting input, which brought the keyboard back empty while it was hiding (Android 11).", "Windows remote grabs send raw RGBA pixels to the bounded PNG worker before presenting, keeping full-size encoding off the UI thread and scaling before encoding.", "Windows frame completion: backport Makepad work c508ab0c8 GPU completion polls around native and hosted repaint so upload buffers can retire.", - "Android application extensions honor the manifest's explicit class name, keeping Back and platform integration active under custom test package ids." + "Android application extensions honor the manifest's explicit class name, keeping Back and platform integration active under custom test package ids.", + "Calculator lays its keypad out again after every apply (makepad #99): the phone shell's style reapply after a hosted module's first frame left the DSL's 85-point keys, overflowing a 393-point-wide phone." ], "stacked": [ { @@ -34,6 +35,10 @@ { "patch": "tools/runtime-patches/makepad-application-extension.patch", "sha256": "133099ee598a9794ec5df61dfbef30bca25df7bc03a66deecdb66355a8b8e6bf" + }, + { + "patch": "tools/runtime-patches/makepad-calculator-restyle.patch", + "sha256": "24896908d7b5616dd2ccd6c6fc56e8776cd8cc9a1e3750e8fefba7ea569dc8af" } ] } diff --git a/tools/runtime-patches/makepad-calculator-restyle.patch b/tools/runtime-patches/makepad-calculator-restyle.patch new file mode 100644 index 00000000..bf81d922 --- /dev/null +++ b/tools/runtime-patches/makepad-calculator-restyle.patch @@ -0,0 +1,29 @@ +diff --git a/apps/calculator/src/view.rs b/apps/calculator/src/view.rs +index 6f5b2c0da..931c2e367 100644 +--- a/apps/calculator/src/view.rs ++++ b/apps/calculator/src/view.rs +@@ -453,7 +453,7 @@ + + const STORAGE_KEY: &str = "calculator.json"; + +-#[derive(Script, ScriptHook, Widget)] ++#[derive(Script, Widget)] + pub struct CalculatorView { + #[deref] + view: View, +@@ -495,6 +495,15 @@ pub struct CalculatorView { + chrome_gen: u64, + } + ++impl ScriptHook for CalculatorView { ++ /// Every apply (the first, a hot reload, a host's style reapply) writes ++ /// the DSL's sizes back over the keypad: the next draw lays it out for ++ /// its size again instead of trusting the layout it applied before. ++ fn on_after_apply(&mut self, _vm: &mut ScriptVm, _apply: &Apply, _scope: &mut Scope, _value: ScriptValue) { ++ self.last_layout = None; ++ } ++} ++ + impl CalculatorView { + pub fn set_storage(&mut self, storage: StorageHandle) { + self.storage = Some(storage);