Skip to content

fix: incorrect hammer icons for work log tool calls#31

Closed
zortos293 wants to merge 1 commit intomainfrom
capy/fix-work-log-icon
Closed

fix: incorrect hammer icons for work log tool calls#31
zortos293 wants to merge 1 commit intomainfrom
capy/fix-work-log-icon

Conversation

@zortos293
Copy link
Owner

@zortos293 zortos293 commented Mar 15, 2026

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

Open in Capy TC-12 · 5.4

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.

@zortos293 zortos293 added the capy Generated by capy.ai label Mar 15, 2026 — with Capy AI
@coderabbitai
Copy link

coderabbitai bot commented Mar 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f741cbdd-192c-4d16-9bd3-a191a34a6d38

📥 Commits

Reviewing files that changed from the base of the PR and between 32de82c and 5fcdf81.

📒 Files selected for processing (4)
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/chat/MessagesTimeline.logic.test.ts
  • apps/web/src/components/chat/MessagesTimeline.logic.ts
  • apps/web/src/components/chat/MessagesTimeline.tsx

📝 Walkthrough

Walkthrough

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.

@zortos293 zortos293 closed this Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai size:L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant