hermes-agent/apps/desktop/src/components/ui
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
..
__tests__ feat(desktop): button tooltip keybind hints + keybinds settings tab + unified worktree dialog (#65204) 2026-07-16 18:26:21 -04:00
action-status.tsx feat(desktop): unified overlay design system, BrandMark & onboarding redesign (#40708) 2026-06-06 16:32:47 -05:00
alert.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
badge.tsx feat(desktop): shared UI — per-session prompt overlays, gateway overlays, tab primitives 2026-07-13 17:57:54 -04:00
button.tsx feat(desktop): soft gateway switch + gateway-settings polish 2026-07-10 02:57:02 -05:00
checkbox.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
codicon.tsx style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
color-swatches.tsx feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
command.tsx feat(desktop): floating pet, pop-out overlay + Cmd+K picker 2026-06-20 14:18:40 -05:00
confirm-dialog.tsx refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
context-menu.tsx feat(desktop): shared UI — per-session prompt overlays, gateway overlays, tab primitives 2026-07-13 17:57:54 -04:00
control.ts feat(desktop): dedicated Providers settings + polished Accounts/API-keys UX (#38551) 2026-06-04 03:03:42 -05:00
copy-button.test.tsx feat(desktop): localize desktop chrome 2026-06-06 07:51:44 -07:00
copy-button.tsx cleanup(desktop): npm run fix for fmtting 2026-07-08 16:24:16 -07:00
decode-text.tsx feat(desktop): shared UI — per-session prompt overlays, gateway overlays, tab primitives 2026-07-13 17:57:54 -04:00
dialog.test.tsx fix(dialog): close button not working and tooltip showing on open (#66340) 2026-07-18 14:50:38 -04:00
dialog.tsx fix(dialog): close button not working and tooltip showing on open (#66340) 2026-07-18 14:50:38 -04:00
diff-count.tsx feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
disclosure-caret.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
drop-affordance.tsx fix(desktop): session-tab drag, focus sync, and pop-out isolation 2026-07-15 03:13:33 -04:00
dropdown-menu.tsx refactor(desktop): DRY/elegance pass over PR-touched files 2026-06-04 00:28:57 -05:00
empty-state.tsx feat(desktop): Capabilities foundation — shared utils, master-detail, editors, primitives 2026-07-03 05:08:13 -05:00
error-state.tsx feat(desktop): Capabilities foundation — shared utils, master-detail, editors, primitives 2026-07-03 05:08:13 -05:00
fade-text.tsx perf(desktop): isolate streaming re-renders & cut layout thrash 2026-06-12 21:07:33 -05:00
file-type-icon.tsx feat(desktop): PR-style file diffs in chat 2026-06-22 05:04:13 -05:00
generate-button.tsx feat(pets): Pokédex generate UI — overlay, animated egg, hatch FX, manage 2026-06-24 13:51:34 -05:00
glyph-spinner.tsx feat(desktop): composer status stack, live subagent windows, editable prompts (#44630) 2026-06-12 08:30:06 -05:00
input.tsx feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
kbd.tsx feat(desktop): composer status stack, live subagent windows, editable prompts (#44630) 2026-06-12 08:30:06 -05:00
loader.tsx style(desktop): bring the install & update overlays onto the design system 2026-06-30 14:46:28 -05:00
log-view.tsx fix(desktop): make rendered logs selectable so they can be copied 2026-06-19 10:03:46 -05:00
pagination.tsx Refactor desktop i18n field copy into nested structures 2026-06-06 07:51:44 -07:00
pane-tab.test.tsx fix(desktop): session-tab drag, focus sync, and pop-out isolation 2026-07-15 03:13:33 -04:00
pane-tab.tsx fix(desktop): session-tab drag, focus sync, and pop-out isolation 2026-07-15 03:13:33 -04:00
popover.tsx feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
row-button.test.tsx refactor(desktop): formalize row-as-button primitive (RowButton) 2026-06-30 01:56:57 -05:00
row-button.tsx docs(desktop): tighten RowButton doc comment 2026-06-30 02:05:55 -05:00
sanitized-input.tsx feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
scroll-area.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
search-field.tsx feat(desktop): button tooltip keybind hints + keybinds settings tab + unified worktree dialog (#65204) 2026-07-16 18:26:21 -04:00
segmented-control.tsx feat(desktop): global Cmd+K palette + UI consistency overhaul 2026-06-03 23:45:45 -05:00
select.tsx feat(desktop): global Cmd+K palette + UI consistency overhaul 2026-06-03 23:45:45 -05:00
separator.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
sheet.tsx Refactor desktop i18n field copy into nested structures 2026-06-06 07:51:44 -07:00
sidebar.tsx feat(desktop): button tooltip keybind hints + keybinds settings tab + unified worktree dialog (#65204) 2026-07-16 18:26:21 -04:00
skeleton.tsx feat(desktop): Capabilities foundation — shared utils, master-detail, editors, primitives 2026-07-03 05:08:13 -05:00
split-button.tsx style(desktop,tui): fix all lint/type/formatting issues 2026-06-26 01:04:33 -05:00
switch.tsx refactor(desktop): DRY/elegance pass over PR-touched files 2026-06-04 00:28:57 -05:00
tab-dropdown.tsx refactor(desktop): adopt shared utils + app-wide cleanups 2026-07-03 13:48:44 -05:00
tabs.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
text-tab.tsx Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
textarea.tsx feat(desktop): add shared project UI primitives 2026-06-25 16:40:27 -05:00
title-menu-trigger.tsx feat(desktop): shared UI — per-session prompt overlays, gateway overlays, tab primitives 2026-07-13 17:57:54 -04:00
tool-icon.tsx style(desktop): filled SVG glyphs for in-thread tool icons 2026-06-10 03:41:55 -05:00
tooltip.test.tsx fix(desktop): stop tooltips re-opening when a menu/dialog restores focus to its trigger 2026-07-18 01:04:24 -04:00
tooltip.tsx fix(desktop): stop tooltips re-opening when a menu/dialog restores focus to its trigger 2026-07-18 01:04:24 -04:00
use-zoom-pan.ts feat(desktop): Memory Graph — playable radial timeline of memories + skills 2026-06-30 00:54:21 -05:00
zoomable.tsx feat(desktop): button tooltip keybind hints + keybinds settings tab + unified worktree dialog (#65204) 2026-07-16 18:26:21 -04:00