fix(evaluator): fix tag dropdown for evaluator block#807
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR fixes a bug in the tag dropdown component where evaluator blocks were displaying generic agent block tag dropdown values instead of their specific metric-based outputs. The change adds special handling for evaluator blocks in two locations within the TagDropdown component.
The evaluator block is unique in that it has dynamically generated outputs based on user-defined metrics (like 'accuracy', 'relevance', 'clarity') rather than static predefined outputs. The existing tag dropdown logic was falling back to generic block outputs or response format schema, which didn't account for this dynamic behavior.
The fix implements identical logic in two places: one for handling active source blocks (drag & drop scenarios) and another for accessible blocks (general workflow context). Both implementations check if a block is of type 'evaluator', retrieve the metrics configuration from the subblock store using useSubBlockStore.getState().getValue(), and generate appropriate tag suggestions based on the metric names. If no metrics are defined, it falls back to the default block outputs using the existing generateOutputPaths function.
This change integrates well with the existing codebase by leveraging the established patterns for block type checking, subblock store access, and tag generation while maintaining backward compatibility through the fallback mechanism.
Confidence score: 3/5
• This PR appears safe to merge as it's a targeted bug fix with fallback handling, but the code duplication raises maintainability concerns
• The identical code blocks in two locations violate DRY principles and could lead to maintenance issues if future changes are needed
• apps/sim/components/ui/tag-dropdown.tsx needs attention for the duplicated logic that should be extracted into a reusable function
1 file reviewed, 2 comments
* fix(evaluator): fix tag dropdown for evaluator block * lint --------- Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
Description
fix tag dropdown for evaluator block, was showing generic tag dropdown values for agent block
Type of change
How Has This Been Tested?
Tested manually
Checklist:
bun run test)Security Considerations:
Additional Information: