Skip to content

chore(atomic): migrate atomic-insight-result-action to Lit#7172

Merged
fbeaudoincoveo merged 15 commits intomainfrom
alexprudhomme/insight-result-action-4hh
Feb 26, 2026
Merged

chore(atomic): migrate atomic-insight-result-action to Lit#7172
fbeaudoincoveo merged 15 commits intomainfrom
alexprudhomme/insight-result-action-4hh

Conversation

@alexprudhomme
Copy link
Contributor

@alexprudhomme alexprudhomme commented Feb 25, 2026

Summary

Migrates atomic-insight-result-action from 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:

  • Tooltip reset timeout cleanup — the original Stencil component never cleared the setTimeout used for the "Copied!" tooltip flash. Added disconnectedCallback cleanup and rapid-click debounce (clearTimeout before re-setting).
  • Null-result guardrender() and onClick() now bail early when the result context is unavailable, preventing runtime errors.
  • @reference fix in atomic-insight-user-actions-timeline — corrected a wrong Tailwind @reference path that pointed to a non-existent file.
  • @reference addition in atomic-insight-user-actions-session — added the missing Tailwind @reference import.

Editorial choices 📝

  • JSDoc focuses on "what", MDX on "how" — the class-level JSDoc describes the component's purpose; the MDX Usage section shows both placement options (always-visible in atomic-result-section-actions, hover-reveal in atomic-insight-result-action-bar) with markup examples.
  • @internal tag 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 styles over Tailwind class prop — the component uses a [part='result-action-button'] CSS selector to override renderIconButton defaults (h-8 w-8 vs the default h-[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.
  • Stories trimmed to twoDefault (with action dropdown control covering all 5 action types) and InActionBar (showing the hover-reveal placement). Per-action stories were redundant.
  • E2E consolidated — a single happy-path test asserts all three parts are visible, rather than three separate tests checking one part each.

✅ Checklist

  • 🧪 The component is unit tested
  • 🧪 The component includes E2E tests
  • 🗑️ Old Cypress tests exclusive to the component are removed N/A: No Cypress tests existed for this component
  • 📖 The component is documented in storybook with an .mdx file
  • ♿ The component complies with the Web Content Accessibility Guidelines.
  • 🌐 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 props
  • 📦 The Lit component is exported in the appropriate index.ts and lazy-index.ts files.
  • 🎨 CSS parts are documented still accessible.
  • 🦥 Slotted Content, public methods and properties are documented
  • 🔄 The component outputs the same Angular output as before with Stencil
  • 🏷️ The component declares the component type in the HTMLElementTagNameMap

https://coveord.atlassian.net/browse/KIT-5482

- 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
Copy link
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 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-action from 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() and onClick() methods
  • Corrected Tailwind @reference paths in atomic-insight-user-actions-timeline and atomic-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

Copy link
Contributor

Copilot AI commented Feb 26, 2026

@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>
Copy link
Contributor

Copilot AI commented Feb 26, 2026

@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.

)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
…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>
Copy link
Contributor Author

@alexprudhomme alexprudhomme left a comment

Choose a reason for hiding this comment

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

Approved 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants