Make suggestion limit configurable and remove redundant .take(10) from widget

Move hardcoded suggestion limit to kNSIMaxSuggestions in dev_config, and remove
the redundant .take(10) from optionsBuilder since the fetch stage already caps
results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Doug Borg
2026-02-09 14:32:18 -07:00
parent ef6fc1c9c8
commit ef4205f4bd
3 changed files with 4 additions and 7 deletions
+2 -5
View File
@@ -110,12 +110,9 @@ class _NSITagValueFieldState extends State<NSITagValueField> {
focusNode: _focusNode,
optionsBuilder: (TextEditingValue textEditingValue) {
if (_suggestions.isEmpty) return const Iterable<String>.empty();
if (textEditingValue.text.isEmpty) {
return _suggestions.take(10);
}
if (textEditingValue.text.isEmpty) return _suggestions;
return _suggestions
.where((s) => s.contains(textEditingValue.text))
.take(10);
.where((s) => s.contains(textEditingValue.text));
},
onSelected: (String selection) {
widget.onChanged(selection);