#132908·grafana

Make automatic inline completions responsive while typing

Author: sgriff96Created Sep 17, 2026Updated Sep 17, 2026
Labelsarea/frontendinternalteam/grafana-datapro

Tune automatic triggering and cancellation so suggestions arrive without generating requests between normal keystrokes or degrading CM6 responsiveness.

Start here: packages/grafana-ui/src/components/CodeMirror/inlineCompletion.ts, inlineCompletion.test.ts, and public/app/features/expressions/components/SqlExpressions/SqlEditor/SqlEditor.tsx. Constraints: Start with a configurable 300 ms quiet period; allow one owned in-flight request; abort on edit/selection/blur/destroy; do not request during IME composition, with a non-empty selection, in read-only mode, or when the feature is unavailable; retain explicit Mod-I as a bypass and Tab/Escape behavior. Done when: A deterministic timer test shows eight keystrokes at a 180 ms cadence create zero requests while typing and one after the quiet period; the browser timing loop shows no material key-processing regression with the feature enabled; shown/accepted/dismissed/cancelled/error and first-visible latency can be evaluated during rollout. Verify: Focused fake-timer lifecycle tests; real-browser request-count and key-processing comparison with the feature on/off; manual fast typing, pause/resume, cursor movement, IME composition, Tab, and Escape checks. Implementing team: DataPro. Consulted team: Frontend Platform and AI/ML. Dependencies: Working SQL Expressions endpoint integration. Roadmap: Monaco to CodeMirror 6 migration roadmap and grafana/grafana#129192.