Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 20, 2025

Migration Plan: SmartSnippet Feedback Modal Functional Components

This is a Functional Component Migration (not a custom element migration).

Components to Migrate

Located in /packages/atomic/src/components/common/smart-snippets/atomic-smart-snippet-feedback-modal/:

  • SmartSnippetFeedbackModalHeader - Renders feedback modal header
  • SmartSnippetFeedbackModalBody - Renders form body wrapper
  • SmartSnippetFeebackModalOptions - Renders fieldset for feedback options (note: typo in name)
  • SmartSnippetFeedbackModalOption - Renders individual radio button option
  • SmartSnippetFeedbackModalDetails - Renders textarea for additional details
  • SmartSnippetFeedbackModalFooter - Renders footer with cancel/submit buttons

Migration Steps

  • Analyze current Stencil functional components and dependencies
  • Create Lit versions of all functional components (smart-snippet-feedback-modal.ts)
  • Rename original Stencil file with stencil- prefix (stencil-smart-snippet-feedback-modal-common.tsx)
  • Update imports in parent components (search and insight variants)
  • Fix linting issues (removed unused import)
  • Generate comprehensive Vitest unit tests
  • Run linting and build to validate changes
  • Clean up and finalize

Parent Components (Stencil - not migrating)

These components now import from the renamed stencil file:

  • atomic-smart-snippet-feedback-modal (search)
  • atomic-insight-smart-snippet-feedback-modal (insight)

Dependencies

  • renderButton - Lit version used in new components
  • ✅ Build succeeds - no blockers identified
  • ✅ Linting passes
Original prompt

This section details on the original issue you should resolve

<issue_title>Migrate / refactor SmartSnippetFeedbackModal* functional components</issue_title>
<issue_description>

Jira Issue: KIT-5057

Type: User Story
Status: New
Priority: Medium


Description

  • SmartSnippetFeedbackModalHeader
  • SmartSnippetFeedbackModalBody
  • SmartSnippetFeedbackModalOptions
  • SmartSnippetFeedbackModalOption
  • SmartSnippetFeedbackModalDetails
  • SmartSnippetFeedbackModalFooter

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

Custom agent used: stencil-to-lit-migration-agent
Specialized agent for migrating Atomic Stencil code to Lit (components, functional components, and utils)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits November 20, 2025 14:06
@alexprudhomme alexprudhomme changed the title [WIP] Migrate and refactor SmartSnippetFeedbackModal functional components refactor(atomic): refactor SmartSnippetFeedbackModal functional components Nov 20, 2025
@alexprudhomme alexprudhomme marked this pull request as ready for review November 20, 2025 18:20
@alexprudhomme alexprudhomme requested review from a team as code owners November 20, 2025 18:20
Copilot finished reviewing on behalf of alexprudhomme November 20, 2025 18:22
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 six SmartSnippet Feedback Modal functional components from Stencil to Lit. The migration follows the established pattern of creating new Lit versions with a render* naming convention while preserving the original Stencil versions with a stencil- prefix for backward compatibility. Comprehensive unit tests were added for all migrated components.

Key Changes

  • Created Lit functional components: All six functional components (Header, Body, Options, Option, Details, Footer) were migrated to Lit with proper TypeScript types and reactive directives
  • Preserved Stencil versions: Original components were renamed with stencil- prefix to maintain compatibility with existing parent components
  • Added comprehensive tests: Each functional component has thorough unit test coverage following Vitest conventions

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
stencil-smart-snippet-feedback-modal-common.tsx Renamed original Stencil file with deprecation notices
modal-header.ts New Lit functional component for modal header
modal-body.ts New Lit functional component for form body wrapper
modal-options.ts New Lit functional component for options fieldset
modal-option.ts New Lit functional component for individual radio option
modal-details.ts New Lit functional component for details textarea (has issues)
modal-footer.ts New Lit functional component for footer with buttons
feedback-options.ts Extracted feedback options data structure
*.spec.ts (7 files) Comprehensive unit tests for all components
atomic-smart-snippet-feedback-modal.tsx Updated import path to renamed Stencil file
atomic-insight-smart-snippet-feedback-modal.tsx Updated import path to renamed Stencil file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

name="answer-details"
${detailsInputRef ? ref(detailsInputRef) : ''}
class="border-neutral mt-2 w-full resize-none rounded border p-2 text-base leading-5"
rows="4"
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The rows attribute should be a number, not a string. Use rows=${4} instead of rows="4" to maintain type consistency with Lit's property binding.

Suggested change
rows="4"
rows=${4}

Copilot uses AI. Check for mistakes.
<textarea
part="details-input"
name="answer-details"
${detailsInputRef ? ref(detailsInputRef) : ''}
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The conditional ref directive pattern ${detailsInputRef ? ref(detailsInputRef) : ''} is problematic. When detailsInputRef is undefined, this renders an empty string in the template, which can cause rendering issues. Use ${detailsInputRef ? ref(detailsInputRef) : nothing} instead, importing nothing from lit.

Copilot uses AI. Check for mistakes.
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 / refactor SmartSnippetFeedbackModal* functional components

2 participants