Skip to content

Conversation

@LordMelkor
Copy link
Owner

Add Extension Name Tooltips to Tool Banners

⚠️ DEPENDENCY: This PR depends on block#3231 being merged first. Please review and merge block#3231 before this PR.

Overview

Adds hover tooltips to tool banners showing extension names (e.g., "developer extension") without cluttering the UI. This builds on the clean tool descriptions from block#3231 by providing extension information on demand through tooltips.

Features

  • Extension Name Tooltips: Hover over tool descriptions to see which extension provides that tool
  • Left-Aligned Positioning: Tooltips align with text start for natural reading flow
  • Smart Detection: Extracts extension names from tool patterns (developer__shell → "developer extension")
  • Graceful Fallback: Tools without __ separator show no tooltip

Screenshot

Implementation

  • Modified ui/desktop/src/components/ToolCallWithResponse.tsx
  • Added getExtensionTooltip() helper function
  • Uses existing TooltipWrapper component with align="start"
  • Zero performance impact, fully backward compatible

Testing

  • ✅ TypeScript compilation passes
  • ✅ ESLint checks pass
  • ✅ All existing functionality preserved
  • ✅ Accessibility maintained

Provides extension information on demand while maintaining a clean interface.

- Add extension name prefixes to tool call banners in format [Extension: name]
- Include settings toggle to show/hide extension names (default: enabled)
- Improve fallback mechanism for unknown tools using generic ToolName + Arguments approach
- This fixes the issue where tools showed only argument keys instead of meaningful descriptions
- Now any MCP tool will show descriptions like "[Extension: name] Tool Name arguments..."
- Maintains backward compatibility and human-readable descriptions for known tools

Addresses the regression introduced in commit 666ce69 where tool call banners lost extension context information.
- Move "Show Extension Names" toggle from App Settings to Response Styles section
- Better categorization as it's about response formatting rather than app functionality
- Maintains same functionality and localStorage persistence
- Positioned after the detailed/concise style options with clear visual separation
- Make code comments completely generic
- Remove any references to specific MCP tools in implementation
- Remove border lines above and below the toggle option
- Remove font-medium from heading to match "Enable Voice Dictation" style
- Adjust spacing and description text positioning for consistency
- Change default behavior from showing extension names to hiding them
- Users must explicitly enable the feature in settings
- Update both tool call display logic and settings initialization
- Maintains user preference persistence when explicitly set
- Create localStorage utility with safe access for non-browser contexts
- Replace direct localStorage calls with safe helpers in tool components
- Remove unnecessary custom event dispatch that had no listeners
- Improve error handling for localStorage access failures
- Maintain backward compatibility and default behaviors
- Remove "Show Extension Names" toggle from ResponseStylesSection.tsx
- Remove extension prefix logic from ToolCallWithResponse.tsx
- Simplify tool banner displays to show clean descriptions without [Extension: ...] prefixes
- Keep improved display for generic/unknown tools with fallback logic
- Maintain localStorage utilities for other features
- Add getExtensionTooltip helper function to extract extension names from tool call names
- Wrap tool description text with TooltipWrapper when extension name is available  
- Show extension name on hover (e.g., "developer extension" for developer__shell)
- Add visual hints with cursor-pointer and hover:opacity-80 styling
- Gracefully handle tools without __ separator (no tooltip shown)
- Preserve all existing functionality and expand/collapse behavior

This provides extension information on demand without cluttering the UI, 
following the established tooltip patterns in the codebase.
@LordMelkor LordMelkor closed this Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants