Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Migrates atomic-smart-snippet-expandable-answer from Stencil to Lit framework as part of the ongoing framework migration effort.

Changes

  • Component migration: Converted Stencil .tsx to Lit .ts with proper decorators (@customElement, @bindings(), @withTailwindStyles)
  • Styles: Migrated PostCSS to embedded CSS with Tailwind classes in template
  • Imports: Converted all relative imports to path aliases (@/src/*)
  • Type safety: Implements InitializableComponent<AnyBindings> interface
  • Lifecycle: Migrated to Lit lifecycle methods (firstUpdated(), updated())
  • Events: Custom event dispatching with proper bubbling and composition
  • Unit tests: Comprehensive Vitest test suite covering props, events, rendering, and CSS custom properties

Technical Details

Internal component used by atomic-smart-snippet and atomic-insight-smart-snippet. Preserves all functionality:

  • Dynamic height calculation with firstUpdated() hook
  • Expand/collapse button visibility based on content height threshold
  • Event forwarding from child atomic-smart-snippet-answer
  • CSS custom properties (--full-height, --collapsed-size)
  • Prop validation (maximumHeight ≥ collapsedHeight)
@customElement('atomic-smart-snippet-expandable-answer')
@bindings()
@withTailwindStyles
export class AtomicSmartSnippetExpandableAnswer
  extends LitElement
  implements InitializableComponent<AnyBindings>
{
  @property({type: Boolean, reflect: true}) expanded!: boolean;
  @property({type: Number, reflect: true}) maximumHeight = 250;
  @state() private fullHeight?: number;
  
  protected async firstUpdated(): Promise<void> {
    this.fullHeight = await this.establishInitialHeight();
  }
}

No Storybook stories or E2E tests added—internal component tested through parent component integration.

Original prompt

This section details on the original issue you should resolve

<issue_title>Migrate atomic-smart-snippet-expandable-answer</issue_title>
<issue_description>https://coveord.atlassian.net/browse/KIT-5061</issue_description>

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)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Migrate atomic smart snippet expandable answer feat(atomic): migrate atomic-smart-snippet-expandable-answer to Lit Dec 11, 2025
Copilot AI requested a review from y-lakhdar December 11, 2025 17:48
…om:coveo/ui-kit into copilot/migrate-atomic-smart-snippet-again
@y-lakhdar y-lakhdar added this pull request to the merge queue Dec 17, 2025
@y-lakhdar y-lakhdar removed this pull request from the merge queue due to a manual request Dec 17, 2025
@y-lakhdar y-lakhdar enabled auto-merge December 17, 2025 19:18
@y-lakhdar y-lakhdar added this pull request to the merge queue Dec 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 17, 2025
coveo-deployment-pipeline bot pushed a commit that referenced this pull request Dec 17, 2025
…6785)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: y-lakhdar <[email protected]>
Co-authored-by: ylakhdar <[email protected]>
Co-authored-by: developer-experience-bot[bot] <91079284+developer-experience-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
@y-lakhdar y-lakhdar added this pull request to the merge queue Dec 17, 2025
Merged via the queue into main with commit e18bb76 Dec 17, 2025
98 checks passed
@y-lakhdar y-lakhdar deleted the copilot/migrate-atomic-smart-snippet-again branch December 17, 2025 20:24
watallah pushed a commit that referenced this pull request Dec 18, 2025
…6785)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: y-lakhdar <[email protected]>
Co-authored-by: ylakhdar <[email protected]>
Co-authored-by: developer-experience-bot[bot] <91079284+developer-experience-bot[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
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-expandable-answer

3 participants