fix: Fix intermittently-missing SQL autocomplete suggestions (#1980)

This commit is contained in:
Drew Davis 2026-03-24 13:45:34 -04:00 committed by GitHub
parent cdc29d5a88
commit dd313f7754
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---
fix: Fix intermittently-missing SQL autocomplete suggestions

View file

@ -144,9 +144,10 @@ export default function SQLInlineEditor({
const compartmentRef = useRef<Compartment>(new Compartment());
const hasNonEmptyValue = value.trim().length > 0;
const updateAutocompleteColumns = useCallback(
(viewRef: EditorView) => {
const currentText = viewRef.state.doc.toString();
const identifiers = [
...(filteredFields?.map(column => {
if (column.path.length > 1) {
@ -171,15 +172,16 @@ export default function SQLInlineEditor({
});
viewRef.dispatch({
effects: compartmentRef.current.reconfigure(
currentText.length > 0 ? auto : queryHistoryList,
hasNonEmptyValue ? auto : queryHistoryList,
),
});
},
[
filteredFields,
additionalSuggestions,
createHistoryList,
disableKeywordAutocomplete,
createHistoryList,
hasNonEmptyValue,
],
);