Skip to content

feat(chat): add inline system activity and automation event logs in inbox - #1172

Open
JuanBifrost wants to merge 1 commit into
ChatbotXIO:mainfrom
JuanBifrost:feat/inbox-activity-timeline
Open

JuanBifrost wants to merge 1 commit into
ChatbotXIO:mainfrom
JuanBifrost:feat/inbox-activity-timeline

Conversation

@JuanBifrost

Copy link
Copy Markdown
Contributor

Description

This PR introduces inline system activity timeline logs in the Inbox conversation view. When background flow automations run or contact attributes change, operators can now see chronological system events directly inside the chat thread with clean centered dividers and clear visual hierarchy.

Key Changes

  • Activity Message Model & Realtime Delivery:
    • Added messageService.createActivity(...) to persist activity messages with messageType: "activity", senderType: "system", and broadcast to PartyKit/realtime (RealtimeEventType.messageCreated).
    • Zero database schema migrations needed (re-uses existing Message model with messageType: "activity", senderType: "system", and contentAttributes).
  • Contact & Flow Execution Events (Worker):
    • Updated contactCustomFieldService.setValueByKey / setValues to track and return old and new values (PendingContactCustomFieldChange[]).
    • Recorded events during flow step execution for:
      • Custom field updates (custom_field_changed) with previous and new values.
      • Custom field clears (custom_field_cleared).
      • Tag additions and removals (tag_added, tag_removed).
      • Sequence subscriptions and unsubscriptions (sequence_subscribed, sequence_unsubscribed).
      • Flow start triggers (flow_triggered).
      • Conversation status changes (conversation_status_changed for archive/unarchive step actions).
  • Inbox UI & Visual Presentation (Builder):
    • Added <ActivityMessageItem> component in apps/builder to render centered system logs with dashed border dividers and border collapse (-mt-px).
    • Added showSystemEvents state in chat-store and an Activity toggle button in MessageHead to allow operators to show or hide system events on demand.
    • Formatted multi-line changes (e.g. previous vs new values) in clean, centered blocks with bold labels.
  • i18n & Localization:
    • Fully localized in English (en.json) and Spanish (es.json) under messages.activity.*.
  • Testing:
    • Added unit test in packages/business/__tests__/message-service.test.ts for messageService.createActivity verifying repository creation and PartyKit broadcast.

How to Test

  1. Connect a channel (e.g. WhatsApp, Messenger, or Webchat) and start a conversation.
  2. Trigger an automation flow that updates custom fields or adds/removes tags.
  3. Open the Inbox conversation view:
    • Verify that system events appear chronologically as clean, centered, full-width blocks separated by dashed lines.
    • Verify that custom field updates display previous vs new values.
    • Verify that the toggle button in the chat header shows/hides system events as expected.
image

@github-actions github-actions Bot added the feature New feature or request label Sep 13, 2026
@JuanBifrost
JuanBifrost force-pushed the feat/inbox-activity-timeline branch 3 times, most recently from fe844fc to 36a7441 Compare September 13, 2026 16:53
…nbox

- Add messageService.createActivity for system activity messages and PartyKit realtime broadcast
- Record activity events in worker during flow execution (custom fields, tags, sequences, flow triggers, conversation archive/unarchive)
- Add ActivityMessageItem component in builder UI with centered layout and clean dashed event dividers
- Add chat-store showSystemEvents state and header toggle button in MessageHead
- Add activity translation keys across all 20 locales for complete i18n key parity
- Add unit test for createActivity in message-service.test.ts
@JuanBifrost
JuanBifrost force-pushed the feat/inbox-activity-timeline branch from 36a7441 to c2f01fa Compare September 13, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant