feat(desktop): polish desktop shell and shared WebUI surfaces (#4195)
* feat(desktop): add native host scaffold * feat(webui): track turns and usage in gateway * feat(webui): polish desktop chat experience * feat(apps): add ArcGIS and Joplin logos * feat(desktop): polish shell and shared surfaces * fix(webui): avoid preview chips for glob references * test: align CI expectations for token fallback * feat(webui): preview prompt rail entries * feat(webui): add prompt navigator drawer * style(webui): refine prompt navigator placement * style(webui): align prompt navigator with header actions * style(webui): simplify prompt navigator header * refactor(webui): clean thread resource refresh * feat(desktop): add native reply notifications * fix(webui): preserve desktop restart and replay state * fix(desktop): harden gateway proxy startup * fix(web): fall back when readability is unavailable * fix(desktop): hide window instead of closing on macos * fix(webui): unify desktop header actions * fix(webui): simplify prompt history rows * fix(desktop): log notification delivery failures * chore(desktop): clean source package artifacts * fix(cron): support one-time relative reminders * fix(webui): reveal scroll button in place * Revert "fix(cron): support one-time relative reminders" This reverts commit 4c4661da120a3c7283e0768412bae48604e7390b. * refactor(webui): extract token usage heatmap * docs(desktop): clarify contributor guides --------- Co-authored-by: chengyongru <2755839590@qq.com>
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
# WebUI Sync Workflow
|
||||
|
||||
This workflow is for contributors keeping the desktop app and browser WebUI in
|
||||
sync. Users should experience them as one product surface: desktop adds a native
|
||||
host and local engine lifecycle, while chat, settings, apps, skills, and
|
||||
workspace UI still come from the shared WebUI.
|
||||
|
||||
`desktop` consumes the shared WebUI build output. It must not copy, fork, or
|
||||
vendor `webui/src`.
|
||||
|
||||
## Development
|
||||
|
||||
Run the WebUI dev server:
|
||||
|
||||
```sh
|
||||
cd desktop
|
||||
bun run dev:webui
|
||||
```
|
||||
|
||||
Run the native host in another terminal:
|
||||
|
||||
```sh
|
||||
cd desktop
|
||||
bun run dev:app
|
||||
```
|
||||
|
||||
The host loads `http://127.0.0.1:5173` in development, so React changes hot
|
||||
reload. Main/preload changes still require restarting `dev:app`.
|
||||
|
||||
## Release Build
|
||||
|
||||
1. Build the shared WebUI:
|
||||
|
||||
```sh
|
||||
bun run build --prefix webui
|
||||
```
|
||||
|
||||
2. Prepare the bundled Python engine:
|
||||
|
||||
```sh
|
||||
cd desktop
|
||||
NANOBOT_DESKTOP_ARCH=arm64 bun run prepare-engine
|
||||
```
|
||||
|
||||
3. Build the app:
|
||||
|
||||
```sh
|
||||
bun run make:mac:arm64
|
||||
bun run make:mac:x64
|
||||
```
|
||||
|
||||
`electron-builder` packages `nanobot/web/dist` as `Resources/nanobot-webui`.
|
||||
|
||||
## Checklist
|
||||
|
||||
- WebUI source remains host-neutral: it may branch on generic runtime
|
||||
capabilities, but it must not import Electron or desktop source files.
|
||||
|
||||
```sh
|
||||
rg -n "from ['\\\"]electron|desktop/src|nanobotDesktop" webui/src
|
||||
```
|
||||
|
||||
This command should print nothing.
|
||||
|
||||
- Native host behavior is implemented in `desktop/src`.
|
||||
- Provider, model, credential, and login setup stay in shared WebUI settings.
|
||||
Do not duplicate those flows in Electron-owned HTML.
|
||||
- Shared UI behavior is implemented in `webui/src` through `window.nanobotHost`
|
||||
and generic runtime capability checks.
|
||||
- Do not copy React components from `webui/src` into this folder.
|
||||
- Do not commit bundled runtimes, DMGs, or `node_modules`.
|
||||
Reference in New Issue
Block a user