Skip to content

auto-open chat window on email submission#1545

Merged
akshaydeo merged 1 commit intomainfrom
02-03-auto-open_chat_window_on_email_submission
Feb 3, 2026
Merged

auto-open chat window on email submission#1545
akshaydeo merged 1 commit intomainfrom
02-03-auto-open_chat_window_on_email_submission

Conversation

@akshaydeo
Copy link
Contributor

@akshaydeo akshaydeo commented Feb 3, 2026

Summary

Added automatic chat opening after email submission in the support widget and introduced audit logs configuration schema.

Changes

  • Added openChatWhenReady() function to the support widget that attempts to open the Pylon chat window once the widget is ready
  • Modified the email submission handler to automatically open the chat after successful email submission
  • Added audit logs configuration schema to the transports config with options for disabling and setting an HMAC key

Type of change

  • Feature
  • Documentation

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Docs

How to test

  1. Test the support widget chat auto-opening:

    • Submit an email in the support widget
    • Verify the chat window opens automatically after submission
  2. Test the audit logs configuration:

    • Add audit logs configuration to your config file:
    audit_logs:
      disabled: false
      hmac_key: "your-secret-key-at-least-32-bytes-long"
    • Verify the configuration is properly parsed

Breaking changes

  • No

Security considerations

The audit logs feature introduces an HMAC key configuration for signing audit events. This key should be kept secure and should be at least 32 bytes long. The configuration supports loading the key from environment variables for better security practices.

Checklist

  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Chat widget now automatically opens after user setup is complete.
    • Added audit logging configuration options with HMAC key support for signing audit events.

Walkthrough

Two distinct additions: a support widget enhancement that automatically opens the chat interface once the Pylon service is available using polling with retry logic, and a new audit logging configuration schema defining CADF-compliant audit event settings with HMAC signing capabilities.

Changes

Cohort / File(s) Summary
Chat Widget Auto-Open
docs/supportWidget.js
Added openChatWhenReady() function that polls for Pylon availability (up to 20 retries at 300ms intervals) and opens the chat widget once ready, triggered after successful user setup.
Audit Logging Schema
transports/config.schema.json
Introduced audit_logs_config definition with disabled (boolean, default false) and hmac_key (string) properties, exposed as new root property audit_logs for CADF-compliant audit logging configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A chat that waits with patient care,
Polling thrice and more to spare,
Audit trails now signed with keys,
Security flows through the breeze!

🚥 Pre-merge checks | ✅ 2 | ❌ 3
❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR changes (chat widget auto-open and audit logs config) do not align with the linked issue #123 requirement for File APIs support for providers. Either link the correct issues related to chat widget and audit logs features, or implement the File APIs support specified in issue #123.
Out of Scope Changes check ⚠️ Warning The audit logs configuration schema change in transports/config.schema.json appears unrelated to the PR title about auto-opening the chat window. Remove the audit logs schema changes or clarify their relationship to the chat window feature, or create a separate PR for audit logs configuration.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: auto-opening the chat window after email submission in the support widget.
Description check ✅ Passed The description covers Summary, Changes, Type of change, Affected areas, How to test, Breaking changes, and Security considerations, though some sections lack concrete details.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 02-03-auto-open_chat_window_on_email_submission

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@akshaydeo akshaydeo marked this pull request as ready for review February 3, 2026 17:19
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1545

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@transports/config.schema.json`:
- Around line 2539-2553: The audit_logs_config currently allows missing or short
hmac_key values despite the description; add "minLength": 32 to the "hmac_key"
property and enforce that hmac_key is required when audit logging is enabled
(i.e., when "disabled" is false or absent). Implement this via a JSON Schema
conditional on audit_logs_config: add "hmac_key":
{"type":"string","minLength":32,...} and add an "if":
{"properties":{"disabled":{"const":false}},"then":{"required":["hmac_key"]}} (or
equivalent where missing defaults to false) so that audit_logs_config.hmac_key
must be present and at least 32 bytes when logging is enabled.

@akshaydeo akshaydeo merged commit ecb33f5 into main Feb 3, 2026
12 checks passed
@akshaydeo akshaydeo deleted the 02-03-auto-open_chat_window_on_email_submission branch February 3, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant