refactor(atomic): migrate atomic-insight-facet from Stencil to Lit#6972
refactor(atomic): migrate atomic-insight-facet from Stencil to Lit#6972fbeaudoincoveo merged 31 commits intomainfrom
Conversation
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
|
@copilot There are several ts errors in atomic-insight-facet.ts. Also atomic-insight-facet.tsx has not been deleted, nor has atomic-insight-facet.pcss. This should be done. For the pcss file, double check to ensure that the static styles property in the migrated component is fully equivalent. Once the old files have been deleted, and the necessary adjustments have been made to make the build pass, continue to the next step (creating Storybook stories). |
…tomic-insight-facet Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
Fixed in commit 37b563e: TypeScript errors fixed:
Old files deleted:
The build now passes successfully. Proceeding to create Storybook stories next. |
… mocking Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
…ght-facet Co-authored-by: fbeaudoincoveo <23503066+fbeaudoincoveo@users.noreply.github.com>
This reverts commit ace2c07.
There was a problem hiding this comment.
Pull request overview
Migrates atomic-insight-facet from the legacy Stencil implementation to a Lit-based implementation and wires it into Atomic’s Insight exports, Storybook, and test infrastructure.
Changes:
- Replaced the Stencil
atomic-insight-facetwith a new Lit implementation (Tailwind styles, bindings, lifecycle updates). - Added Vitest unit tests, Playwright E2E coverage scaffolding, and Storybook stories + MDX docs for the migrated component.
- Updated Insight exports/lazy loading, custom element tag registry, and Storybook Insight mock response data; removed the old Stencil files and Stencil-generated type entries.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/atomic/vitest-utils/testing-helpers/fixtures/headless/insight/facet-controller.ts | Adds a fake Insight facet controller fixture used by the new unit tests. |
| packages/atomic/vitest-utils/testing-helpers/fixtures/headless/insight/facet-conditions-manager.ts | Adds a fake Insight facet conditions manager fixture for unit tests. |
| packages/atomic/storybook-utils/api/insight/search-response.ts | Extends the Insight mock search response with an objecttype facet for stories/tests. |
| packages/atomic/src/utils/custom-element-tags.ts | Registers atomic-insight-facet in the custom element tag set. |
| packages/atomic/src/components/insight/lazy-index.ts | Adds lazy-loading entry for atomic-insight-facet. |
| packages/atomic/src/components/insight/index.ts | Exports the Lit AtomicInsightFacet class from the Insight index. |
| packages/atomic/src/components/insight/atomic-insight-facet/e2e/page-object.ts | Introduces a Playwright page object for the component’s E2E tests. |
| packages/atomic/src/components/insight/atomic-insight-facet/e2e/fixture.ts | Adds a Playwright fixture wiring the page object. |
| packages/atomic/src/components/insight/atomic-insight-facet/e2e/atomic-insight-facet.e2e.ts | Adds initial Playwright E2E tests for the component. |
| packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.tsx | Removes the old Stencil implementation. |
| packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.ts | Adds the new Lit implementation of atomic-insight-facet. |
| packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.spec.ts | Adds Vitest unit tests for the new Lit component. |
| packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.pcss | Removes the old Stencil/PostCSS styles. |
| packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.new.stories.tsx | Adds Storybook stories for the migrated component. |
| packages/atomic/src/components/insight/atomic-insight-facet/atomic-insight-facet.mdx | Adds Storybook MDX documentation for the component. |
| packages/atomic/src/components.d.ts | Removes Stencil-generated typings for atomic-insight-facet (now Lit-based). |
| .claude/skills/creating-stories/SKILL.md | Updates internal Storybook/story creation guidance documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
✅ Checklist
.mdxfileindex.tsandlazy-index.tsfiles.https://coveord.atlassian.net/browse/KIT-4853
Description
Migrates
atomic-insight-facetfrom Stencil to Lit with complete test coverage, Storybook documentation, and accessibility compliance.Changes
Component Migration
@customElement,@bindings(),@withTailwindStylesdecoratorswillUpdate,render,disconnectedCallback)htmltemplate literalswhen()directive for conditional rendering instead ofFacetGuard@/src/path aliases (no relative../imports except parent interface)HTMLElementTagNameMapdeclaration for type safety@internaltag from JSDoc to make component publicly documented and Storybook-compatibleprivate static readonlyclass member following best practicesFacetResultsMustMatchimport from@coveo/headless/insightto@coveo/headlessFocusTargetControllerconstructor calls to include requirednameparameterAriaLiveRegionControllerusage to use.messageproperty instead of.announce()methodheaderRefandsetRefatomic-insight-facet.tsx,atomic-insight-facet.pcss)Unit Tests
facet-controller.ts,facet-conditions-manager.ts)Storybook Stories
atomic-insight-facet.new.stories.tsxwith MSW API mockingMockInsightApifor proper API response mockingwrapInInsightInterfacefor proper Insight interface context@internaltag to enable Storybook documentationE2E Tests
e2e/directory:fixture.ts- Test fixture with InsightFacet page objectpage-object.ts- Page object with locators for facet elements (expand buttons, facet values, show more/less, clear button)atomic-insight-facet.e2e.ts- E2E tests covering:MDX Documentation
atomic-insight-facet.mdxwith comprehensive documentation:Cypress Tests
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.