LearnNewsExamplesServices
Frontmatter
id19311
titleA tooltip left inside its show delay stays visible
stateClosed
labels
bugai
assigneesneo-opus-grace
createdAtSep 27, 2026, 3:15 PM
updatedAtSep 27, 2026, 4:28 PM
githubUrlhttps://github.com/neomjs/neo/issues/19311
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 27, 2026, 4:28 PM

A tooltip left inside its show delay stays visible

neo-opus-grace
neo-opus-grace commented on Sep 27, 2026, 3:15 PM

Context

Found re-capturing FM's observatory goldens (neomjs/neo-agent-institution#288). After a click on a tooltip target, the pointer moved away at once, and the tooltip appeared a moment later and stayed. It happens with FM's keeper-nav icon rail, the pane's Route toggle and the skin switch. A quick pointer sweep over any tooltip target does the same for a user.

The Problem

Two timer defects in src/tooltip/Base.mjs, measured with a unit arm on dev, red as noted:

  1. A leave never cancels a pending show. onDelegateMouseLeave calls hideDelayed (400 ms) and leaves the showDelay (200 ms) timer armed. The show fires first, and show() runs clearTimeout(['hide', 'dismiss']), which cancels the hide. So a target left inside 200 ms shows its tooltip, and it stays. Red: enter, then leave, then wait → one show, still mounted.
  2. Re-arming a delay leaks the earlier timer. addTimeout(id, …) calls this.clearTimeout(this[id]), passing the timer handle to the class's clearTimeout(timers), which expects the names 'show' | 'hide' | 'dismiss'. It clears nothing, and the handle is overwritten. A second showDelayed before the first fires leaves the first unreachable, and an instant hide() cannot cancel it. Red: showDelayed twice, then hide() → one show later.

The Architectural Reality

  • src/tooltip/Base.mjs: addTimeout (:89), clearTimeout(timers) (:167, names only), hide (:279, clears all three by name), onDelegateMouseEnter / onDelegateMouseLeave (:303 / :335), show (:378, clears hide and dismiss), showDelayed.
  • The shared tooltip singleton serves every tooltip-configured component and data-neo-tooltip target, so every app inherits both.

The Fix

  • addTimeout clears the previous timer by its name: me.clearTimeout(id) before me[id + 'DelayTaskId'] = setTimeout(…).
  • onDelegateMouseLeave cancels the pending show before scheduling the hide.

Acceptance Criteria

  • AC-1: A target left inside the show delay never shows the tooltip (unit, real timers). Red on dev.
  • AC-2: A delay armed twice keeps one timer: an instant hide cancels it, and nothing shows later (unit). Red on dev.
  • AC-3: A target held past the show delay still shows, and leaving still hides after the hide delay (unit control, green on dev and after).
  • AC-4: The tooltip component specs (tooltip-nested-theme, tooltip-theme-projection) and the dashboard tooltip arms stay green.

Out of Scope

  • The 400 ms hide delay itself, which lets the pointer reach the tooltip (stayOnHover) by design.

Related

neomjs/neo-agent-institution#288 (where it surfaced; that visual arm works around it)

Decision Record impact: none.

Live latest-open sweep: latest 20 open issues read at 2026-09-27T13:13:29Z and again before filing; no equivalent. Lexical "tooltip" (open): #19101, #14800, neither this. A2A claim sweep: no tooltip claim; defect-note 3c96989e is mine. MC sweep ("tooltip stays visible after the mouse left the target, stuck tooltip, showDelay hideDelay not cancelled"), 6 results: Fable's 09-02 note on the by-design 400 ms linger, and #14301 (singleton theme), neither this. Own-assignment sweep: 9 open, none on tooltips.

Origin Session ID: 0dc6daad-2744-44c9-91cb-38d82e9e82e6 Retrieval Hint: "tooltip stuck visible after quick pointer leave, showDelay timer not cancelled, addTimeout clearTimeout handle"

Authored by Grace (Claude Opus 5.5, Claude Code).

tobiu referenced in commit c300181 - "fix(tooltip): a leave cancels the pending show, and a re-armed delay replaces its timer (#19311) (#19312) on Sep 27, 2026, 4:28 PM
tobiu closed this issue on Sep 27, 2026, 4:28 PM