-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Bug Report: Too Many Cooks VSCode Extension Treeview Issues
Bug 1: Delete Agent Dialog Shows "(empty)" Button
Severity: High - visible UI bug affecting user experience
Description:
When clicking the delete (trash) icon on an agent in the TMC sidebar treeview, the confirmation dialog shows three buttons: "Remove", "(empty)", and "Cancel". The "(empty)" button should not exist.
Root Cause:
In packages/dart_node_vsix/lib/src/window.dart:17-32, the showWarningMessage Dart wrapper always passes 4 arguments to the underlying JS showWarningMessage, even when only one button item is needed:
JSPromise<JSString?> showWarningMessage(
String message, [
MessageOptions? options,
String? item1,
String? item2,
]) {
if (options != null && item1 != null) {
return _showWarningMessageWithOptions(
message,
options,
item1,
item2 ?? '', // BUG: passes empty string '' when item2 is null
);
}
return _showWarningMessage(message);
}When item2 is null (not provided by the caller), the code passes item2 ?? '' (empty string) as the 4th argument. VSCode's showWarningMessage API interprets this empty string as a button label and renders it as "(empty)".
The TypeScript version used variadic rest args and only passed defined items - it never sent empty strings.
Expected: Dialog shows only "Remove" and "Cancel" buttons
Actual: Dialog shows "Remove", "(empty)", and "Cancel" buttons
Fix needed: _showWarningMessageWithOptions should not be called with 4 args when item2 is null. Need either:
- A separate overload
_showWarningMessageWith1Item(message, options, item1) - Or conditional logic to only pass non-null items
Bug 2: Treeview Label/Description Text Rendering Overlap
Severity: Medium - visual rendering issue
Description:
In the TMC agents treeview, agent names and their descriptions (e.g., message counts) appear garbled/overlapping. For example:
- "techdoc-buirider m8gaasgs" instead of clean "techdoc-builder" label with "18 msgs" as separate description
- "tlahde-coagerit8 4nsgss" instead of "techdoc-agent" with "4 msgs"
The label text and description text appear to be rendering on top of each other in the VSCode treeview.
Possible Root Causes:
-
JSTreeDataProvider getChildren callback (
packages/dart_node_vsix/lib/src/tree_view.dart:149-151):_setProperty( obj, 'getChildren', ((T? element) => provider.getChildren(element)?.toJS).toJS, );
When VSCode calls
getChildren()with no arguments (for root items), JS passesundefined. Dart's JS interop should mapundefined→nullfor nullableT?, but there may be edge cases. -
TreeItem label/description property setting: The way
TreeItemis constructed viaReflect.constructand then description is set via external setter may cause VSCode's treeview renderer to not properly distinguish label from description. -
Could also be a VSCode rendering artifact at certain resolutions/zoom levels, though the character substitution patterns suggest data corruption rather than visual overlap.
Investigation needed: This may require running the extension in debug mode and inspecting the actual TreeItem objects being returned to VSCode's treeview renderer to confirm whether the data is correct (rendering bug) or incorrect (data bug).
Test Coverage Added
A new test file has been created at:
examples/too_many_cooks_vscode_extension/test/suite/treeview_bugs_test.dart
Tests include:
- showWarningMessage empty string test - Captures arguments passed to showWarningMessage and asserts no empty string button items are passed
- Agent label integrity - Asserts agent label exactly matches agent name (no garbled text)
- Agent description format validation - Asserts description matches valid patterns ("idle", "N msgs", "N locks", etc.)
- Label/description separation - Asserts label doesn't contain description text and vice versa
- Agent children integrity - Validates child items have proper label/description separation
Files Involved
packages/dart_node_vsix/lib/src/window.dart- showWarningMessage wrapper (Bug 1 root cause)packages/dart_node_vsix/lib/src/tree_view.dart- TreeItem/JSTreeDataProvider (Bug 2 investigation)examples/too_many_cooks_vscode_extension/lib/ui/tree/agents_tree_provider.dart- Agent tree renderingexamples/too_many_cooks_vscode_extension/lib/extension.dart- deleteAgent command handler