Skip to content

feat(desktop): wire new HTML HUD into FaceWindow + auto-open shortcut support - #546

Draft
andresnunes1404 wants to merge 4 commits into
isair:developfrom
andresnunes1404:worktree-jarvis-hud-shortcut
Draft

feat(desktop): wire new HTML HUD into FaceWindow + auto-open shortcut support#546
andresnunes1404 wants to merge 4 commits into
isair:developfrom
andresnunes1404:worktree-jarvis-hud-shortcut

Conversation

@andresnunes1404

@andresnunes1404 andresnunes1404 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wires the new HTML/JS HUD: desktop_assets/face_hud.html ("Jarvis HUD v6.4") existed in the repo but nothing loaded it — the tray's Face window still showed the old painted LowPolyFaceWidget. Adds HudFaceWindow (src/desktop_app/hud_window.py), which hosts face_hud.html in a QWebEngineView and drives its existing JS hooks with real data:
    • window.setJarvisState(state) — polled from the real JarvisStateManager every 300ms (polling, not just the Qt signal, because in dev mode the daemon is a separate process and only shares state via its cross-process state file)
    • window.addJarvisLogLine(line) — wired to the same log_signals.new_log stream LogViewerWindow already gets from the daemon, so the HUD's "REGISTO DO SISTEMA" panel shows genuine debug_log lines
    • window.playJarvisAudio (audio-reactive visualization) is left unwired — needs new cross-process IPC to ship TTS audio from the daemon subprocess to the desktop app, a separate larger piece of work
    • Falls back to the original LowPolyFaceWidget when QtWebEngine isn't available
  • Auto-open the HUD on startup: JARVIS_SHOW_HUD=1 env var (mirrors JARVIS_VOICE_DEBUG) makes the tray auto-open the HUD right after the tray icon shows. Exposed as --hud on scripts/run_desktop_app.bat, so a desktop shortcut can launch straight into it.
  • Bugfix: run_desktop_app.bat resolved PROJECT_ROOT from %~dp0 after the argument-parsing loop's shift had already run. cmd.exe's %~dp0 stops reflecting the script's own folder once any shift has executed in the same invocation, so passing any flag (--voice-debug, or the new --hud) from a different working directory (e.g. a desktop shortcut) silently resolved the wrong project root and failed with "Mamba environment not found". Fixed by resolving PROJECT_ROOT at the very top of the script, before any shift.
  • Documents HudFaceWindow in desktop_app.spec.md.

Test plan

  • pytest tests/test_desktop_app.py tests/test_face_widget.py tests/test_hud_window.py -q (83 passed)
  • New TestShouldShowHudOnStartup covers the JARVIS_SHOW_HUD env var gate
  • New TestPollState / TestAddLogLine / TestNoWebEngineFallback cover HudFaceWindow's JS-call construction and escaping
  • Manually launched the real desktop app end-to-end (double-click-style launch via a Desktop shortcut) and confirmed: PROJECT_ROOT resolves correctly, the HUD window opens automatically, real assistant state shows ("EM ESPERA" for idle), and live debug_log lines flow into the HUD's core log panel — screenshot of the running window confirmed all of the above

Adds a JARVIS_SHOW_HUD env var (mirroring JARVIS_VOICE_DEBUG) that
makes the tray auto-show the face window on launch, plus a --hud flag
on run_desktop_app.bat, so a desktop shortcut can open Jarvis straight
into the HUD.
cmd.exe's %~dp0 stops reflecting the script's own folder once a `shift`
has executed in the same invocation, silently resolving PROJECT_ROOT
against the current directory instead. This broke run_desktop_app.bat
whenever any argument (--voice-debug, --hud) was passed from a working
directory other than the script's own folder, e.g. from a desktop
shortcut. Resolve PROJECT_ROOT from %~dp0 at the very top, before the
arg-parsing loop's `shift` runs.
face_hud.html ("Jarvis HUD v6.4") existed in desktop_assets but nothing
loaded it, so the tray's Face window still showed the old painted
LowPolyFaceWidget. Adds HudFaceWindow, which hosts face_hud.html in a
QWebEngineView and drives its existing JS hooks:

- window.setJarvisState(state): polls the real JarvisStateManager
  (cross-process via its state file) every 300ms and forwards changes
- window.addJarvisLogLine(line): connected to the same log_signals
  stream the LogViewerWindow already receives from the daemon, so the
  HUD's "REGISTO DO SISTEMA" panel shows genuine debug_log lines

Falls back to the original LowPolyFaceWidget when QtWebEngine isn't
available. window.playJarvisAudio (audio-reactive visualization) is
left unwired for now - it needs new cross-process IPC to ship TTS
audio from the daemon subprocess to the desktop app, which is a
separate, larger piece of work.

Manually verified: launched the desktop app and confirmed the HUD
renders with live state ("EM ESPERA"/idle) and real log lines flowing
into the core log panel.
@andresnunes1404 andresnunes1404 changed the title feat(desktop): auto-open HUD on startup via JARVIS_SHOW_HUD feat(desktop): wire new HTML HUD into FaceWindow + auto-open shortcut support Jul 22, 2026
@isair
isair force-pushed the develop branch 2 times, most recently from 075622a to 2d40388 Compare July 26, 2026 20:17
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