[CDX-376] Emit events on user interaction#35
Conversation
This comment has been minimized.
This comment has been minimized.
Mudaafi
left a comment
There was a problem hiding this comment.
Liked what you did here, but I have some concerns over where we're emitting the events from and what we're expecting to happen. Might just be me misunderstanding the requirements but lmk what you think.
src/utils/events.ts
Outdated
| canScrollNext: boolean; | ||
| canScrollPrev: boolean; |
There was a problem hiding this comment.
should this just be canScroll or do we need both indicators?
There was a problem hiding this comment.
I think it needs both, no?
There was a problem hiding this comment.
Why would it need both? Isn't the event fired a nav event in a particular direction so shouldn't only the canScroll in that direction be relevant?
There was a problem hiding this comment.
Maybe I'm missing something but let's say I scroll to a side, I was thinking the event would tell the listener if there is still more room to scroll to next or prev. However, I just noticed the implementation is wrong and the event emits the previous state rather than current. I will just remove these
* Emit on component rather than window * Lint and types * add comments * Add docs * Fix MDX table issue * Lint * Remove rootRef * Remove refs * Revert export style
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 20 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
Mudaafi
left a comment
There was a problem hiding this comment.
lgtm, thanks for making the changes. I like the event log in the stories
Code Review Results✅ StrengthsThe pub-sub event system is well-architected: a frozen 🚨 Critical Issues
|
Pull Request Checklist
Before you submit a pull request, please make sure you have to following:
PR Type
What kind of change does this PR introduce?
Events to Emit:
Product Card is Clicked - cio.components.productCard.click
Product is converted - cio.components.productCard.conversion
Image is hovered - cio.components.productCard.imageEnter / cio.components.productCard.imageLeave
Carousel next button is clicked - cio.components.carousel.next
Carousel prev button is clicked - cio.components.carousel.previous
Continued here