Skip to content

Right panel defaults to chat-widget: recipe config ignored #663

@joelteply

Description

@joelteply

Bug

The right panel always renders chat-widget regardless of what the recipe declares. Factory recipe specifies factory-stats-widget but the panel shows the default assistant.

Root Cause

ContentTypeRegistry.getRightPanelConfig() line 139 has a hardcoded fallback:

// Default: help panel
return { widget: 'chat-widget', room: 'help', compact: true };

Every code path that fails to resolve the recipe config falls through to this. Suspected race condition: the factory tab opens (via URL restore on page load) before initializeRecipeLayouts() completes, so recipeService.isLoaded() returns false, the recipe lookup is skipped, and the fallback fires.

What's been tried

  • Generator fixed to detect new layout format (layout.widgets with position: 'right') → hasRightPanel: true
  • Recipe switched to old format (main + right.widgets) matching diagnostics pattern ✓
  • Both formats produce correct config when tested offline with Node ✓
  • Right panel renders (visible in screenshots) but creates chat-widget not factory-stats-widget

Fix needed

  1. Trace the actual RIGHT_PANEL_CONFIGURE event payload in browser console when factory tab opens
  2. Confirm whether recipeService.isLoaded() is false at that point
  3. If race condition: re-emit the right panel config after recipes load, or defer tab rendering until recipes are ready
  4. Remove the chat-widget hardcoded fallback — if no right panel config exists, show nothing (not a random chat widget)

Blocks

Files

  • src/widgets/main/shared/ContentTypeRegistry.ts line 139 — the hardcoded fallback
  • src/system/recipes/browser/RecipeLayoutService.ts — recipe layout resolution
  • src/widgets/right-panel/RightPanelWidget.ts — event listener that creates widgets
  • src/widgets/main/MainWidget.ts line 341 — where the event is emitted
  • src/system/recipes/factory.json — recipe with correct right panel config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions