Skip to content

Commit 94a81dc

Browse files
committed
fix(ui): restore domain-field suggestions + fix widget positioning
- Re-enable suggestOnTriggerCharacters so typing " triggers property suggestions - Remove fixedOverflowWidgets (causes mispositioning in modals) - Add domain field pattern matching: auto-trigger for name, path, decision, execution fields regardless of string length - Description/pattern/other free-text fields don't auto-trigger
1 parent 9ff4a20 commit 94a81dc

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎ui/src/core/page-components/agent-detail/modals/edit-control/json-editor-view.tsx‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ const EDITOR_OPTIONS: import('monaco-editor').editor.IStandaloneEditorConstructi
9494
tabSize: 2,
9595
insertSpaces: true,
9696
wordWrap: 'off',
97-
fixedOverflowWidgets: true,
9897
bracketPairColorization: { enabled: true },
9998
guides: { bracketPairs: true, indentation: true },
10099
stickyScroll: { enabled: true },
@@ -165,15 +164,21 @@ function shouldAutoTriggerSuggest(
165164
if (!isInString) return false;
166165
if (/^\s*:/.test(afterCursor.replace(/^[^"]*"/, ''))) return false;
167166

168-
// Only auto-trigger for short strings (≤ 2 chars) — user is browsing options.
169-
// For longer strings, user can Ctrl+Space manually.
170167
const openIdx = beforeCursor.lastIndexOf('"');
171168
const closeIdx = afterCursor.indexOf('"');
172169
const contentLen =
173170
openIdx >= 0 && closeIdx >= 0
174171
? beforeCursor.length - openIdx - 1 + closeIdx
175172
: 999;
176-
return contentLen <= 2;
173+
174+
// Short strings: always trigger (browsing options)
175+
if (contentLen <= 2) return true;
176+
177+
// Longer strings: only trigger for known domain fields where alternatives exist
178+
// (evaluator name, selector path, decision, execution, stages)
179+
const domainFieldPattern =
180+
/"\s*(?:name|path|decision|execution|step_name_regex)\s*"\s*:\s*"[^"]*$/;
181+
return domainFieldPattern.test(beforeCursor);
177182
}
178183

179184
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)