Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

✅ Checklist

  • 🧪 The component is unit tested
  • 🧪 The component includes E2E tests - N/A for internal components, tested through parent components
  • 🗑️ Old Cypress tests exclusive to the component are removed - None existed
  • 📖 The component is documented in storybook with an .mdx file - N/A for internal components
  • ♿ The component complies with the Web Content Accessibility Guidelines.
  • 🌐 All strings intended for humans or assistive technology must be localized with i18n.
  • 📦 The Lit component is exported in the appropriate index.ts and lazy-index.ts files - Auto-registered via @customElement
  • 🎨 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 - Removed to avoid conflict with Stencil-generated types during transition

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

Description

Migrated atomic-smart-snippet-source from Stencil to Lit. This internal component renders source URL and title links for smart snippets across search and insight interfaces.

Changes

Component Migration

  • Light DOM preservation: Applied LightDomMixin to match Stencil's shadow: false
  • Event handling: Custom events (selectSource, beginDelayedSelectSource, cancelPendingSelectSource) now use Lit's buildCustomEvent
  • Link rendering: Migrated to use Lit-based renderLinkWithItemAnalytics functional component
  • Result context: Event listener pattern for atomic/resolveResult replaces Stencil's @Listen decorator
  • Directory structure: Organized into atomic-smart-snippet-source/ with Stencil version preserved as stencil-atomic-smart-snippet-source.tsx

Testing

15 unit tests covering initialization, rendering, event dispatch, result context, attribute application, and cleanup. No E2E or Storybook artifacts needed—internal component tested through parent smart-snippet components.

Technical Notes

Component serves as a child element in:

  • atomic-smart-snippet / atomic-smart-snippet-suggestions (search)
  • atomic-insight-smart-snippet / atomic-insight-smart-snippet-suggestions (insight)

HTMLElementTagNameMap declaration intentionally omitted to prevent type conflicts with Stencil-generated definitions during the migration period.

Original prompt

This section details on the original issue you should resolve

<issue_title>Migrate atomic-smart-snippet-source</issue_title>
<issue_description>

Jira Issue: KIT-5063

Type: Story
Status: New
Priority: Medium


Comments on the Issue (you are @copilot in this section)

Custom agent used: StencilToLitMigrationV1
Specialized agent for migrating Atomic Stencil code to Lit (components, functional components, and utils)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Migrate atomic-smart-snippet-source feat(atomic): migrate atomic-smart-snippet-source to Lit Dec 16, 2025
Copilot AI requested a review from y-lakhdar December 16, 2025 20:04
…com:coveo/ui-kit into copilot/migrate-atomic-smart-snippet-source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate atomic-smart-snippet-source

2 participants