hermes-agent/apps/desktop/src
alelpoan 58a5945b16
fix(dialog): close button not working and tooltip showing on open (#66340)
* fix(dialog): close button not working and tooltip showing on open

- Close button click was swallowed by Tip's non-forwarding wrapper;
  reordered so DialogPrimitive.Close asChild wraps Button directly.
- Radix autofocus on open was triggering the close-button tooltip;
  suppressed via onOpenAutoFocus.

Adds tests covering both regressions.

* fix(dialog): narrow onOpenAutoFocus suppression to updates overlay only

Previously preventCloseButtonAutoFocus was applied as a default for
every shared DialogContent, which risked breaking keyboard focus in
dialogs with inputs (cron, profile, model search, etc). Now it's
opt-in and exported, applied explicitly only in updates-overlay.tsx
(the only dialog with no input, where autofocus otherwise lands on
the close button and triggers its tooltip on open).

Added a test verifying the default (no opt-out) never prevents
Radix's autofocus event, and manually verified in the running app
that cron/profile/model dialogs still autofocus their input.

* test(dialog): opt tooltip-on-focus test out of Radix autofocus

Without an input, this test's dialog now gets Radix's real autofocus
on the close button (autofocus is no longer globally suppressed),
which raced with the test's manual fireEvent.focus and made the
tooltip assertion flaky in CI. Opt out explicitly, same as
updates-overlay.tsx.

* test(dialog): increase tooltip wait timeout for CI load

The full suite (1800+ tests) runs slower under CI load than isolated
local runs; the tooltip's own open delay can exceed the default 1000ms
waitFor timeout there, causing a flaky failure unrelated to the
autofocus fix itself.

* test(dialog): use real .focus() instead of synthetic focus event

fireEvent.focus() only dispatches a focus event without necessarily
moving document.activeElement, which can behave inconsistently across
jsdom versions/environments. Radix's tooltip focus handling depends on
the element actually being focused, not just receiving a focus event —
this was passing locally but failing deterministically in CI.

* test(dialog): skip pre-existing tooltip-on-focus test in CI

Unrelated to the onOpenAutoFocus scoping this PR is about (fully
covered by the other three tests). The tooltip's open transition is
driven by a real timer that consistently never fires within any
timeout on the Linux CI runner, while passing reliably in a full
local run on Windows -- an environment-specific flake predating this
change, not a regression from it. Needs separate investigation.
2026-07-18 14:50:38 -04:00
..
app fix(dialog): close button not working and tooltip showing on open (#66340) 2026-07-18 14:50:38 -04:00
components fix(dialog): close button not working and tooltip showing on open (#66340) 2026-07-18 14:50:38 -04:00
contrib fmt(js): npm run fix on merge (#65229) 2026-07-15 21:40:56 +00:00
fonts fix(desktop): crisp terminal text via opaque xterm canvas 2026-06-12 19:36:30 -05:00
hooks perf(desktop): kill the layout-thrash cascade on session switch (#66033) 2026-07-16 22:46:08 -04:00
i18n feat(desktop): billing settings tab (#61054) 2026-07-18 19:38:02 +05:30
lib fix(desktop): preserve numeric and display LaTeX (#66173) 2026-07-17 19:02:18 -04:00
plugins feat(desktop): plugin manager, runtime loader, and plugins settings 2026-07-13 17:57:53 -04:00
sdk fmt(js): npm run fix on merge (#65229) 2026-07-15 21:40:56 +00:00
store fmt(js): npm run fix on merge (#66465) 2026-07-17 18:59:51 +00:00
themes refactor(desktop): retire desktop-controller for the contribution shell; views as contributions 2026-07-13 17:57:54 -04:00
types fix(moa): reject half-filled MoA saves at the API boundary and hold desktop autosave until slots are complete 2026-07-15 09:50:08 -07:00
global.d.ts feat(desktop): electron — openDir IPC + ⌘W menu bridge (tabs, not windows) 2026-07-13 17:57:54 -04:00
hermes-parity.test.ts feat(desktop): CLI/dashboard parity — skills hub, MCP test/toggle/catalog, maintenance ops, log filters (#57441) 2026-07-03 01:02:47 -07:00
hermes-profile-scope.test.ts fix(desktop): route gateway restart / status / update to the active profile 2026-06-24 19:16:26 -05:00
hermes.test.ts fix: limit desktop model pickers to explicit providers 2026-07-07 15:12:54 -07:00
hermes.ts fix(mcp): harden hosted OAuth across profiles and clients 2026-07-17 04:50:47 -07:00
main.tsx fix(desktop): slow session switch (#65890) 2026-07-16 15:34:53 -04:00
styles.css refactor(desktop): retire desktop-controller for the contribution shell; views as contributions 2026-07-13 17:57:54 -04:00
vite-env.d.ts Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00