refactor: correct event naming and payload handling#25
refactor: correct event naming and payload handling#25Zoltan Hricz (hriczzoli) merged 7 commits intomainfrom
Conversation
Zoltan Hricz (hriczzoli)
commented
Mar 23, 2026
- align event naming
- remove Event "unwrapping" for the React component
There was a problem hiding this comment.
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 inCortiEmbedded. - Update React wrapper typings/handlers so
onEventreceives the rawCustomEvent. - 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.
Morten Barklund (barklund)
left a comment
There was a problem hiding this comment.
It's so hard to read the diff with all these quote changes, but I think I found the interesting bits...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.