Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Description

The Bueno validation schema in AtomicColorFacet was instantiated in the constructor on every component creation. This refactors it to a private static readonly class member, following the pattern established in atomic-result-timespan.

Additionally, the headingLevel property documentation has been clarified to accurately reflect that a value of 0 is valid and renders a div instead of a heading element.

Changes

  • Moved schema definition from constructor to private static readonly propsSchema class member
  • Updated ValidatePropsController to reference AtomicColorFacet.propsSchema
  • Updated headingLevel property documentation to clarify that 0 is a valid value that renders a div instead of a heading element

Before:

constructor() {
  super();
  new ValidatePropsController(
    this,
    () => ({...}),
    new Schema({...}),  // Created per instance
    false
  );
}

After:

private static readonly propsSchema = new Schema({...});  // Created once

constructor() {
  super();
  new ValidatePropsController(
    this,
    () => ({...}),
    AtomicColorFacet.propsSchema,
    false
  );
}

✅ Checklist

  • 🧪 The component is unit tested
  • 🧪 The component includes E2E tests
  • 🗑️ Old Cypress tests exclusive to the component are removed
  • 📖 The component is documented in storybook with an .mdx file
  • ♿ 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.
  • 🎨 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
Original prompt

This section details on the original issue you should resolve

<issue_title>[Atomic]: atomic-color-facet validation schema should be defined as private static readonly</issue_title>
<issue_description>### Task Description

Right now a new instance of the Bueno validation schema object is re-created every time the AtomicColorFacet constructor is called, which is wasteful (especially if there are multiple atomic-color-facet components in the same page).

Follow the pattern in atomic-result-timespan and declare the propsSchema as a private static readonly member of the class instead.

Acceptance Criteria

  • The atomic-result-timespan Bueno schema is declared as a private static readonly member of the class.
  • The build passes.
  • All tests pass without any modifications.

Technical Notes

Jira Ticket

No response</issue_description>

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


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

Copilot AI changed the title [WIP] Refactor atomic-color-facet validation schema to static readonly Refactor atomic-color-facet validation schema to static readonly Dec 11, 2025
Copilot AI requested a review from fbeaudoincoveo December 11, 2025 19:57
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@fbeaudoincoveo fbeaudoincoveo changed the title Refactor atomic-color-facet validation schema to static readonly refactor(atomic): declare atomic-color-facet validation schema as private static readonly member Dec 15, 2025
@fbeaudoincoveo fbeaudoincoveo changed the title refactor(atomic): declare atomic-color-facet validation schema as private static readonly member refactor(atomic): declare/instantiate atomic-color-facet validation schema as private static readonly member Dec 15, 2025
@fbeaudoincoveo fbeaudoincoveo changed the title refactor(atomic): declare/instantiate atomic-color-facet validation schema as private static readonly member refactor(atomic): declare/instantiate atomic-color-facet validation schema as private static readonly class member Dec 15, 2025
Copilot AI temporarily deployed to Prerelease (CDN) December 15, 2025 16:32 Inactive
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


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

@fbeaudoincoveo fbeaudoincoveo added this pull request to the merge queue Dec 16, 2025
Merged via the queue into main with commit 1e6f437 Dec 16, 2025
109 checks passed
@fbeaudoincoveo fbeaudoincoveo deleted the copilot/refactor-atomic-color-facet-schema branch December 16, 2025 14:18
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.

[Atomic]: atomic-color-facet validation schema should be defined as private static readonly

3 participants