Skip to content

Add viewport-aware UI and ESP32-S3 support - #18

Merged
siwei-yuan merged 7 commits into
pocket-stack:mainfrom
siwei-yuan:codex/s3-viewport-support
Aug 22, 2026
Merged

Add viewport-aware UI and ESP32-S3 support#18
siwei-yuan merged 7 commits into
pocket-stack:mainfrom
siwei-yuan:codex/s3-viewport-support

Conversation

@siwei-yuan

Copy link
Copy Markdown
Collaborator

Summary

This PR contains two changes:

  1. Make Pocket Pi Views adapt to the logical viewport reported by each host.
  2. Add the Waveshare ESP32-S3-Touch-LCD-4.3 firmware host.

Viewport-aware UI

  • Pass one positive host Viewport through AppSupervisor to every System and ordinary App View Guest.
  • Expose the immutable viewport through View SDK API 2.
  • Scale geometry from the portrait and landscape reference canvases while keeping fixed readable font slots and physical touch minimums.
  • Move reusable navigation, scroll, action-button and sparkline geometry into the shared View SDK.
  • Update Pi Agent, Exa and Robinhood to use the same viewport-aware SDK without board-specific App forks.
  • Let the simulator accept arbitrary WIDTHxHEIGHT viewports for UI validation.

ESP32-S3 firmware

  • Add a board host for the 800x480 RGB panel with a rotated 480x800 logical viewport, GT911 touch and integrated Wi-Fi.
  • Keep the shared AgentOS host loop, storage, transport and App lifecycle in firmware/esp32-common.
  • Use PocketJS retained damage rendering, two PSRAM framebuffers, frame-complete presentation and board-local RGB565 rotation.
  • Keep QuickJS heaps and large workers in PSRAM while reserving internal RAM for the runtime task and render stripe.
  • Add reproducible ESP-IDF component locks, flash layout and one cargo xtask build entry.
  • Keep the BSP limited to panel, touch, backlight and flash-dispatcher mechanisms; no LVGL runtime is included.

Validation

  • cargo fmt checks
  • git diff --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo build --workspace --all-targets
  • cargo test --workspace: 54 passed
  • bun test apps/pi-agent/text.test.js: 3 passed, 18 assertions
  • cargo xtask build esp32-p4-sim
  • cargo xtask build esp32-p4
  • cargo xtask build esp32-s3
  • Shell syntax checks for the ESP32-S3 compiler wrappers

Physical ESP32-S3 validation covers boot, 480x800 scanout, GT911 touch, integrated Wi-Fi, workspace Tool Calls, ordinary App installation and an Exa request. Long-running latency, display stability and memory-pressure testing remain separate physical acceptance work.

Architecture

ESP32-P4 remains the reference target. ESP32-P4 and ESP32-S3 share the same AgentOS, App sources, View SDK and runtime mechanisms; only their board adapters, viewport, display path, touch mapping and Wi-Fi hardware differ.

@siwei-yuan
siwei-yuan merged commit a70ab67 into pocket-stack:main Aug 22, 2026
1 check passed
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