chore(atomic): migrate atomic-insight-result-action to Lit#7172
chore(atomic): migrate atomic-insight-result-action to Lit#7172fbeaudoincoveo merged 15 commits intomainfrom
Conversation
- Migrate component from Stencil to Lit - Remove @internal annotation to make component public - Add unit tests (12 tests) - Add Storybook stories (7 stories) - Add MDX documentation - Add E2E tests (3 tests) - Fix pre-existing CSS reference issues in atomic-insight-user-actions-timeline and atomic-insight-user-actions-session
There was a problem hiding this comment.
Pull request overview
This PR migrates the atomic-insight-result-action component from Stencil to Lit, following the established migration pattern for Atomic components. The migration includes new unit tests, E2E tests, Storybook stories, and MDX documentation. Additionally, the PR includes several scout improvements: timeout cleanup in disconnectedCallback, null-result guards, and corrected Tailwind @reference paths in related components.
Changes:
- Migrated
atomic-insight-result-actionfrom Stencil (.tsx) to Lit (.ts) with proper lifecycle management and event handling - Added comprehensive unit tests covering rendering, event emission, analytics, tooltip behavior, and keyboard accessibility
- Added E2E tests with page object pattern for visual regression testing
- Created Storybook stories (Default and InActionBar variants) with comprehensive documentation in MDX format
- Fixed timeout memory leak by adding cleanup in
disconnectedCallback - Added null-result guards in
render()andonClick()methods - Corrected Tailwind
@referencepaths inatomic-insight-user-actions-timelineandatomic-insight-user-actions-session
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| atomic-insight-result-action.ts | Complete rewrite from Stencil to Lit with timeout cleanup and null guards |
| atomic-insight-result-action.spec.ts | New comprehensive unit tests covering all component behaviors |
| atomic-insight-result-action.e2e.ts | New E2E tests with page object pattern |
| atomic-insight-result-action.new.stories.tsx | Storybook stories with two variants (Default and InActionBar) |
| atomic-insight-result-action.mdx | Complete documentation including usage examples and event handling |
| index.ts / lazy-index.ts | Added component exports for proper tree-shaking |
| custom-element-tags.ts | Registered component tag in the allowlist |
| atomic-insight-user-actions-timeline.ts | Fixed incorrect Tailwind @reference path |
| atomic-insight-user-actions-session.ts | Added missing Tailwind @reference import |
| components.d.ts | Removed Stencil-generated type definitions |
| check-no-new-light-dom-components.mjs | Added component to allowed light DOM components list |
...s/atomic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.ts
Outdated
Show resolved
Hide resolved
...s/atomic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.ts
Outdated
Show resolved
Hide resolved
...s/atomic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.ts
Show resolved
Hide resolved
...mic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.spec.ts
Show resolved
Hide resolved
|
@fbeaudoincoveo I've opened a new pull request, #7175, to work on those changes. Once the pull request is ready, I'll request review from you. |
…ction/atomic-insight-result-action.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@fbeaudoincoveo I've opened a new pull request, #7176, to work on those changes. Once the pull request is ready, I'll request review from you. |
…follow convention (#7176) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
...s/atomic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.ts
Show resolved
Hide resolved
...s/atomic/src/components/insight/atomic-insight-result-action/atomic-insight-result-action.ts
Outdated
Show resolved
Hide resolved
…hub.com/coveo/ui-kit into alexprudhomme/insight-result-action-4hh
Summary
Migrates
atomic-insight-result-actionfrom Stencil to Lit, including new unit tests, E2E tests, Storybook stories, and MDX documentation.Scout camping 🏕️
Small improvements discovered during review, applied for parity or correctness:
setTimeoutused for the "Copied!" tooltip flash. AddeddisconnectedCallbackcleanup and rapid-click debounce (clearTimeoutbefore re-setting).render()andonClick()now bail early when the result context is unavailable, preventing runtime errors.@referencefix inatomic-insight-user-actions-timeline— corrected a wrong Tailwind@referencepath that pointed to a non-existent file.@referenceaddition inatomic-insight-user-actions-session— added the missing Tailwind@referenceimport.Editorial choices 📝
atomic-result-section-actions, hover-reveal inatomic-insight-result-action-bar) with markup examples.@internaltag intentionally removed — the Stencil original had@internal, but removing it is required for the component to appear in the custom elements manifest used by Storybook.static stylesover Tailwindclassprop — the component uses a[part='result-action-button']CSS selector to overriderenderIconButtondefaults (h-8 w-8vs the defaulth-[2.6rem] w-[2.6rem]). This is more reliable than Tailwind class composition, where conflicting utility classes have non-deterministic resolution based on stylesheet generation order.Default(with action dropdown control covering all 5 action types) andInActionBar(showing the hover-reveal placement). Per-action stories were redundant.✅ Checklist
🗑️ Old Cypress tests exclusive to the component are removedN/A: No Cypress tests existed for this component.mdxfile🌐 All strings intended for humans or assistive technology must be localized with i18n.N/A: No user-facing strings; tooltip text is consumer-provided via propsindex.tsandlazy-index.tsfiles.https://coveord.atlassian.net/browse/KIT-5482