Skip to content

Add mobile browser remote control page for robot commands#2

Draft
borntoleave wants to merge 16 commits intomobilefrom
cursor/-bc-2cdede46-bce3-4ede-ad41-065b1fb7b334-7d8b
Draft

Add mobile browser remote control page for robot commands#2
borntoleave wants to merge 16 commits intomobilefrom
cursor/-bc-2cdede46-bce3-4ede-ad41-065b1fb7b334-7d8b

Conversation

@borntoleave
Copy link
Copy Markdown
Contributor

@borntoleave borntoleave commented Mar 19, 2026

Summary

  • add a new mobile_remote.html page for phone-based robot control
  • support both Bluetooth serial (Web Serial) and Wi-Fi (ws://<ip>:81) connections in the browser
  • redesign Drive Control to joystick-only (remove duplicate direction buttons)
  • add two concentric joystick rings and apply gait tiers:
    • inner ring (forward/left/right): walk gaits (kwkF/kwkL/kwkR)
    • outer ring forward: trot gait (ktrF)
    • outer ring left/right: in-place rotation (kvtL / kvtR)
    • backward remains unchanged (kbkF)
    • joystick release now sends kup (stand) instead of d
  • fix joystick reset centering by switching knob to center-anchor positioning with offset variables, so release returns to true concentric center
  • replace separate “Raw Command” and “Token Encode” blocks with one unified command sender:
    • selectable payload mode: ASCII text or binary numeric bytes
    • supports token-optional direct send, and token-aware encoding following Web Coding Blocks rules (encodeCommand)
    • ASCII payload can be converted to byte values for uppercase-token binary framing
    • in binary mode, alphabetic payload characters are converted to ASCII byte values automatically (e.g. a -> 97, abc -> 97 98 99)
  • update index.html to include a new entry link to the controller page with zh/en/ja labels
  • rename index entry text from Petoi Remote Controller to Petoi Web Controller (Under construction) and sync translated labels
  • stack the two portal entry buttons vertically so they always appear on separate lines
  • add Web Bluetooth (BLE) fallback when Web Serial is unavailable on mobile browsers
  • support BLE characteristic discovery (Nordic UART / HM-10 style + writable/notify fallback scanning)
  • add BLE send path into transport priority (serial -> ble -> wifi) and BLE notify log output
  • improve Wi-Fi connect UX on iOS/mobile: default IP value, explicit empty-IP prompt, visible connecting/failure feedback, HTTPS mixed-content hint, and saved last IP restore
  • show immediate Wi-Fi status line updates on connect attempt/failure and trigger explicit iOS HTTPS warning alert for private IPv4 targets
  • remove the quick action Clap button from the mobile remote control panel
  • when HTTPS blocks insecure ws:// connection (mixed content / insecure WebSocket), show a local-version download dialog with direct link to releases
  • add GA4 tracking snippet to mobile_remote.html with the same tracking ID (G-6XRBBDPBJS) used by other pages
  • rename controller page title/heading to Petoi Web Controller and remove phone/mobile wording in page copy
  • update index zh description text by removing the 打开 Blockly 工作区, prefix as requested
  • add Petoi cat-head logo favicon links to mobile_remote.html tab icon (assets/logo.svg)
  • standardize favicon declarations in index.html, main.html, and help.html using the same 3-link set (icon/shortcut icon/apple-touch-icon)
  • add adaptive mobile layout rules for main.html:
    • auto-detect mobile-like touch viewport and switch layout by screen tier (compact/small/regular)
    • auto-apply portrait vs landscape layout classes for Blockly area and side panels
    • optimize mobile spacing, button sizing, and scroll behavior for console/serial panes
    • keep toolbox and workspace usable on small screens with tuned min-height/width proportions
    • hide top draggable splitters in mobile mode and keep desktop behavior unchanged
    • add orientation guidance hint (recommend landscape in portrait)
  • convert primary action buttons to icon-only in mobile mode with long-press tooltip labels:
    • run/stop/save/load/upload/show-code/generate-log/clear/quick-connect buttons now have icon metadata
    • long press (touch hold) shows translated action text tooltip without affecting click behavior
    • language switch and quick-connect state changes now re-apply icon/text mapping safely

Testing

  • parsed inline script syntax for mobile_remote.html with Node (new Function(...))
  • parsed inline script syntax for index.html with Node (new Function(...))
  • re-validated script syntax after BLE fallback and Wi-Fi UX updates
  • re-validated script syntax after local-version download dialog additions
  • re-validated script syntax after joystick redesign and unified command sender changes
  • re-validated script syntax after joystick recentering and outer-ring rotate mapping changes
  • re-validated script syntax after changing joystick release command to kup
  • re-validated script syntax after binary alphabet-to-ASCII payload parsing changes
  • re-validated script syntax after GA4 snippet insertion
  • re-validated script syntax after controller naming and copy updates
  • re-validated script syntax after index entry rename to Web Controller
  • re-validated script syntax after favicon link insertion
  • parsed inline script syntax for index.html, main.html, help.html, and mobile_remote.html after favicon standardization
  • parsed inline script syntax for updated main.html after adaptive mobile layout changes
  • verified adaptive CSS block exists in styles.css
  • manually reviewed diffs for language switch and route wiring

Notes

  • command transport priority in remote page: Bluetooth serial first, then BLE, then Wi-Fi when Bluetooth is not connected
  • if browser supports neither Web Serial nor Web Bluetooth, UI now shows a clearer fallback message to use Wi-Fi
  • mobile layout adaptation is rule-based and reversible on resize/orientation changes; desktop behavior remains default
Open in Web Open in Cursor 

cursoragent and others added 2 commits March 19, 2026 10:03
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
cursoragent and others added 2 commits March 19, 2026 10:55
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
cursoragent and others added 2 commits March 20, 2026 12:21
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
Co-authored-by: Rongzhong Li <rzlib2l@gmail.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying petoiwebcoding with  Cloudflare Pages  Cloudflare Pages

Latest commit: 85a6d5f
Status: ✅  Deploy successful!
Preview URL: https://e1b2735f.petoiwebcoding.pages.dev

View logs

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.

2 participants