-
Notifications
You must be signed in to change notification settings - Fork 39
refactor(atomic): migrate atomic-insight-user-actions-toggle to Lit #6879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: alexprudhomme <78121423+alexprudhomme@users.noreply.github.com>
β¦tions-toggle Co-authored-by: alexprudhomme <78121423+alexprudhomme@users.noreply.github.com>
Co-authored-by: alexprudhomme <78121423+alexprudhomme@users.noreply.github.com>
There was a problem hiding this 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 successfully migrates the atomic-insight-user-actions-toggle component from Stencil to Lit. The component displays a button that opens a modal containing user actions timeline, designed for Insight Panel interfaces.
Key Changes
- Migrated component from Stencil (
.tsx) to Lit (.ts) using modern decorators and patterns - Replaced Stencil's
IconButtonwith the Lit functionalrenderIconButtoncomponent - Added comprehensive unit tests using Vitest and E2E tests using Playwright
- Created Storybook documentation (
.mdxfile) and stories
Reviewed changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
atomic-insight-user-actions-toggle.ts |
New Lit implementation with proper decorators, bindings, and error guards |
atomic-insight-user-actions-toggle.tsx |
Removed legacy Stencil implementation |
atomic-insight-user-actions-toggle.pcss |
Removed (no longer needed with shadow DOM component) |
atomic-insight-user-actions-toggle.spec.ts |
New comprehensive unit tests covering initialization, rendering, and modal interaction |
atomic-insight-user-actions-toggle.new.stories.tsx |
Storybook stories with MSW API mocking |
atomic-insight-user-actions-toggle.mdx |
Component documentation for Storybook |
e2e/atomic-insight-user-actions-toggle.e2e.ts |
Playwright E2E tests for button visibility and modal interaction |
e2e/page-object.ts |
Page object pattern for E2E test interactions |
e2e/fixture.ts |
E2E test fixtures and setup |
user-actions-controller.ts |
New test helper fixture for mocking UserActions controller |
lazy-index.ts |
Added lazy loading entry for the migrated component |
index.ts |
Added component export |
custom-element-tags.ts |
Registered new custom element tag |
components.d.ts |
Auto-generated type definitions updated (Stencil types removed) |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../components/insight/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.ts
Show resolved
Hide resolved
.../components/insight/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.ts
Show resolved
Hide resolved
.../components/insight/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.ts
Show resolved
Hide resolved
| import {errorGuard} from '@/src/decorators/error-guard'; | ||
| import type {InitializableComponent} from '@/src/decorators/types'; | ||
| import {withTailwindStyles} from '@/src/decorators/with-tailwind-styles.js'; | ||
| import Clockicon from '@/src/images/clock.svg'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit;
| import Clockicon from '@/src/images/clock.svg'; | |
| import ClockIcon from '@/src/images/clock.svg'; |
.../components/insight/atomic-insight-user-actions-toggle/atomic-insight-user-actions-toggle.ts
Outdated
Show resolved
Hide resolved
|
|
||
| private buttonRef?: HTMLButtonElement; | ||
| private modalRef?: HTMLAtomicInsightUserActionsModalElement; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's lacking prop validation.
Not the end of the world since the component is currently considered "internal" I suppose.
| {excludeCategories: ['methods']} | ||
| ); | ||
|
|
||
| const meta: Meta = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, why are there no user actions available? Looking at the mock response it seems like it should include actions.

β Checklist
.mdxfileindex.tsandlazy-index.tsfiles.https://coveord.atlassian.net/browse/KIT-5362