Skip to content

Commit 5fb4a8f

Browse files
author
Herve Tribouilloy
committed
feat(intent-discovery): release v0.1.0 with UX improvements and configuration updates
1 parent 50cfc4a commit 5fb4a8f

10 files changed

Lines changed: 21 additions & 516 deletions

File tree

temp

Lines changed: 0 additions & 499 deletions
This file was deleted.

vite_project/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vite_project/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "widget-intent-discovery",
33
"private": true,
4-
"version": "0.0.23",
4+
"version": "0.1.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

vite_project/public/cdn/uk.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"data": {
33
"enabledCategories": [
4+
"men",
45
"tops-women",
56
"tops-men"
67
],
@@ -17,13 +18,13 @@
1718
"style_bottom"
1819
],
1920
"labelMap": {
20-
"style_general": "Do you have a style of preference?",
21-
"climate": "Do you know the type of weather you need this clothing for?",
22-
"material": "Let's decide on the material upfront, shall we?",
23-
"size": "Let's decide on the size now?",
24-
"price": "Let's narrow the price range?",
25-
"pattern": "Do you have a preference for the pattern?",
26-
"color": "Do you have a preference for the color?",
21+
"style_general": "Do you have a style preference?",
22+
"climate": "What kind of weather are you shopping for?",
23+
"material": "What material do you prefer?",
24+
"size": "What size are you looking for?",
25+
"price": "What price range works for you?",
26+
"pattern": "Do you have a pattern preference?",
27+
"color": "Do you have a color preference?",
2728
"result": "Here are your best matches"
2829
},
2930
"ai": {

vite_project/src/components/AttributeLayer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export const AttributeLayer = ({ config, attributeLayerData }: Props) => {
2323
const allAttributes = (attributeLayerData?.aggregations || []).filter(
2424
(attr: MagentoAggregation) => !config.attributeExcludedInLayer?.includes(attr.attribute_code)
2525
);
26-
const visibleAttributes = showAll ? allAttributes : allAttributes.slice(0, 4);
26+
const visibleAttributes = showAll ? allAttributes : allAttributes.slice(0, 3);
2727

2828
const isAttributeSelected = (attributeCode: string): boolean => {
2929
// Check if attribute is in attributeScore
@@ -44,6 +44,7 @@ export const AttributeLayer = ({ config, attributeLayerData }: Props) => {
4444
<>
4545
{/*<SelectedPreferences categoryData={categoryData} intent={intent} />*/}
4646
<div className="finder">
47+
<h2 className="finder__title">Need help choosing?</h2>
4748
<div className="step-finder">
4849
{visibleAttributes.map((attr: MagentoAggregation) => (
4950
<div

vite_project/src/components/IntentDiscoveryOptions.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ export const IntentDiscoveryOptions = ({ config, categoryData, attributeLayerDat
5252

5353
return (
5454
<div className="finder">
55-
<h2 className="finder__title">
56-
Let's roll up our sleeves, put some sweat in this search
57-
</h2>
58-
5955
<FinderRow>
6056
<p className="finder__label">{stepLabel}</p>
6157
{renderStep()}

vite_project/src/hooks/domain/useCurrentIntentCategory.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import {useSystemState} from "../../state/System/useSystemState.ts";
2+
import {activity} from "../../activity";
23

34
export const useCurrentIntentCategory = (enabledCategories?: string[]) => {
45
const { intentState } = useSystemState();
56

67
const category = intentState.currentUrl;
78

9+
activity('intent-state', 'Intent State', intentState);
10+
811
if (!category) return null;
912

1013
if (enabledCategories && !enabledCategories.includes(category)) {

vite_project/src/mountWidget.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {getMountedHost} from "./widget-runtime/lib/hostReader.ts";
66
export const WIDGET_ID = 'intentdiscovery';
77

88
export function mountWidget(hostElement: HTMLElement) {
9-
const mountedHost = getMountedHost(hostElement);;
9+
const mountedHost = getMountedHost(hostElement);
1010

1111
activity('bootstrap', 'Widget mounted', hostElement);
1212

vite_project/src/styles/intent-discovery.choice.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/* Desktop */
88
@media (min-width: 600px) {
99
.step-finder {
10-
grid-template-columns: repeat(2, 1fr);
10+
grid-template-columns: repeat(3, 1fr);
1111
}
1212
}
1313

vite_project/src/types/global.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ declare global {
44
interface Window {
55
__REACTEDGE_DEBUG__?: boolean;
66
}
7+
interface Window {
8+
ReactEdgeSignals?: any[];
9+
}
710
}

0 commit comments

Comments
 (0)