Skip to content

bug: '/' filter hotkey is silently dropped for ~50ms after the dashboard paints #2200

Closed

Description

@vybe

Summary

The Dashboard type-to-filter hotkey (/, trinity-enterprise#261) is not listening when the fleet first paints. A / pressed in that window is silently dropped. User impact is small (~50ms); test impact is total — all 7 dashboard-type-filter specs fail deterministically.

Context

Found during an exploratory E2E sweep of dev @ c1cc22bc, measured by instrumenting document.addEventListener:

[data-agent="trinity-system"] visible at   t = 261 ms
handleDashboardKeydown registered at       t = 311 ms

The fleet is painted by a child component; the hotkey is registered in the parent's onMounted, which Vue always runs after children mount. So there is a window in which the dashboard looks fully interactive but the document-level handler does not exist yet. The event reaches document with defaultPrevented: false and nothing consumes it.

Probe matrix (fresh browser context per row):

Scenario Pill opens?
press / immediately ❌
press / twice ❌ then ✅
wait 6s, then press / ✅
click body, then press / ❌ — it is time, not focus
click the toolbar / button ✅ (direct @click, bypasses the document handler)

The feature itself is correct once armed: it filters by slug and display label, reports "1 of 7 match", and Esc restores.

Why it matters beyond the 50ms: Playwright acts the instant its waitFor resolves, so the suite hits this window every run. All 7 specs in e2e/dashboard-type-filter.spec.js fail on getByTestId('filter-pill') not found. The spec's own docstring warns about a focus race one level lower down; the actual race is the listener registration.

Acceptance Criteria

  • Pressing / immediately after the fleet renders opens the filter pill
  • The document keydown handler is armed no later than the point at which agent tiles/rows are visible
  • All 7 specs in e2e/dashboard-type-filter.spec.js pass without an artificial waitForTimeout
  • Existing guards preserved: / in an editable field still types a literal slash; Esc backstop still clears; nothing persists across reload

Technical Notes

  • src/frontend/src/views/Dashboard.vue — handleDashboardKeydown registered in onMounted (~line 868); guards 0–5 are correct and not the problem
  • Options: register the listener earlier in setup rather than onMounted, or expose a readiness signal the tests (and the UI) can rely on
  • The root pattern is reusable: registering a document-level hotkey in a parent's onMounted while children paint first will reproduce this anywhere. Worth a note in the design-system contract if the fix is a convention rather than a one-off.
  • Related: trinity-enterprise#261

Activity

  1. added
    priority-p2
    type-bug
    theme-ui-ux
    complexity-low
    status-ready
    on Aug 15, 2026
  2. added
    status-in-progress
    and removed
    status-ready
    on Aug 15, 2026
  3. added
    status-in-dev
    and removed
    status-in-progress
    on Aug 16, 2026
  4. removed
    status-in-dev
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

complexity-lowpriority-p2theme-ui-uxtype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions