Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Migration complete with all feedback addressed:

Component Changes:

  • Moved from /facets/atomic-timeframe-facet/ to /search/atomic-timeframe-facet/
  • Deleted stencil-atomic-timeframe-facet.tsx and atomic-timeframe-facet.pcss
  • Updated prop validation to use static readonly schema pattern
  • Reduced validated props to: injectionDepth, headingLevel, min, max, sortCriteria
  • Added biome-ignore comments for conditional bindStateToController decorators

Test Changes:

  • Updated describe block naming: 'when rendering (#render)' and 'props'
  • Removed unnecessary nested describe blocks in prop validation tests
  • Combined describe blocks in lifecycle and interactions sections
  • Updated disconnectedCallback test naming: 'when removed from the DOM (#disconnectedCallback)'

Export Changes:

  • Updated export path in search/index.ts
Original prompt

This section details on the original issue you should resolve

<issue_title>Migrate atomic-timeframe-facet</issue_title>
<issue_description>

Jira Issue: KIT-4960

Type: User Story
Status: New
Priority: Medium
Components: Atomic


<agent_instructions>For e2e testing / storybook MSW mocking, I suggest you look at patterns in atomic-color-facet. Not quite the same, but similar. The e2e "happy path" for timeframe facet should be relatively similar, i.e., the facet renders, selecting a value works, facet search works. I don't think we need to cover show more / show less for atomic-timeframe-facet.

For the component itself, you can look at patterns in the commerce equivalent (atomic-commerce-timeframe-facet).

For unit tests, again you should look at patterns in atomic-color-facet (e.g., you'll see how we do / test prop validation, how we mock the console, etc.)</agent_instructions>

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-timeframe-facet Migrate atomic-timeframe-facet from Stencil to Lit Dec 9, 2025
Copilot AI requested a review from fbeaudoincoveo December 9, 2025 19:34
@fbeaudoincoveo fbeaudoincoveo changed the title Migrate atomic-timeframe-facet from Stencil to Lit refactor(atomic: migrate atomic-timeframe-facet from Stencil to Lit Dec 10, 2025
@fbeaudoincoveo fbeaudoincoveo changed the title refactor(atomic: migrate atomic-timeframe-facet from Stencil to Lit refactor(atomic): migrate atomic-timeframe-facet from Stencil to Lit Dec 10, 2025
tabsExcluded: this.tabsExcluded,
dependsOn: this.dependsOn,
}),
new Schema({
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot do like in atomic-color-facet: declare the schema as a static private readonly member of the class so that it's only declared once even if there are multiple facet instances in the same page.

Also, I wouldn't include tabsInclude, tabsExcluded and dependsOn in the prop validation. We should validate the following props:

  • injectionDepth
  • headingLevel
  • min
  • max
  • sortCriteria

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926. The schema is now declared as a static private readonly member, and prop validation only includes injectionDepth, headingLevel, min, max, and sortCriteria.

};
};

describe('#render', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot

Suggested change
describe('#render', () => {
describe('when rendering (#render)', () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926.

});
});

describe('#props', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
describe('#props', () => {
describe('props', () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926.

});
});

describe('#lifecycle', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot remove describe wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926. The describe wrapper has been removed.

});

describe('#lifecycle', () => {
describe('disconnectedCallback', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot

Suggested change
describe('disconnectedCallback', () => {
describe('when removed from the DOM (#disconnectedCallback)', () => {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926.

});
});

describe('#interactions', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot remove describe wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926. The describe wrapper has been removed and tests merged into parent describe block.

});
});

describe('#controllers', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot remove describe wrapper

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926. The describe wrapper has been removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot this file must be deleted, not renamed.

also, the atomic-timeframe-facet.pcss file must be deleted as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926. Both stencil-atomic-timeframe-facet.tsx and atomic-timeframe-facet.pcss have been deleted.

@state() bindings!: Bindings;
@state() error!: Error;

@bindStateToController('facetForDateRange')
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot

Suggested change
@bindStateToController('facetForDateRange')
// biome-ignore lint/suspicious/noExplicitAny: bindStateToController requires non-optional Controller type, but these controllers are conditionally created based on component configuration
@bindStateToController('facetForDateRange' as any)

similar comment for the facetForDatePicker and filter bindStateToController decorators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in commit 0e2d926. Added biome-ignore comments for all three conditional bindStateToController decorators (facetForDateRange, facetForDatePicker, and filter).

…ation

- Move atomic-timeframe-facet directory from /facets to /search level
- Delete stencil-atomic-timeframe-facet.tsx and atomic-timeframe-facet.pcss files
- Update prop validation to use static readonly schema and only validate specific props (injectionDepth, headingLevel, min, max, sortCriteria)
- Add biome-ignore comments for conditional bindStateToController decorators
- Restructure test describe blocks: remove unnecessary wrappers, update naming conventions, combine nested describe blocks

Co-authored-by: fbeaudoincoveo <[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-timeframe-facet

2 participants