Skip to content

feat: add event configuration for chat, mail, API, and webhooks#88

Merged
felix-schultz merged 2 commits intodevfrom
feature/87-bug-chat-improvements
Jun 19, 2025
Merged

feat: add event configuration for chat, mail, API, and webhooks#88
felix-schultz merged 2 commits intodevfrom
feature/87-bug-chat-improvements

Conversation

@felix-schultz
Copy link
Copy Markdown
Member

  • Introduced EVENT_CONFIG to manage event mappings for chat, mail, API, and simple actions.
  • Created configuration interfaces for SimpleChat, UserMail, API, and Webhook.
  • Updated ChatInterface to support memoization and improved loading states for messages.
  • Enhanced event form to handle dynamic event types and configurations based on selected nodes.
  • Refactored interfaces to include new configuration props and types for better type safety.

closes #87

- Introduced EVENT_CONFIG to manage event mappings for chat, mail, API, and simple actions.
- Created configuration interfaces for SimpleChat, UserMail, API, and Webhook.
- Updated ChatInterface to support memoization and improved loading states for messages.
- Enhanced event form to handle dynamic event types and configurations based on selected nodes.
- Refactored interfaces to include new configuration props and types for better type safety.
@felix-schultz felix-schultz requested a review from Copilot June 19, 2025 12:10
@felix-schultz felix-schultz self-assigned this Jun 19, 2025
@felix-schultz felix-schultz added the bug Something isn't working label Jun 19, 2025
@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Jun 19, 2025

Here's the code health analysis summary for commits d7801b1..df31283. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource Rust LogoRust✅ SuccessView Check ↗
DeepSource JavaScript LogoJavaScript❌ Failure
❗ 210 occurences introduced
🎯 19 occurences resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a centralized EVENT_CONFIG for mapping event types to their configuration and interface components, updates the event form to dynamically set event types and configs based on node selection, and refactors chat and UI components to support loading states, memoization, and improved type safety.

  • Added IEventMapping interfaces and config components for chat, mail, API, and webhooks
  • Enhanced EventForm to accept eventConfig, set default event type/config on node select
  • Refactored ChatInterface and MessageComponent to handle loading states and memoization

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui/components/ui/event-form.tsx Added eventConfig prop, auto-assign event_type & config on node change
packages/ui/components/interfaces/interfaces.tsx Expanded interfaces with IEventMapping, IUseInterfaceProps, etc.
packages/ui/components/interfaces/index.ts Exported new config and mapping types and config components
packages/ui/components/interfaces/configs/* New config UIs: WebhookConfig, UserMailConfig, SimpleChatConfig, ApiConfig, EventTypeConfiguration, EventTranslation
packages/ui/components/interfaces/chat-default/message.tsx Renamed noToolbar to loading, updated toolbar toggle & markdown placeholder
packages/ui/components/interfaces/chat-default/chat.tsx Passed loading flag to MessageComponent for pending messages
packages/ui/components/interfaces/chat-default.tsx Memoized ChatInterface, split wrapper and memoized component
apps/desktop/lib/event-config.ts Defined EVENT_CONFIG with mappings for all event groups
apps/desktop/app/use/page.tsx Switched from static USABLE_EVENTS to dynamic EVENT_CONFIG lookup
apps/desktop/app/library/config/layout.tsx Replaced USABLE_EVENTS with EVENT_CONFIG for quick actions
apps/desktop/app/library/config/events/page.tsx Wired eventConfig into EventForm, EventTypeConfiguration, EventTranslation

Comment on lines +6 to +9
import {
convertJsonToUint8Array,
parseUint8ArrayToJson,
} from "../../lib/uint8";
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The imported parseUint8ArrayToJson is not used in this file—consider removing it to avoid dead code.

Suggested change
import {
convertJsonToUint8Array,
parseUint8ArrayToJson,
} from "../../lib/uint8";
import { convertJsonToUint8Array } from "../../lib/uint8";

Copilot uses AI. Check for mistakes.
board_version: undefined,
node_id: event?.node_id || "",
board_id: event?.board_id || "",
event_type: undefined,
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When editing an existing event, event_type should be initialized from event?.event_type instead of undefined, so the form stays in sync with the loaded data.

Suggested change
event_type: undefined,
event_type: event?.event_type || undefined,

Copilot uses AI. Check for mistakes.
},
useInterfaces: {},
},
events_simple: {
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configs map for events_simple is empty but defaultEventType is "quick_action"; add a quick_action entry (and any others in eventTypes) so defaults resolve reliably.

Copilot uses AI. Check for mistakes.
@felix-schultz felix-schultz merged commit 65cc29a into dev Jun 19, 2025
2 of 7 checks passed
@felix-schultz felix-schultz deleted the feature/87-bug-chat-improvements branch June 19, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants