Skip to content

feat(ai-ui): add guided WeChat UI - #711

Open
jianning773 wants to merge 1 commit into
tuya:masterfrom
jianning773:feature/guided-wechat-ui
Open

jianning773 wants to merge 1 commit into
tuya:masterfrom
jianning773:feature/guided-wechat-ui

Conversation

@jianning773

Copy link
Copy Markdown
Contributor

Overview

This PR adds an SDK-native Guided WeChat UI for the your_chat_bot application on T5AI touch-screen boards.

The new UI combines the existing WeChat-style chat experience with a guided first-run flow for language selection, device authorization, and network configuration.

New Features

Guided onboarding flow

  • Add a three-step onboarding flow:
    1. Language
    2. Authorization
    3. Network connection
  • Support switching between Chinese and English.
  • Display localized status messages and chat mode names.
  • Show the correct state when the device is not authorized.
  • Display “Waiting for device authorization” instead of “Waiting for phone network configuration” when authorization is missing.
  • Add refresh and retry actions for authorization and network states.
  • Add device settings, language selection, about, and reset/re-provision pages.

Authorization status and device information

  • Read and display the device authorization state.
  • Support authorization information from:
    • SDK authorization storage
    • Compiled Tuya client configuration as fallback
  • Mask UUID and AuthKey values before displaying them.
  • Display device ID, product ID, firmware version, SDK version, current network, activation state, and cloud connection state.
  • Track the pairing lifecycle through:
    • TUYA_EVENT_BIND_START
    • TUYA_EVENT_BIND_TOKEN_ON
    • TUYA_EVENT_MQTT_CONNECTED
    • TUYA_EVENT_RESET

Localized QR-code guidance

  • Add LVGL QR-code support.
  • Show an authorization help QR code when the device is unauthorized:
    • English: https://tuyaopen.ai/pricing
    • Chinese: https://tuyaopen.ai/zh/pricing
  • Show localized network-configuration help QR codes on the network page.

WeChat-style chat UI

  • Add a complete Guided WeChat chat page.
  • Add localized status-bar text for standby, listening, speaking, and uploading states.
  • Add localized chat-mode names:
    • Hold to talk
    • Push to talk
    • Wake word
    • Free talk
  • Add language refresh support so the current UI state is re-rendered after changing language.
  • Unify the bottom-left and bottom-right action button shadow and pressed-state behavior.

Camera and image functions

When the corresponding camera/image components are enabled, the new UI supports:

  • Opening the camera from the chat page.
  • Live camera preview.
  • Taking photos.
  • Camera thumbnail preview.
  • AI vision enable/disable control.
  • Opening the image album.
  • Browsing images with previous/next gestures.
  • Viewing a single image.
  • Selecting images for chat attachments.
  • Batch image selection and deletion.
  • Image deletion.
  • Optional printer actions when printer support is enabled.
  • Image attachment list management.

SDK and configuration changes

  • Add the new guided_wechat UI module.
  • Add Guided WeChat UI registration to ai_chat_ui.c.
  • Keep the existing WeChat, Chatbot, and OLED UI options available.
  • Add CONFIG_ENABLE_AI_CHAT_GUI_GUIDED_WECHAT.
  • Add CONFIG_LV_USE_QRCODE.
  • Add the Guided UI configuration to the following T5AI touch-screen profiles:
    • TUYA_T5AI_BOARD_LCD_3.5.config
    • TUYA_T5AI_BOARD_LCD_3.5_CAMERA.config
    • TUYA_T5AI_BOARD_LCD_3.5_CAM_PRINTER.config
    • TUYA_T5AI_BOARD_LCD_3.5_WITH_L511.config
    • TUYA_T5AI_BOARD_LCD_3.5_v101.config
  • Keep app_default.config unchanged.

Expected Impact

  • The Guided WeChat UI is enabled only when
    CONFIG_ENABLE_AI_CHAT_GUI_GUIDED_WECHAT=y is selected.
  • The change is primarily scoped to the your_chat_bot application and T5AI touch-screen board profiles.
  • Existing WeChat, Chatbot, and OLED UI configurations remain available.
  • Existing applications that do not select the new configuration should not enter the Guided UI code path.
  • Camera and album code remain conditionally compiled based on the existing camera, picture, album, and printer configuration options.
  • Guided UI builds will increase firmware size and resource usage because they include additional onboarding, QR-code, camera, and album pages.
  • The T5AI target build completed successfully with the new configuration enabled.

Validation

  • Ran a full clean with tos.py clean -f.
  • Regenerated using.cmake, tuya_kconfig.h, and related build files.
  • Confirmed the generated configuration enables:
    • ENABLE_AI_CHAT_GUI_GUIDED_WECHAT
    • ENABLE_COMP_AI_VIDEO
    • ENABLE_COMP_AI_PICTURE
    • ENABLE_IMAGE_ALBUM
    • LV_USE_QRCODE
  • Rebuilt the T5AI CP/AP firmware successfully.
  • Flashed the resulting firmware to T5AI hardware.
  • Confirmed the device rebooted and the your_chat_bot application started normally.

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