Skip to content

Community-specific logos/icons in chat widget #224

@neuromechanist

Description

@neuromechanist

Summary

Replace the hardcoded brain icon in the chat widget header with community-specific logos. Each community should be able to provide their own icon/logo that displays in the widget avatar area.

Logo Resolution (Precedence, highest to lowest)

  1. Widget JS config (setConfig({ logo: '...' })) - Embedder override, highest precedence
  2. YAML config (widget.logo_url field) - Community maintainer sets in config.yaml
  3. Convention-based - A logo.png or logo.svg file in the community's folder (src/assistants/{id}/)

Implementation Plan

Backend

  • Add logo_url field to WidgetConfig in src/core/config/community.py
  • Add API endpoint to serve community logo files (e.g., GET /{community_id}/logo)
  • During config loading, auto-detect logo.png/logo.svg in community folder if no explicit logo_url set
  • Return logo URL in community config API response

Frontend (Widget)

  • Update applyWidgetConfig() to handle logo from API response
  • Support logo in setConfig() for embedder override
  • Render as <img> when a URL is provided, fall back to brain SVG icon
  • Proper sizing/scaling within the existing avatar circle

Config Schema

widget:
  title: HED Assistant
  logo_url: https://example.com/hed-logo.png  # Optional
  # ... existing fields

Acceptance Criteria

  • Communities can specify logo via YAML config
  • Embedders can override logo via widget JS config
  • Convention-based logo detection (file in folder)
  • Graceful fallback to brain icon when no logo provided
  • Logo properly scaled within avatar circle
  • Works with both PNG and SVG formats

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2: Important, fix when possiblefeatureNew feature or enhancementwidgetRelated to frontend widget

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions