Skip to content

feat: Huawei Watch companion, GenAI API gateway, Linux deadline widgets and feedback - #135

Closed
reisa531 wants to merge 5 commits into
HeZeBang:masterfrom
reisa531:codex/watch-feedback-upstream
Closed

reisa531 wants to merge 5 commits into
HeZeBang:masterfrom
reisa531:codex/watch-feedback-upstream

Conversation

@reisa531

@reisa531 reisa531 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds a Huawei Watch companion, a public feedback entry, a local GenAI API gateway, and Linux desktop deadline widgets with an application proxy — on one branch built on current upstream/master.

Huawei Watch companion

  • Android Wear Engine bridge (WearEngineBridge, WearReminders) with capability negotiation, receipts, account revocation and reconnect handling.
  • Lite watch companion with a five-view UI (home / ddl / account / guide / code): DDL list paging, account details, connection guide and campus QR code.
  • The watch shows account details, DDLs and binary-preserving campus QR codes; wear_qr_matrix.dart sends QR modules instead of re-encoding bytes, so the original payload survives.
  • Keeps valid QR codes visible during refresh, uses elapsed phone time between ticks, and resynchronizes forward from peer timestamps.
  • Rolls back reminder enrollment when scheduling or synchronization fails; phone-side reminders require separate consent.
  • Settings page rebuilt as a panel layout with capability-aware sections (device user, watch functions, DDL reminder switch, sync state, connection help).
  • Validates companion signing identity against the Android release workflow. Only an unsigned shareable watch build template is committed; local configured signing profiles are ignored and preserved.

GenAI API

  • GenaiGateway (664 lines) exposes an OpenAI-compatible endpoint on 127.0.0.1:5000/v1 and maps it to the campus GenAI service.
  • Supports Chat Completions and Responses APIs, SSE streaming with heartbeats, function tools, max_completion_tokens / max_output_tokens, and one retry when both content and native tool calls come back empty.
  • GenaiLogin performs the campus CAS login; the password is encrypted with AES/CBC before it leaves the device. pointycastle added for that.
  • GenaiApiPage starts/stops the gateway and shows the generated API token; --genai-api starts it at launch.
  • Request diagnostics log only identifiers, model, counts and timings — never credentials, prompts or tool results.
  • macOS release entitlements gain network.server for the loopback listener.

Linux desktop deadline widgets

  • KDE Plasma 6: resizable desktop card and compact panel button. GNOME Shell 45–51: desktop card and top-bar indicator with an expandable list.
  • Widgets read the last snapshot published by the app; they never contact campus services and receive no credentials.
  • Hidden/done state, account switching and sign-out update or clear the shared snapshot; sharing is off by default and can be turned off in Settings.
  • Cards resize to content; deadlines within 12 hours are red, 12–36 hours use the accent color.
  • install.py installs/uninstalls both widget sets per user; the release bundle carries the widgets, the installer and the project icon.
  • Adds an application proxy setting: Dart HTTP requests and the Linux login window both read it, and turning it off means a direct connection explicitly.

Linux login window

  • UniAuth on Linux now uses a GTK/WebKit window instead of the previous popup, which crashed the main process when the dialog was closed.

Other

  • Public feedback entry in Settings plus the ticket form/lookup UI, with a 15-second timeout covering fetch and JSON body reads, preserved inputs, and copy-link fallback when the browser fails to launch.
  • Portable native-source digest and Windows path checks; adaptive icon sources use the file directly because Git symlinks may arrive as text files on Windows.
  • New regression tests: test/services/wear_engine_service_test.dart, test/services/huawei_watch_page_test.dart, test/feedback_entry_test.dart, test/genai_gateway_test.dart (760 lines), plus watch/signing/feedback Node checks wired into analysis and release CI.
  • The back-navigation test scrolls the settings list before tapping View Logs, keeping all original assertions.

Validation

  • flutter analyze --no-pub: no issues.
  • flutter test --no-pub: 740 passed.
  • flutter test test/genai_gateway_test.dart --no-pub: 62 passed.
  • Node watch/signing/feedback suite: 30 passed.
  • flutter build linux --release --no-pub: succeeded.
  • tool/genai_gateway_smoke.dart: real upstream model exercised over both Chat Completions and Responses — streaming tool call, fixture return and non-streaming summary, against the dev gateway and the installed build.
  • actionlint 1.7.7: changed workflows passed.
  • Clean unsigned Lite HAP build: passed; existing developer signing profiles are preserved locally.
  • Android arm64 debug APK builds.

Known limits

  • Physical pairing with distribution-signed phone/watch artifacts, optical QR scanning and vendor notification delivery still need device acceptance.
  • GNOME 51 was checked in an isolated Shell session; other declared GNOME versions and Plasma still need native visual acceptance.
  • The feedback site's public assets are deployed by the separate feedback API project. This PR does not deploy production services.

Closes #146. Related: #147 (Linux proxy part). Supersedes #148.

monkeycode-ai Bot pushed a commit to steven42121/TechPie-RCCE that referenced this pull request Oct 26, 2026
Brings in the Wear Engine Android bridge, the Lite watch project, the wear
protocol/QR sync service and the public feedback entry from upstream PR #135.

Integration choices on this fork:
- the watch entry lives in the 穿戴设备 page (a second-level page), not in a
  new settings "Watch" section: HuaweiWatchPage is pushed from WearablesPage
  on Android, where the WearEngine service exists;
- the settings feedback entry is kept as upstream placed it;
- the merged conflicts keep the RCCE band, glance, island, keep-alive and
  spending-alert wiring next to the new wearEngineService;
- minSdk stays 27 (island requirement) over the Wear Engine floor of 23;
- the redundant androidx.work:work-runtime pin is dropped, work-runtime-ktx
  already supplies it.

Verified locally on Flutter 3.41.9: flutter analyze clean, flutter test 741
tests passing.
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
同步 GenAI2OpenAI b517039 及本地原生工具增量、空回复重试更新,补齐 Responses 工具往返和请求诊断。整合代理设置、登录窗口、截止日期状态与 Linux 发布配置。全套 740 项 Flutter 测试通过,Linux 构建及安装版 ChatGLM 工具往返通过。
@reisa531
reisa531 force-pushed the codex/watch-feedback-upstream branch from e302c50 to a3c628d Compare October 28, 2026 11:59
@reisa531 reisa531 changed the title feat: add Huawei Watch companion and feedback support feat: Huawei Watch companion, GenAI API gateway, Linux deadline widgets and feedback Oct 28, 2026
层级排序忽略最小化和隐藏窗口,在 Mutter 完成窗口排序后再放置卡片。销毁时取消待处理回调,并补充 5 项回归测试。GNOME 51 当前桌面已验证点击、拖动恢复,DING 保持启用。
@reisa531

Copy link
Copy Markdown
Contributor Author

已按模块拆分为 7 个 PR,每个 PR 只有一个提交,均基于上游 master(668465b):

已核对原 PR 的 164 个改动文件全部覆盖,并保留上游最新扫码依赖。各模块静态检查通过;组合后 740 项 Flutter 测试通过,手表 / 反馈 / GNOME 回归测试分别通过 20 / 10 / 5 项。Linux 原生模块编译检查通过。

后续审阅和合并转到上述模块 PR,本 PR 关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Linux 桌面截止日期小组件支持(KDE Plasma / GNOME)

1 participant