Discovery: CDS copilot genereted Loader experiment#1664
Discovery: CDS copilot genereted Loader experiment#1664helene-mccarron wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR provides a proof-of-concept conversion of the Clinical Design System Loader component into a web component, generated using Copilot. Key changes include the addition of new CSS styling, end-to-end tests for functionality and accessibility, and the generated web component code for the loader.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/web-components/src/components/va-loader/va-loader.css | Added CSS styling for the loader including animation, layout, and visual details. |
| packages/web-components/src/components/va-loader/test/va-loader.e2e.ts | Added new e2e tests for rendering, custom labels, dynamic text changes, and accessibility checks. |
| packages/web-components/src/components/va-loader/loader-generated.tsx | Introduced the web component implementation with rotation logic and dynamic label updates. |
| packages/storybook/stories/va-loader.stories.tsx | Added Storybook stories to demonstrate various loader configurations. |
| top: 45%; | ||
| left: 30%; | ||
| transform: translate(-50%, -50%); | ||
| font-family: Source Sans Pro Web, Helvetica Neue, Helvetica, Arial, sans |
There was a problem hiding this comment.
The generic font family should be 'sans-serif' instead of 'sans' to ensure proper font rendering.
| font-family: Source Sans Pro Web, Helvetica Neue, Helvetica, Arial, sans | |
| font-family: Source Sans Pro Web, Helvetica Neue, Helvetica, Arial, sans-serif |
| .vacds-loader { | ||
| position: relative; | ||
| width: 12.5rem; | ||
| height: 12.5rem |
There was a problem hiding this comment.
[nitpick] For stylistic consistency, add a trailing semicolon after the height property.
| height: 12.5rem | |
| height: 12.5rem; |
jamigibbs
left a comment
There was a problem hiding this comment.
There is functional base here that could continue to be built on but this work would need a lot more human attention to detail related to building out the style and Storybook previews.
There was a problem hiding this comment.
suggestion (blocking): The name of this file should be name of the component va-loader.tsx which would follow the current component-library pattern.
| /** | ||
| * @componentName Loader | ||
| * @maturityCategory review | ||
| * @maturityLevel development |
There was a problem hiding this comment.
suggestion (blocking): The maturityCategory and maturityLevel should follow these maturity scale values
| height: 12.5rem | ||
| } | ||
|
|
||
| .vacds-loader-border { |
There was a problem hiding this comment.
suggestion (blocking): Class naming should follow the naming conventions outlined here: https://design.va.gov/about/naming-conventions/
| position: absolute; | ||
| top: 0; | ||
| left: 0; | ||
| border: 1.25rem solid #f0f0f0; |
There was a problem hiding this comment.
suggestion (blocking): Colors should use VADS color tokens where possible. New colors should be evaluated for addition to the design system CSS-Library
| SetFocus.args = { ...defaultArgs, 'set-focus': true }; | ||
|
|
||
| export const EnableAnalytics = Template.bind(null); | ||
| EnableAnalytics.args = { ...defaultArgs, 'enable-analytics': true }; |
There was a problem hiding this comment.
suggeston (blocking): There is no enable-analytics property on the component so this story should not have been added. This could be an issue with the va-loader story too but even so, we don't want the same problem to be duplicated.
|
|
||
| const defaultArgs = { | ||
| 'message': 'Loading your application...', | ||
| 'label': 'Loading', |
There was a problem hiding this comment.
label and message are declared but not being used.
jamigibbs
left a comment
There was a problem hiding this comment.
Testing locally, the loader looks like this:
Screen.Recording.2025-07-02.at.8.31.29.AM.mov
I'm not familiar with the VACDS version of this component but is that acceptable for your use? I suspect it still needs some styling.
I'm also not sure that this "Custom Position" feature is working. It looks exactly the same as the other stories:
|
|
||
| 'Loader': { | ||
| guidanceHref: 'loader', | ||
| guidanceName: 'Loader', |
There was a problem hiding this comment.
This file additional-docs.js is only for deprecated React components and styling classes from CSS-Library (previously Formation). It's not used for web components so this should be removed.
| /** | ||
| * @componentName Loader | ||
| * @maturityCategory don't use | ||
| * @maturityLevel proposed |
There was a problem hiding this comment.
This should be:
* @maturityCategory caution
* @maturityLevel candidate
…rtment-of-veterans-affairs/component-library into CDS-contribution-experiment
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I had thought that one of the goals of revising the va-loading-indicator was to make it more accessible as evidenced by this discussion. They goal there appeared to be use of the prefers-reduced-motion CSS media feature. Is that still a goal? Otherwise, I'm not sure we need another loading indicator. That said, if the purpose of the experiment was just to see if you could convert a component of a certain framework to a web-component using Copilot then that seems to have had mitigated success. We've not yet arrived at a series of prompts for converting to web components because we are generally starting from scratch or from a web-component contribution. |

Chromatic
https://CDS-contribution-experiment--65a6e2ed2314f7b8f98609d8.chromatic.com
Description
An experiment to convert the Clinical Design System component Loader into a web component.
Styles aren't fully implemented as part of this proof of concept but the component code is ready for review. It was generated using Copilot, after analyzing
va-loading-indicator.Please focus review on potential hallucinations and markedly erroneous patterns to help with refining the prompt.
Related tickets and links
Closes
Screenshots
Testing and review
Approvals
See the QA Checklists section below for suggested approvals. Use your best judgment if additional reviews are needed. When in doubt, request a review.
Approval groups
Add approval groups to the PR as needed:
QA checklists
Use the QA checklists below as guides, not rules. Not all checklists will apply to every PR but there could be some overlap.
In all scenarios, changes should be fully tested by the author and verified by the reviewer(s); functionality, responsiveness, etc.
✨ New Component Added
minorlabel🌱 New Component Variation Added
minorlabel🐞 Component Fix
patchlabel♿️ Component Fix - Accessibility
patchlabel🚨 Component Fix - Breaking API Change
majorlabel🔧 Component Update - Non-Breaking API Change
minorlabel📖 Storybook Update
ignore-for-releaselabel🎨 CSS-Library Update
css-librarylabel