镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f0ecad4
feat: add ProductNudge component family
evwilkin Sep 17, 2026
980e74d
feat: add default content exports and asset build step
evwilkin Sep 17, 2026
f32cd26
fix: resolve build errors — split JSX footer to .tsx, fix index defau…
evwilkin Sep 17, 2026
a7dd984
fix: remove ProductNudgeMatchAnalysisModal from main barrel
evwilkin Sep 17, 2026
e3f5731
chore: sort ProductNudge into alphabetical order in barrel and update…
evwilkin Sep 17, 2026
78a431b
feat: build out ProductNudge component family with Lightwell branding
evwilkin Sep 18, 2026
6b7a13b
chore: remove dead code from ProductNudge barrel
evwilkin Sep 18, 2026
c1668a8
chore: remove productNudgeDefaults and fix broken asset import paths
evwilkin Sep 18, 2026
3b5085b
fix: apply pf-code-review suggestions
evwilkin Sep 18, 2026
488562d
fix example warnings, allow string | reactnode for content
evwilkin Sep 23, 2026
c0bcb0a
harden layout of match modal
evwilkin Sep 25, 2026
f25b586
match modal: finalize font sizes & positioning
evwilkin Sep 25, 2026
c99ab4e
description item: update icon & title
evwilkin Sep 25, 2026
34b0a09
update contact modal for new design
evwilkin Sep 25, 2026
c125a4d
spacing fixes for Hero and Contact modal
evwilkin Sep 28, 2026
6a81507
extract lightwell-specific assets, ensure customizable content & asse…
evwilkin Sep 28, 2026
9b26f37
display all props correctly
evwilkin Sep 28, 2026
5858562
update component names, fix prop table warnings
evwilkin Sep 28, 2026
6926376
fix lint errors
evwilkin Sep 28, 2026
d3ccb48
move colorScale prop for CI failure
evwilkin Sep 28, 2026
44762be
CI fix: add victory dependency
evwilkin Sep 29, 2026
0c40a35
fix chart tooltips & colors
evwilkin Oct 2, 2026
7489d1d
pf-review feedback fixes
evwilkin Oct 2, 2026
fe467cc
Make ProductNudge rebrandable, i18n-friendly, and trim bundle size
evwilkin Oct 2, 2026
33edd38
Add impression tracking to product nudge components
evwilkin Oct 2, 2026
135556f
Merge Lightwell/custom ProductNudge examples with a branding toggle
evwilkin Oct 5, 2026
90a153f
Address ProductNudge PR review feedback
evwilkin Nov 9, 2026
5cd468d
docs(ProductNudge): add spacing between example paragraphs
evwilkin Nov 10, 2026
421e045
docs(ProductNudge): remove manual paragraph spacers
evwilkin Nov 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
74 changes: 74 additions & 0 deletions cypress/component/ProductNudgeDataModal.cy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import { createElement } from 'react';
import { ProductNudgeDataModal } from '../../packages/module/dist/dynamic/ProductNudge';

const props = {
isOpen: true,
onClose: () => undefined,
brand: 'lightwell' as const,
titleText: 'Lightwell Lens',
matchData: { exact: 118, partial: 195, noMatch: 534 },
ecosystemData: [
{ name: 'Java', exact: 200, partial: 120, noMatch: 180 },
{ name: 'Python', exact: 50, partial: 80, noMatch: 170 },
],
};

const expectTextInsideChart = (tooltipText: string) => {
cy.contains('text', tooltipText).should('exist').then(($text) => {
const textBounds = $text[0].getBoundingClientRect();
const svgBounds = $text[0].ownerSVGElement?.getBoundingClientRect();

if (!svgBounds) {
throw new Error('Expected the tooltip label to belong to an SVG chart');
}

expect(textBounds.left).to.be.at.least(svgBounds.left - 1);
expect(textBounds.right).to.be.at.most(svgBounds.right + 1);
expect(textBounds.top).to.be.at.least(svgBounds.top - 1);
expect(textBounds.bottom).to.be.at.most(svgBounds.bottom + 1);
});
};

describe('ProductNudgeDataModal chart theming and tooltips', () => {
afterEach(() => {
cy.get('html').invoke('removeClass', 'pf-v6-theme-dark');
});

it('resolves chart fills and legend text through PatternFly light/dark tokens', () => {
cy.mount(createElement(ProductNudgeDataModal, props));

const noMatchFill = 'svg path[style*="lightwell-chart-color-no-match"]';
const legendLabel = '[aria-label="By ecosystem chart"] svg text tspan';
const donutTitle = 'svg text tspan';
let lightDonutTitleFill: string;

cy.get(noMatchFill).first().should('have.css', 'fill', 'rgb(224, 224, 224)');
cy.get(legendLabel).filter((_index, element) => element.textContent === 'Exact match')
.should('have.css', 'fill', 'rgb(31, 31, 31)');
cy.get(donutTitle).filter((_index, element) => element.textContent === '313').then(($title) => {
lightDonutTitleFill = getComputedStyle($title[0]).fill;
});

cy.get('html').invoke('addClass', 'pf-v6-theme-dark');

cy.get(noMatchFill).first().should('have.css', 'fill', 'rgb(112, 112, 112)');
cy.get(legendLabel).filter((_index, element) => element.textContent === 'Exact match')
.should('have.css', 'fill', 'rgb(255, 255, 255)');
cy.get(donutTitle).filter((_index, element) => element.textContent === '313').should(($title) => {
expect(getComputedStyle($title[0]).fill).not.to.equal(lightDonutTitleFill);
});
});

it('keeps donut and tall-bar tooltips inside their chart viewports', () => {
cy.mount(createElement(ProductNudgeDataModal, props));

cy.get('svg path[style*="lightwell-chart-color-partial"]')
.first()
.trigger('mouseover');
expectTextInsideChart('partial matches: 195');

cy.get('[aria-label="By ecosystem chart"] svg path[style*="lightwell-chart-color-exact"][index="0"]')
.trigger('mouseover');
expectTextInsideChart('Exact match: 200');
});
});
4 changes: 3 additions & 1 deletion cypress/support/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { mount } from 'cypress/react18'
import '@patternfly/patternfly/patternfly.css';
// Patternfly utilities
import '@patternfly/patternfly/patternfly-addons.css';
// PatternFly chart tokens, including dark-theme chart colors
import '@patternfly/patternfly/patternfly-charts.css';
// Global theme CSS
import '@patternfly/documentation-framework/global.css';

Expand All @@ -46,4 +48,4 @@ Cypress.Commands.add('mount', mount)
Cypress.on('uncaught:exception', (_err, _runnable) => false)

// Example use:
// cy.mount(<MyComponent />)
// cy.mount(<MyComponent />)
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
],
moduleNameMapper: {
'\\.(css|scss)$': 'identity-obj-proxy',
'\\.(svg|png)$': '<rootDir>/config/fileMock.js',
'^lodash-es$': 'lodash',
customReact: 'react',
reactRedux: 'react-redux',
Expand Down
Loading
Loading