-
Notifications
You must be signed in to change notification settings - Fork 320
Description
/frontend/src/components/icons.tsx is missing the following provider icons:
tools.abuseipdbtools.alertmediatools.amazon_s3tools.ansibletools.aws_boto3tools.crowdsectools.crowdstriketools.elastic_securitytools.elasticsearchtools.emailreptools.exatools.falconpy(reuse crowdstrike icon)tools.hackeronetools.hibptools.ipinfotools.jamftools.jiratools.ldap(use https://lucide.dev/icons/file-key-2)tools.leakchecktools.miniotools.notiontools.oktatools.okta_oar(reuse okta icon)tools.phishlabstools.pymongotools.runreveal(the SVG is already in OAuth integrations icons)tools.sentinel_onetools.sentry(the SVG is already in OAuth integrations icons)tools.slack_sdk(reuse Slack icon)tools.splunktools.sublimetools.tavilytools.threatstreamtools.urlscantools.wazuhtools.zendesk
You MUST follow these guidelines on formatting icons:
Tracecat displays integration icons in two contexts:
- OAuth Provider Icons - Authentication/integrations settings page
- Workflow Tool Icons - Node picker when adding actions to workflows
The same icon component can be used in both places with appropriate styling for each context.
Icon System Architecture
Key Files
- frontend/src/components/icons.tsx - All icon definitions and mappings
Critical Constant
export const basicIconsCommon = "flex p-1 shrink-0 rounded-full items-center justify-center bg-stone-200/50"
This class provides proper padding, sizing, and container behavior for workflow tool icons only.
Two Icon Registries
- UDFIcons - For workflow tools/actions
- Pattern: "tools.", "ai.", "core.*"
- Applies basicIconsCommon styling via wrapper div
- providerIcons - For OAuth integrations
- Pattern: snake_case (e.g., microsoft_sentinel, azure_log_analytics)
- Uses custom className passed from ProviderIcon component
Step-by-Step Implementation Guide
Step 1: Create the Icon Component
Location: Add after similar icons (e.g., after MicrosoftSentinelIcon for Azure icons) Critical Requirements:
- ❌ DO NOT include basicIconsCommon in the icon component itself
- ✅ Only use className={className}
- ✅ Use appropriate viewBox (prefer 24 24 or larger for good padding)
- ✅ Use unique gradient IDs to avoid conflicts
Template:
export function MyServiceIcon({ className, ...rest }: IconProps) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
className={className} // ← JUST className, no basicIconsCommon
{...rest}
>
<defs>
<linearGradient id="myservice-gradient-unique-id">
<stop offset="0" stopColor="#color1" />
<stop offset="1" stopColor="#color2" />
</linearGradient>
</defs>
{/* SVG paths with proper spacing */}
</svg>
)
}
❌ WRONG - Don't do this:
// This will make OAuth icons too small!
export function MyServiceIcon({ className, ...rest }: IconProps) {
return (
<svg
className={cn(basicIconsCommon, className)} // ❌ NO!
{...rest}
>
Step 2: Add to UDFIcons (Workflow Tools)
Location: Around line 539, before the closing } Pattern: Wrap icon in div with basicIconsCommon
"tools.my_service": ({ className, ...rest }: IconProps) => (
Step 4: Verify
cd frontend && pnpm check
Common Patterns
Example 1: Service with OAuth + Tools
// Step 1: Icon Component (around line 1100)
export function MyServiceIcon({ className, ...rest }: IconProps) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
className={className}
{...rest}
>
{/* SVG content */}
</svg>
)
}
// Step 2: UDFIcons entry (around line 539)
"tools.my_service": ({ className, ...rest }: IconProps) => (
<div className={cn(basicIconsCommon, className)}>
<MyServiceIcon {...rest} />
</div>
),
// Step 3: providerIcons entry (around line 586)
my_service: ({ className, ...rest }) => (
<div className={className}>
<MyServiceIcon {...rest} />
</div>
),
Example 2: Reusing Existing Icons
// If SlackIcon already exists, just add aliases:
// For AI tool
"ai.slackbot": (props: IconProps) => <SlackIcon {...props} />,
// For different tool namespace
"tools.slack_alerts": ({ className, ...rest }: IconProps) => (
<div className={cn(basicIconsCommon, className)}>
<SlackIcon {...rest} />
</div>
)
ViewBox and Spacing Guidelines
Recommended ViewBox Sizes
- 24x24 - Good default, plenty of padding space
- 18x18 - Minimum, requires careful content positioning
- Larger (e.g., 438x438) - Fine if content is naturally padded
Content Spacing
For a 24x24 viewBox:
- Leave 3-5 units padding on each edge
- Content should be roughly in range: x=4-20, y=4-20
For an 18x18 viewBox:
- Leave 2-3 units padding on each edge
- Content should be roughly in range: x=2-16, y=2-16
Troubleshooting
Problem: OAuth icons too small
Cause: Icon component has basicIconsCommon built-in Solution: Remove basicIconsCommon from icon component, only use className={className}
Problem: Workflow tool icons too large
Cause: UDFIcons entry doesn't wrap icon with basicIconsCommon Solution: Wrap icon in div with basicIconsCommon:
"tools.service": ({ className, ...rest }: IconProps) => (
<div className={cn(basicIconsCommon, className)}>
<ServiceIcon {...rest} />
</div>
),Problem: Icon cut off at edges
Cause: ViewBox too small or content extends to edges Solution:
- Increase viewBox size
- Adjust content to leave padding space
Problem: Gradient conflicts
Cause: Duplicate gradient IDs Solution: Use unique, descriptive IDs:
- ✅ id="github-gradient"
- ✅ id="azure-log-gradient"
- ❌ id="gradient"
Quick Reference Checklist
- Icon component uses only className={className} (no basicIconsCommon)
- ViewBox provides adequate padding (24x24 or larger preferred)
- Gradient IDs are unique across all icons
- UDFIcons entry wraps icon with <div className={cn(basicIconsCommon, className)}>
- providerIcons entry wraps icon with
- File compiles: cd frontend && pnpm check
- Visually verify in both contexts (OAuth list + workflow node picker)
Key Principle
The icon component is "styling-agnostic" - it accepts whatever className is passed to it. The parent context (UDFIcons or providerIcons) decides what styling to apply:
- UDFIcons: Adds basicIconsCommon for workflow tool icon sizing
- providerIcons: Passes through custom className for OAuth icon sizing
This separation of concerns allows the same icon to look correct in both places without conflicts.