Skip to content

Clawbox UI - #15

Closed
yalexx wants to merge 12 commits into
feature/x64-installerfrom
clawbox-ui
Closed

yalexx wants to merge 12 commits into
feature/x64-installerfrom
clawbox-ui

Conversation

@yalexx

@yalexx yalexx commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features

    • Full desktop environment with draggable app icons, window management, wallpaper customization, and system tray
    • VNC remote desktop support with enhanced keyboard and mouse input handling
    • System update workflow with version checking and branch selection
    • GitHub CLI and AI developer tools installation
    • Power management (reboot/shutdown) with recovery flow
    • Desktop auto-login and dark theme customization options
    • Telegram configuration during setup
  • Improvements

    • Enhanced browser reliability with improved X11 display detection and process launch resilience
    • Gateway authentication now uses token-based system for improved security
    • Refined terminal server lifecycle management
  • Configuration

    • Gateway network binding and hostname configuration updates

yalexx and others added 7 commits March 18, 2026 15:50
… steps

- Move desktop UI to / as the default landing page, setup wizard at /setup
- Add Security (password/hotspot) and Telegram steps to setup wizard (6 steps total)
- Deduplicate getGatewayToken() into shared gateway-proxy module
- Update Chromium icon to proper Chromium SVG
- Parallelize browser lock file cleanup
- Move system update button from setup to settings app
- Remove stats from DoneStep (already in desktop UI)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove DoneStep from wizard — completing/skipping Telegram marks setup
  complete and redirects to desktop UI
- Setup wizard now 5 steps: WiFi, Update, Security, AI Model, Telegram
- Center setup cards vertically on desktop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s check

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add loading spinner to UpdateStep while checking for updates
- Show "System Up to Date" with green indicator when on latest version
- Fix OpenClaw version comparison (includes vs exact match)
- Fix double "v" prefix in sidebar version display
- Move update modal to top-level so it works from any settings tab
- Add Discord Community link to About section
- Use real version in About instead of hardcoded v2.2.3
- Remove /boot/efi from storage, interfaces from Network, network/processes from System
- Default wallpaper opacity to 50%

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

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (4)
  • main
  • master
  • develop
  • clawbox-*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e6bd477b-7453-4465-937d-42e5d6a322c3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR restructures the application's UI/UX architecture by moving the desktop interface from the setup page to the main page, adding desktop window management with persistent state, installing VNC remote access, GitHub CLI, and AI tools via the installer, reconfiguring gateway authentication to token-based mode, and refactoring terminal server lifecycle management.

Changes

Cohort / File(s) Summary
Configuration & Gateway
.coderabbit.yaml, config/clawbox-gateway.service, next.config.ts
Minor config updates: enabled auto-reviews for clawbox-* branches; changed gateway binding from loopback to LAN with token auth; updated allowed dev origin from IP to hostname.
Installer Steps
install.sh
Added four new installation steps (desktop customization, VNC remote access, GitHub CLI, AI tools); updated OpenClaw config to use LAN binding; added cleanup of deprecated config keys; increased total step count from 19 to 22.
Gateway & Terminal Server
scripts/gateway-pre-start.sh, scripts/terminal-server.ts, src/instrumentation.ts, src/instrumentation-node.ts, src/lib/gateway-proxy.ts
Refactored gateway pre-start config to use token-based auth; consolidated terminal server lifecycle into new instrumentation module; exported gateway token function and updated client-side script to persist connection settings to localStorage.
Setup Flow & Completion
src/app/page.tsx, src/app/route.ts, src/app/setup/page.tsx, src/components/SetupWizard.tsx, src/components/DoneStep.tsx, src/components/ProgressBar.tsx
Moved desktop UI from setup page to main page with full window/app management; removed old gateway route; simplified setup page to only render wizard; extended setup steps to include credentials, AI models, and Telegram; removed system update UI from done step.
Browser & System Management
src/app/setup-api/browser/manage/route.ts, src/app/setup-api/gateway/route.ts, src/components/BrowserApp.tsx, src/components/SystemTray.tsx, src/components/SettingsApp.tsx
Enhanced browser detection and launch with GPU/X11 flags and dynamic display selection; updated gateway route to inject token via localStorage; added reboot/shutdown flow with reconnection polling; integrated system update workflow into settings; added VNC preview button to browser app.
VNC & Component Enhancements
src/components/VNCApp.tsx, src/components/ChromeShelf.tsx, src/components/UpdateStep.tsx, src/components/Window.tsx, src/lib/updater.ts
Enhanced VNC keyboard/focus handling for better interactivity; added power button to shelf; updated update step with loading state and up-to-date detection; added window data attributes; inserted vnc_install step into update pipeline.

Sequence Diagram

sequenceDiagram
    participant Client as Browser Client
    participant SetupAPI as Setup API
    participant MainPage as Main Page (Desktop)
    participant WindowMgr as Window Manager
    participant Installer as Installer Service

    Client->>SetupAPI: GET /setup-api/setup/status
    alt Setup Incomplete
        SetupAPI-->>Client: setup_complete: false
        Client->>SetupAPI: Redirect to /setup
    else Setup Complete
        SetupAPI-->>Client: setup_complete: true
        Client->>MainPage: Render Desktop
    end

    MainPage->>SetupAPI: GET /setup-api/preferences?all=1
    SetupAPI-->>MainPage: Return saved preferences (apps, wallpaper, windows, etc.)
    MainPage->>MainPage: Restore desktop state from localStorage

    Client->>WindowMgr: Launch app (click desktop icon)
    WindowMgr->>WindowMgr: Create window, manage z-index
    WindowMgr->>MainPage: Update window state
    MainPage->>SetupAPI: POST /setup-api/preferences (debounced save)
    SetupAPI-->>MainPage: Persisted

    Client->>MainPage: Drag icon / manage desktop
    MainPage->>MainPage: Update icon grid positions
    MainPage->>SetupAPI: POST /setup-api/preferences (sync)

    alt User accesses VNC
        Client->>WindowMgr: Click VNC app
        WindowMgr->>SetupAPI: VNC window opens
        SetupAPI-->>WindowMgr: X11 stream via noVNC
    end

    alt User triggers system update
        Client->>SetupAPI: POST /setup-api/update/run
        SetupAPI->>Installer: Run update steps (including vnc_install)
        Installer-->>SetupAPI: Poll /setup-api/update/status
        SetupAPI-->>Client: Update progress
        Client->>Client: Reload on completion
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~70 minutes

Possibly related PRs

  • PR #5: Overlapping installer step additions and DISPATCH_STEPS/TOTAL_STEPS updates.
  • PR #2: Shared gateway startup and token-based authentication configuration changes.
  • PR #8: Related src/lib/updater.ts modifications for update step pipeline and version target logic.

Suggested labels

enhancement

Poem

🐰 A desktop blooms where setup once did play,
Windows dance, icons drag through the day,
VNC whispers from afar so grand,
Token gates guard with steady hand,
The clawbox leaps to life, wise and spry!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Clawbox UI' is vague and does not clearly describe the scope or main changes in this large, multi-faceted pull request. Provide a more specific and descriptive title that captures the primary change, such as 'Restructure app layout with desktop UI at root and setup wizard in /setup' or 'Add desktop OS interface and reorganize routing structure'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch clawbox-ui

Comment @coderabbitai help to get the list of available commands and usage tips.

@yalexx yalexx self-assigned this Mar 20, 2026
@github-actions

github-actions Bot commented Mar 20, 2026

Copy link
Copy Markdown

✅ Test Report

  • Result: passed

View run

@yalexx

yalexx commented Mar 20, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 20, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

yalexx and others added 5 commits March 25, 2026 09:50
- Add ChatPopup component with direct WebSocket gateway connection,
  draggable window, and HTTP-safe UUID fallback (crypto.randomUUID
  requires HTTPS secure context)
- Implement tamagotchi game engine with life stages (egg → baby →
  child → teen → adult), 4-heart hunger/happiness, discipline,
  poop/sickness mechanics, evolution tree, and hall of fame
- Refactor Mascot to use tamagotchi engine with context-sensitive
  actions (meal/snack/play/scold/medicine/lights off)
- Fix OpenClaw app: proxy through Next.js for token injection,
  auto-retry health check during gateway startup
- Fix sudo from systemd: remove NoNewPrivileges=true, add sudoers
  file for passwordless service management
- Fix power/hotspot routes: use full /usr/bin/sudo paths
- Add gateway ws-config endpoint for chat popup token retrieval
- Add temperature and GPU stats to system API
- Hide clock on mobile, anchor power menu to bottom-right

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add VNC app with noVNC integration and start-vnc script
- Add noVNC type declarations
- Refactor config-store to use SQLite (better-sqlite3)
- Simplify installer with cleaner structure
- Update ChromeWindow icon prop, credentials and reset routes
- Update updater and dependency lockfile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New ChatApp component: full-screen chat window (replaces floating popup)
  - Mascot tap opens chat as proper app window
  - Image attachment support (gallery picker + camera capture)
  - Vision attachments sent via gateway WebSocket
  - Auto-detect ws/wss protocol for HTTPS compatibility

- HTTPS support (self-signed certificate)
  - Self-signed cert at data/certs/ (10-year, clawbox.local + SANs)
  - production-server.js serves HTTPS on port 443 alongside HTTP
  - WSS proxy using ws library (bun TLS upgrade workaround)

- PWA enhancements
  - Install button in SystemTray power menu
  - Updated manifest with display_override, fullscreen support
  - Service worker v2: cache-first for assets, network-first for pages
  - Fullscreen splash on mobile browser load

- Mobile optimizations
  - Settings app: responsive sidebar → full-screen nav on mobile
  - Android back button handler (closes windows/menus)
  - Safe area insets (notch, rounded corners, taskbar)
  - Pull-to-refresh prevention (overscroll-behavior)
  - Dynamic viewport height (100dvh) for keyboard handling
  - interactive-widget: resizes-content viewport meta
  - Haptic feedback on interactions
  - Slide-up animation for mobile windows
  - Fullscreen toggle button on mobile taskbar

- Test fixes (864/864 passing)
  - gateway.test.ts: fix import path for catch-all route
  - gateway-proxy.test.ts: fix token assertion
  - openclaw-config.test.ts: update for sudo + 60s timeout
  - config-store.test.ts: align with sync fs implementation
@yalexx yalexx closed this Mar 27, 2026
@yalexx
yalexx deleted the clawbox-ui branch April 10, 2026 15:23
yalexx added a commit that referenced this pull request Sep 6, 2026
…740)

* security: close the CodeRabbit deep-scan findings that still hold on beta

The 2026-09-05 scan of main reported 23 findings; each was re-verified against
beta before anything changed. Five were already fixed on beta (#1 #2 #5 #8
#18), three are the appliance's documented design (#3 #13 #15), two need a
design decision rather than a patch (#12 the self-updating root steps, #16
system_power via the bearer) and are deferred with their designs written up.
This closes the rest:

- #21/#8: root units (clawbox-ap, ap-watchdog, the NM failover hook,
  first-boot VNC, recover) run the root-owned /usr/local/libexec/clawbox
  copies and load /etc/clawbox/network.env, never the clawbox-owned tree;
  clawbox-heartbeat runs as User=clawbox; a class-wide test pins the rule.
- #11: the Files API refuses to rename or delete a protected container
  (data/, the checkout, ~/.config, the browse root) — protected_container.
- #19: the MCP path guard judges the canonical path (nearest existing
  ancestor) as well as the typed one, and the file tools open the vetted
  target with O_NOFOLLOW.
- #17: the webapp document carries a sandbox CSP wherever it is opened
  (shipped through next.config.ts, since a route header is dropped in
  production), and installed_* preference writes are owner-only.
- #20/#22: clawkeep restore derives every destination on the box and refuses
  the manifest's before anything moves; link members must resolve inside the
  staging root; restore/unpair/snapshot/encryption/reset-state are owner-only
  and same-origin.
- #7: CF-Connecting-IP and its siblings are stripped unless the socket peer is
  loopback (cloudflared's), so a LAN client cannot pick its lockout bucket.
- #4: regex code search is gone (400 regex_unsupported).
- #6: uploads are bounded by a free-space reserve with busboy limits and
  partials unlinked; the attachments route gets the same teardown deferral.
- #14: the Kokoro/Whisper sockets are 0600 with SO_PEERCRED, and Kokoro's
  output path is confined to a .wav regular file under /tmp.
- #9 (part): the MCP server scrubs CLAWBOX_MCP_TOKEN from its environment at
  startup; allow_dangerous is documented as a typo override, not consent.
- #10: issue-triage/pr-review validate the model's JSON on both transports,
  derive labels from fixed tables and sanitise comment text.
- #23: e2e-install writes repository secrets only off pull_request events.
- #1/#5 residuals: setup/complete checks the session in-handler; the
  middleware matcher no longer skips /fonts/ and /images/.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SuyrrYnKgrUkBXECWqW1gb

* fix: vouch for the path at the two sinks CodeQL flagged

The multipart cleanup unlinked paths whose containment check governed the
write inside the promise, not the catch block; and the dangling-link resolver
lstat/readlink'd a name straight off the caller's path. Both now resolve and
prefix-check right before the call, the shape safePath already uses
(js/path-injection alerts 519-521).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SuyrrYnKgrUkBXECWqW1gb

* fix: address CodeRabbit's review of the security sweep

- e2e-install: the one job names its Environment by event (e2e-credentials
  off pull_request, an empty e2e-pull-request on one), documented for the
  owner; the schema strip for the SDK transport is schema-aware and covers
  Anthropic's whole unsupported set, and the local validator refuses any
  constraint it cannot check so no cap is silently unenforced.
- clawkeep: a Hermes sessions asset that omits sqlite still retires the
  sidecars (the box's own flag wins); OPENCLAW_STATE_DIR placeholders count as
  unset; the no-state fallback matches both CLI message forms, with one shared
  recorded-CLI fixture.
- install.sh: a libexec copy that did not land is never a success —
  collected, recorded as root_libexec, and the units that name the copies are
  not written over it.
- root-unit tests parse User= (User=root is root) and refuse /home/clawbox
  anywhere in a directive value; the code search route refuses a non-string
  pattern; notebook_edit has its symlink regression case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SuyrrYnKgrUkBXECWqW1gb

* test: give the libexec test in root-steps both ceilings

It runs install_root_libexec under a real bash, and the timeout-hygiene rule
(test-timeout-hygiene.test.ts) asks every spawning suite for a declared
testTimeout and hookTimeout — the one CI failure on the previous commit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SuyrrYnKgrUkBXECWqW1gb

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
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