You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a bug where all tool call icons in the timeline were displaying as hammers. The icon resolution logic was directly mapping dynamic_tool_call/collab_agent_tool_call itemTypes to HammerIcon without considering content-based heuristics, so Context7/SQL/search-style tools all collapsed to hammer icons.
Added resolveWorkEntryIconKind() in apps/web/src/components/chat/MessagesTimeline.logic.ts to centralize icon classification based on requestKind, itemType, and label/detail heuristics before falling back to generic tool icons
Added heuristics to detect context7/resolve-library-id/search → search icon, sql → database icon, while keeping hammer/wrench for generic dynamic/MCP tool calls
Updated apps/web/src/components/chat/MessagesTimeline.tsx to use the shared resolver via iconKindToLucideIcon()
Updated the duplicated legacy resolver in apps/web/src/components/ChatView.tsx to use the same shared logic, keeping both timeline views consistent
Added regression tests in apps/web/src/components/chat/MessagesTimeline.logic.test.ts for Context7/search, SQL, generic dynamic tool, and MCP tool icon selection
Summary by CodeRabbit
Refactor
Centralized icon resolution logic for work entry display to improve code organization and maintainability. Icon appearance and behavior remain unchanged.
Tests
Added comprehensive test coverage for icon resolution with multiple scenarios including search heuristics, database tools, and MCP tool calls.
This pull request introduces a centralized icon resolution system for work entries. A new function, resolveWorkEntryIconKind(), extracts icon determination logic by evaluating work entry properties and returning an icon kind identifier. This identifier is then mapped to a Lucide icon through a helper function. The ChatView and MessagesTimeline components are refactored to use this centralized approach instead of inline conditional logic, with a fallback to tone-based icons when no icon kind is determined. Supporting types and test coverage are added.
📝 Coding Plan
Generate coding plan for human review comments
Comment @coderabbitai help to get the list of available commands and usage tips.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug where all tool call icons in the timeline were displaying as hammers. The icon resolution logic was directly mapping
dynamic_tool_call/collab_agent_tool_callitemTypes toHammerIconwithout considering content-based heuristics, so Context7/SQL/search-style tools all collapsed to hammer icons.resolveWorkEntryIconKind()inapps/web/src/components/chat/MessagesTimeline.logic.tsto centralize icon classification based onrequestKind,itemType, and label/detail heuristics before falling back to generic tool iconscontext7/resolve-library-id/search→ search icon,sql→ database icon, while keeping hammer/wrench for generic dynamic/MCP tool callsapps/web/src/components/chat/MessagesTimeline.tsxto use the shared resolver viaiconKindToLucideIcon()apps/web/src/components/ChatView.tsxto use the same shared logic, keeping both timeline views consistentapps/web/src/components/chat/MessagesTimeline.logic.test.tsfor Context7/search, SQL, generic dynamic tool, and MCP tool icon selectionSummary by CodeRabbit
Refactor
Tests