The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): give the composer action pill a transit-safe hide delay
Konstantin Khlopkov45c738821328
diff --git a/apps/desktop/src/app/chat/composer/directive-actions.test.tsx b/apps/desktop/src/app/chat/composer/directive-actions.test.tsxindex fcaa4424f5c..22e5f245d9e 100644--- a/apps/desktop/src/app/chat/composer/directive-actions.test.tsx+++ b/apps/desktop/src/app/chat/composer/directive-actions.test.tsx@@ -1,4 +1,4 @@-import { cleanup, fireEvent, render, screen } from '@testing-library/react'+import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'import { afterEach, describe, expect, it, vi } from 'vitest'import { I18nProvider } from '@/i18n'@@ -129,6 +129,46 @@ describe('ComposerDirectiveActions', () => {expect(pillValue()).toBe('https://example.com')})+ it('keeps the pill up through a slow diagonal transit to it', () => {+ vi.useFakeTimers()++ const editor = mountEditor([{ kind: 'url', value: 'https://example.com' }])+ const chip = chips(editor, 'url')[0]!++ hover(chip)+ fireEvent.pointerOut(chip, { relatedTarget: null })+ // The pointer is still in the gap between chip and pill — beyond the old+ // 120 ms window, not yet on the pill's own hover.+ act(() => {+ vi.advanceTimersByTime(300)+ })+ expect(pillValue()).toBe('https://example.com')++ fireEvent.mouseEnter(screen.getByRole('button').parentElement!)+ act(() => {+ vi.advanceTimersByTime(500)+ })++ expect(pillValue()).toBe('https://example.com')+ })++ it('still hides shortly after the pointer leaves the pill for good', () => {+ vi.useFakeTimers()++ const editor = mountEditor([{ kind: 'url', value: 'https://example.com' }])+ const chip = chips(editor, 'url')[0]!++ hover(chip)+ fireEvent.pointerOut(chip, { relatedTarget: null })+ fireEvent.mouseEnter(screen.getByRole('button').parentElement!)+ fireEvent.mouseLeave(screen.getByRole('button').parentElement!)+ act(() => {+ vi.advanceTimersByTime(500)+ })++ expect(pillValue()).toBeNull()+ })+it('binds to the document so a late-attached editor still gets the affordance', () => {// The edit composer's editor isn't reliably in the DOM when the effect// first runs; a document listener that reads the editor lazily worksdiff --git a/apps/desktop/src/app/chat/composer/directive-actions.tsx b/apps/desktop/src/app/chat/composer/directive-actions.tsxindex b18ade2aac0..911972b6b29 100644--- a/apps/desktop/src/app/chat/composer/directive-actions.tsx+++ b/apps/desktop/src/app/chat/composer/directive-actions.tsx@@ -20,8 +20,10 @@ import { useI18n } from '@/i18n'import { cn } from '@/lib/utils'/** Moving between the chip and the pill crosses a gap where neither is hovered.- * Short enough that it still reads as instant on the way out. */-const HIDE_DELAY_MS = 120+ * Long enough that a pointer travelling diagonally across that gap reaches the+ * pill's own hover before the grace window closes; still reads as instant when+ * leaving the chip for good. */+const HIDE_DELAY_MS = 500/** The actionable directive chip under `target` that also belongs to `editor`,* if there is one. */diff --git a/website/docs/user-guide/desktop.md b/website/docs/user-guide/desktop.mdindex e9e284fc49e..f135f8841d4 100644--- a/website/docs/user-guide/desktop.md+++ b/website/docs/user-guide/desktop.md@@ -47,6 +47,7 @@ The center of the app. You get:- **The same conversation history** as every other Hermes surface — sessions started here resume in the CLI/TUI and vice versa.- **Drag-and-drop files** anywhere in the chat area to attach them to your next message.- **Independent background drafts** — hidden chat tabs can update their drafts without moving the caret or selection in the visible composer.+- **Directive chip actions** — hover an actionable reference (such as a URL) to reveal its action pill. A short grace period lets you move from the chip to the pill before it dismisses.- **A right-hand preview rail** — render web pages, files, and tool outputs side by side while you keep chatting.- **Comment mode in the in-app browser** — click **Annotate** in the preview browser bar, then click any element (or drag a box) on the live page and type a note; each saved comment stays as a numbered pin on the page. Saving a pin never sends a turn — when you're done, **Add N comments** attaches a cropped screenshot per pin and a short prompt naming each comment to the composer, and you still hit send yourself. Each element comment carries its CSS selector, its markup, and the computed styles that matter for layout, so the agent can find the element in your source instead of guessing from the picture. Password and hidden field values, and any attribute that looks like a key or token, are redacted on the page before the markup leaves it. Larger batches arrive grouped by which part of the page each comment sits in, so twenty-odd comments become a handful of pieces of work rather than one task each — and because the groups are separate DOM subtrees they usually touch separate files, which is what makes handing them to parallel workers safe. Pin numbers hold steady if you delete one, and switching chats clears the stack.- **Composer history and queue editing** — press the up/down arrow keys in an empty composer to recall and reuse previous prompts, and edit messages you've queued up before they're sent. Pressing Stop (or Esc) while turns are queued pauses the queue and expands it above the composer; resume it from there, or send, edit, and delete individual entries.