Skip to content

refactor: correct event naming and payload handling#25

Merged
Zoltan Hricz (hriczzoli) merged 7 commits intomainfrom
refactor-event-system-naming-conventions
Apr 1, 2026
Merged

refactor: correct event naming and payload handling#25
Zoltan Hricz (hriczzoli) merged 7 commits intomainfrom
refactor-event-system-naming-conventions

Conversation

@hriczzoli
Copy link
Copy Markdown
Contributor

  • align event naming
  • remove Event "unwrapping" for the React component

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 aligns the generic embedded event stream naming across the web component and React wrapper, and updates consumers/tests/docs to match the new event contract (React now receives the raw CustomEvent instead of an unwrapped detail object).

Changes:

  • Rename the generic event stream from "embedded-event" to "event" and update dispatch logic in CortiEmbedded.
  • Update React wrapper typings/handlers so onEvent receives the raw CustomEvent.
  • Update tests, demos, and documentation to use the renamed event stream and new payload handling.

Reviewed changes

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

Show a summary per file
File Description
test/corti-embedded.test.ts Updates tests to listen for "event" and validate updated event forwarding behavior.
src/react/CortiEmbeddedReact.ts Changes onEvent to pass through the raw CustomEvent and listens on "event".
src/CortiEmbedded.ts Renames generic stream to "event" and keeps suppressing "ready"/"loaded" from forwarding.
docs/react-usage.md Updates React usage docs to reflect raw CustomEvent handling and "event" stream.
demo/react-demo.tsx Updates demo’s event handler to read from event.detail.
demo/demo.ts Updates vanilla demo to listen on "event" stream.
README.md Updates documentation to reference "event" stream and raw CustomEvent (with one remaining mismatch noted in comments).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread demo/react-demo.tsx
Comment thread demo/demo.ts
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's so hard to read the diff with all these quote changes, but I think I found the interesting bits...

Comment thread demo/demo.ts
Comment thread src/react/CortiEmbeddedReact.ts Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread docs/react-usage.md Outdated
Comment thread README.md Outdated
Comment thread docs/react-usage.md
Comment thread src/react/CortiEmbeddedReact.ts Outdated
Comment thread test/react-corti-embedded.test.ts Outdated
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread demo/demo.ts
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Comment thread src/react/CortiEmbeddedReact.ts Outdated
Comment thread src/react/CortiEmbeddedReact.ts Outdated
Comment thread src/CortiEmbedded.ts
Comment thread README.md Outdated
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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/react/CortiEmbeddedReact.ts
Comment thread test/corti-embedded.test.ts
@hriczzoli Zoltan Hricz (hriczzoli) merged commit 6ee4353 into main Apr 1, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants