oneie 3.4.2 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/agent-director.md +902 -22
- package/.claude/agents/agent-onboard-example-output.md +600 -0
- package/.claude/agents/agent-onboard.md +576 -0
- package/.claude/commands/ONBOARDING_ENHANCEMENT_SUMMARY.md +266 -0
- package/.claude/commands/one.md +411 -10
- package/.claude/commands/release.md +64 -3
- package/CLAUDE.md +55 -69
- package/dist/commands/init.d.ts +5 -6
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +101 -101
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/utils/installation-setup.d.ts +24 -1
- package/dist/utils/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +85 -1
- package/dist/utils/installation-setup.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +6 -0
- package/dist/utils/launch-claude.d.ts.map +1 -0
- package/dist/utils/launch-claude.js +51 -0
- package/dist/utils/launch-claude.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +73 -0
- package/dist/utils/validation.js.map +1 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/app.json +8 -0
- package/one/.obsidian/appearance.json +1 -0
- package/one/.obsidian/community-plugins.json +3 -0
- package/one/.obsidian/core-plugins.json +33 -0
- package/one/.obsidian/plugins/easy-bake/main.js +361 -0
- package/one/.obsidian/plugins/easy-bake/manifest.json +11 -0
- package/one/.obsidian/plugins/easy-bake/styles.css +10 -0
- package/one/.obsidian/workspace.json +240 -0
- package/one/connections/workflow-onboarding.md +683 -0
- package/one/events/CART-DRAWER-INTEGRATION-GUIDE.md +354 -0
- package/one/events/CRITICAL-FIXES-COMPLETE.md +504 -0
- package/one/events/DEPLOYMENT.md +178 -0
- package/one/events/ECOMMERCE-DEMO-PLAN.md +225 -0
- package/one/events/ECOMMERCE-LIVE-DEMO.md +363 -0
- package/one/events/ECOMMERCE-TEMPLATE-COMPLETE.md +735 -0
- package/one/events/ECOMMERCE-TEMPLATES-SUMMARY.md +923 -0
- package/one/events/GRADIENT-TEXT-PERMANENT-FIX.md +223 -0
- package/one/events/HANDOFF.md +313 -0
- package/one/events/IMPLEMENTATION-SUMMARY-FINAL.md +503 -0
- package/one/events/IMPLEMENTATION_SUMMARY.md +529 -0
- package/one/events/LANDING-PAGE-EXAMPLE-OUTPUT.md +666 -0
- package/one/events/LANDING-PAGE-IMPLEMENTATION.md +642 -0
- package/one/events/LANDING-PAGE-QUICKSTART.md +407 -0
- package/one/events/MULTI-ONTOLOGY-COMPLETE-GUIDE.md +1627 -0
- package/one/events/MULTI-ONTOLOGY-IMPLEMENTATION-COMPLETE.md +573 -0
- package/one/events/ONBOARDING-IMPLEMENTATION-COMPLETE copy.md +398 -0
- package/one/events/ONTOLOGY-TUTORIALS-SUMMARY.md +525 -0
- package/one/events/ONTOLOGY-TYPE-GENERATOR-SUMMARY.md +455 -0
- package/one/events/ONTOLOGY_DISCOVERY_IMPLEMENTATION.md +486 -0
- package/one/events/ONTOLOGY_DISCOVERY_QUICKSTART.md +203 -0
- package/one/events/SECURITY-AUDIT-FIXES.md +376 -0
- package/one/events/SECURITY-SCAN-COMPLETE.md +281 -0
- package/one/events/SHOP-BUILD-STATUS.md +114 -0
- package/one/events/SHOP-PREMIUM-UPDATE.md +149 -0
- package/one/events/SITE-WIDE-GRADIENT-FIX.md +299 -0
- package/one/events/STORE-PRODUCTION-READY-STATUS.md +359 -0
- package/one/events/STRIPE-PAYMENT-METHODS-GUIDE.md +429 -0
- package/one/events/agent-director-enhancement-summary.md +386 -0
- package/one/events/agent-onboard-implementation-summary.md +457 -0
- package/one/events/clean-agent-ontology-cleanup-report.md +353 -0
- package/one/events/landing-page-generator.md +458 -0
- package/one/events/onboarding-implementation-complete.md +505 -0
- package/one/events/release.md +254 -0
- package/one/events/separate-implementation-status.md +537 -0
- package/one/groups/nine-padle-contents.baked.md +1252 -0
- package/one/groups/nine-padle-contents.md +6 -0
- package/one/knowledge/100-inference-quick-reference.md +431 -0
- package/one/knowledge/agent-onboard-usage.md +612 -0
- package/one/knowledge/cli-claude-handoff.md +718 -0
- package/one/knowledge/installation-folders.md +45 -1
- package/one/knowledge/ontology-blog.yaml +31 -0
- package/one/knowledge/ontology-cheatsheet.md +591 -0
- package/one/knowledge/ontology-community.yaml +42 -0
- package/one/knowledge/ontology-core-universal.md +722 -0
- package/one/knowledge/ontology-core.yaml +50 -0
- package/one/knowledge/ontology-courses.yaml +53 -0
- package/one/knowledge/ontology-creator.md +376 -0
- package/one/knowledge/ontology-developer-guide.md +789 -0
- package/one/knowledge/ontology-education.md +920 -0
- package/one/knowledge/ontology-index.md +354 -0
- package/one/knowledge/ontology-migration-guide.md +811 -0
- package/one/knowledge/ontology-minimal.yaml +1 -1
- package/one/knowledge/ontology-portfolio.yaml +31 -0
- package/one/knowledge/ontology-quickstart.md +576 -0
- package/one/knowledge/ontology-shop.yaml +121 -0
- package/one/knowledge/ontology-tokens.yaml +32 -0
- package/one/knowledge/ontology-tutorial.md +434 -0
- package/one/knowledge/ontology-video-script.md +890 -0
- package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +467 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +408 -0
- package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +369 -0
- package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +396 -0
- package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +468 -0
- package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +582 -0
- package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +449 -0
- package/one/things/docs/ecommerce/QUICK-START.md +368 -0
- package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +498 -0
- package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +237 -0
- package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +171 -0
- package/one/things/docs/ecommerce/demo.astro +309 -0
- package/one/things/plans/agent-director-100-inference-plans.md +410 -0
- package/one/things/plans/dual-website-strategy.md +612 -0
- package/one/things/plans/feature-based-sites.md +821 -0
- package/one/things/plans/multi-ontology-architecture.md +836 -0
- package/one/things/plans/onboarding.md +32 -0
- package/one/things/plans/separate.md +15 -17
- package/one/things/plans/start-new.md +738 -0
- package/one/things/templates.md +254 -0
- package/one/things/todo.md +23 -5
- package/package.json +2 -2
- package/one/things/claude/hooks/agent-hook-manager.js +0 -525
- package/one/things/claude/hooks/agent-load-balancer.js +0 -271
- package/one/things/claude/hooks/agent-request-interceptor.js +0 -70
- package/one/things/claude/hooks/cascade-feedback.js +0 -297
- package/one/things/claude/hooks/cascade-integration-hooks.js +0 -648
- package/one/things/claude/hooks/continuous-improvement-monitor.js +0 -510
- package/one/things/claude/hooks/file-organization-engine.js +0 -427
- package/one/things/claude/hooks/file-organization-monitor.js +0 -269
- package/one/things/claude/hooks/hook-config-manager.js +0 -202
- package/one/things/claude/hooks/hook-orchestrator.js +0 -662
- package/one/things/claude/hooks/hook-performance-report.js +0 -120
- package/one/things/claude/hooks/mcp-cascade-integration.js +0 -816
- package/one/things/claude/hooks/memory-optimizer.js +0 -510
- package/one/things/claude/hooks/ontology-compliance.js +0 -394
- package/one/things/claude/hooks/ontology-hook-manager.js +0 -316
- package/one/things/claude/hooks/ontology-validation-engine.js +0 -317
- package/one/things/claude/hooks/performance-monitoring-hook.js +0 -422
- package/one/things/claude/hooks/quality-scoring-engine.js +0 -834
- package/one/things/claude/hooks/simple-load-balancer.js +0 -238
- package/one/things/claude/hooks/startup-optimizer.js +0 -625
- package/one/things/claude/hooks/story-scoring-system.js +0 -445
- package/one/things/claude/hooks/story-validation-engine.js +0 -473
- package/one/things/claude/hooks/structure-synchronizer.js +0 -194
- package/one/things/claude/hooks/sub-agent-output-validator.js +0 -647
- package/one/things/claude/hooks/sub-agent-validation-hook.js +0 -343
- package/one/things/claude/hooks/trinity-validation-system.js +0 -392
- package/one/things/plans/organizations-to-groups.md +0 -705
|
@@ -0,0 +1,449 @@
|
|
|
1
|
+
# Product Page Conversion Elements - Integration Examples
|
|
2
|
+
|
|
3
|
+
## Quick Integration Guide
|
|
4
|
+
|
|
5
|
+
### 1. Product Listing Page (Already Integrated)
|
|
6
|
+
|
|
7
|
+
The QuickViewModal is already integrated into ProductCard.tsx. No additional work needed.
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
// ProductCard.tsx already includes:
|
|
11
|
+
import { QuickViewModal } from './QuickViewModal';
|
|
12
|
+
|
|
13
|
+
// At the end of component:
|
|
14
|
+
<QuickViewModal
|
|
15
|
+
product={product}
|
|
16
|
+
open={showQuickView}
|
|
17
|
+
onOpenChange={setShowQuickView}
|
|
18
|
+
/>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Product Detail Page - Complete Example
|
|
22
|
+
|
|
23
|
+
Create or update your product detail page at `src/pages/ecommerce/product/[slug].astro`:
|
|
24
|
+
|
|
25
|
+
```astro
|
|
26
|
+
---
|
|
27
|
+
// src/pages/ecommerce/product/[slug].astro
|
|
28
|
+
import Layout from '@/layouts/Layout.astro';
|
|
29
|
+
import { ProductGallery } from '@/components/ecommerce/interactive/ProductGallery';
|
|
30
|
+
import { SizeGuideModal } from '@/components/ecommerce/interactive/SizeGuideModal';
|
|
31
|
+
import { StickyCartBar } from '@/components/ecommerce/interactive/StickyCartBar';
|
|
32
|
+
import { VariantSelector } from '@/components/ecommerce/interactive/VariantSelector';
|
|
33
|
+
import { QuantitySelector } from '@/components/ecommerce/interactive/QuantitySelector';
|
|
34
|
+
import { AddToCartButton } from '@/components/ecommerce/interactive/AddToCartButton';
|
|
35
|
+
|
|
36
|
+
// Fetch product data (example)
|
|
37
|
+
const { slug } = Astro.params;
|
|
38
|
+
const product = {
|
|
39
|
+
id: '1',
|
|
40
|
+
slug: 'premium-cotton-tshirt',
|
|
41
|
+
name: 'Premium Cotton T-Shirt',
|
|
42
|
+
description: 'Ultra-soft 100% organic cotton with a modern fit...',
|
|
43
|
+
price: 29.99,
|
|
44
|
+
compareAtPrice: 49.99,
|
|
45
|
+
images: [
|
|
46
|
+
'https://images.unsplash.com/photo-1521572163474-6864f9cf17ab',
|
|
47
|
+
'https://images.unsplash.com/photo-1503342217505-b0a15ec3261c',
|
|
48
|
+
'https://images.unsplash.com/photo-1618354691373-d851c5c3a990',
|
|
49
|
+
],
|
|
50
|
+
thumbnail: 'https://images.unsplash.com/photo-1521572163474-6864f9cf17ab',
|
|
51
|
+
category: 'Apparel',
|
|
52
|
+
tags: ['shirts', 'cotton', 'organic'],
|
|
53
|
+
variants: [
|
|
54
|
+
{
|
|
55
|
+
id: 'size',
|
|
56
|
+
name: 'Size',
|
|
57
|
+
type: 'size' as const,
|
|
58
|
+
options: [
|
|
59
|
+
{ value: 'xs', label: 'XS', inStock: true },
|
|
60
|
+
{ value: 's', label: 'S', inStock: true },
|
|
61
|
+
{ value: 'm', label: 'M', inStock: true },
|
|
62
|
+
{ value: 'l', label: 'L', inStock: false },
|
|
63
|
+
{ value: 'xl', label: 'XL', inStock: true },
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'color',
|
|
68
|
+
name: 'Color',
|
|
69
|
+
type: 'color' as const,
|
|
70
|
+
options: [
|
|
71
|
+
{ value: 'black', label: 'Black', inStock: true },
|
|
72
|
+
{ value: 'white', label: 'White', inStock: true },
|
|
73
|
+
{ value: 'navy', label: 'Navy', inStock: true },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
inStock: true,
|
|
78
|
+
inventory: 47,
|
|
79
|
+
rating: 4.8,
|
|
80
|
+
reviewCount: 234,
|
|
81
|
+
featured: true,
|
|
82
|
+
createdAt: new Date('2024-01-15'),
|
|
83
|
+
updatedAt: new Date(),
|
|
84
|
+
};
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
<Layout title={product.name}>
|
|
88
|
+
<div class="container mx-auto px-4 py-8">
|
|
89
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
|
90
|
+
|
|
91
|
+
<!-- Left Column: Image Gallery -->
|
|
92
|
+
<div>
|
|
93
|
+
<ProductGallery
|
|
94
|
+
client:load
|
|
95
|
+
images={product.images}
|
|
96
|
+
productName={product.name}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<!-- Right Column: Product Info -->
|
|
101
|
+
<div class="space-y-6">
|
|
102
|
+
<div>
|
|
103
|
+
<h1 class="text-3xl font-bold text-foreground">{product.name}</h1>
|
|
104
|
+
<p class="mt-2 text-muted-foreground">{product.description}</p>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<div class="flex items-baseline gap-3">
|
|
108
|
+
<span class="text-3xl font-bold text-foreground">
|
|
109
|
+
${product.price.toFixed(2)}
|
|
110
|
+
</span>
|
|
111
|
+
{product.compareAtPrice && (
|
|
112
|
+
<>
|
|
113
|
+
<span class="text-xl text-muted-foreground line-through">
|
|
114
|
+
${product.compareAtPrice.toFixed(2)}
|
|
115
|
+
</span>
|
|
116
|
+
<span class="text-sm font-bold text-destructive">
|
|
117
|
+
Save {Math.round(((product.compareAtPrice - product.price) / product.compareAtPrice) * 100)}%
|
|
118
|
+
</span>
|
|
119
|
+
</>
|
|
120
|
+
)}
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<!-- Variant Selection Section (Important: Add id="variant-selector") -->
|
|
124
|
+
<div id="variant-selector" class="space-y-4">
|
|
125
|
+
{product.variants?.map((variant) => (
|
|
126
|
+
<div key={variant.id}>
|
|
127
|
+
<div class="flex items-center justify-between mb-2">
|
|
128
|
+
<label class="text-sm font-medium">{variant.name}</label>
|
|
129
|
+
{variant.type === 'size' && (
|
|
130
|
+
<button
|
|
131
|
+
class="text-sm text-primary hover:underline"
|
|
132
|
+
onclick="document.getElementById('size-guide-trigger')?.click()"
|
|
133
|
+
>
|
|
134
|
+
Size Guide
|
|
135
|
+
</button>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
<VariantSelector
|
|
139
|
+
client:load
|
|
140
|
+
variant={variant}
|
|
141
|
+
selectedValue=""
|
|
142
|
+
onSelect={(value) => console.log('Selected:', value)}
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
))}
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div class="flex items-center gap-3">
|
|
149
|
+
<span class="text-sm font-medium">Quantity:</span>
|
|
150
|
+
<QuantitySelector
|
|
151
|
+
client:load
|
|
152
|
+
value={1}
|
|
153
|
+
onChange={(qty) => console.log('Quantity:', qty)}
|
|
154
|
+
max={product.inventory || 999}
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
|
|
158
|
+
{product.inventory && product.inventory < 10 && (
|
|
159
|
+
<div class="text-sm text-orange-600 dark:text-orange-400 flex items-center gap-2">
|
|
160
|
+
<svg class="h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
161
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
|
|
162
|
+
</svg>
|
|
163
|
+
Only {product.inventory} left in stock
|
|
164
|
+
</div>
|
|
165
|
+
)}
|
|
166
|
+
|
|
167
|
+
<AddToCartButton
|
|
168
|
+
client:load
|
|
169
|
+
productId={product.id}
|
|
170
|
+
productName={product.name}
|
|
171
|
+
productSlug={product.slug}
|
|
172
|
+
price={product.price}
|
|
173
|
+
image={product.thumbnail}
|
|
174
|
+
inStock={product.inStock}
|
|
175
|
+
/>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<!-- Size Guide Modal (Hidden trigger) -->
|
|
181
|
+
<button id="size-guide-trigger" class="hidden" />
|
|
182
|
+
<SizeGuideModal
|
|
183
|
+
client:load
|
|
184
|
+
open={false}
|
|
185
|
+
onOpenChange={(open) => console.log('Size guide:', open)}
|
|
186
|
+
productType="apparel"
|
|
187
|
+
/>
|
|
188
|
+
|
|
189
|
+
<!-- Sticky Cart Bar (Mobile) -->
|
|
190
|
+
<StickyCartBar
|
|
191
|
+
client:load
|
|
192
|
+
product={product}
|
|
193
|
+
selectedVariants={{}}
|
|
194
|
+
quantity={1}
|
|
195
|
+
triggerElementId="variant-selector"
|
|
196
|
+
/>
|
|
197
|
+
</Layout>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### 3. Size Guide Integration Options
|
|
201
|
+
|
|
202
|
+
#### Option A: Trigger from Link
|
|
203
|
+
```tsx
|
|
204
|
+
// In your component
|
|
205
|
+
const [showSizeGuide, setShowSizeGuide] = useState(false);
|
|
206
|
+
|
|
207
|
+
<button
|
|
208
|
+
onClick={() => setShowSizeGuide(true)}
|
|
209
|
+
className="text-sm text-primary hover:underline"
|
|
210
|
+
>
|
|
211
|
+
Size Guide
|
|
212
|
+
</button>
|
|
213
|
+
|
|
214
|
+
<SizeGuideModal
|
|
215
|
+
open={showSizeGuide}
|
|
216
|
+
onOpenChange={setShowSizeGuide}
|
|
217
|
+
productType="apparel"
|
|
218
|
+
/>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
#### Option B: Global Size Guide Link
|
|
222
|
+
```astro
|
|
223
|
+
<!-- In your layout footer or header -->
|
|
224
|
+
<button id="size-guide-trigger" data-product-type="apparel">
|
|
225
|
+
Size Guide
|
|
226
|
+
</button>
|
|
227
|
+
|
|
228
|
+
<script>
|
|
229
|
+
document.getElementById('size-guide-trigger')?.addEventListener('click', () => {
|
|
230
|
+
// Trigger modal open
|
|
231
|
+
});
|
|
232
|
+
</script>
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 4. Sticky Cart Bar Requirements
|
|
236
|
+
|
|
237
|
+
**Important:** Add `id="variant-selector"` to the element you want to trigger the sticky bar:
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
// Option 1: Wrap variant selectors
|
|
241
|
+
<div id="variant-selector" className="space-y-4">
|
|
242
|
+
{/* Variant selectors here */}
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
// Option 2: Add to specific element
|
|
246
|
+
<div className="variant-section">
|
|
247
|
+
<h3 id="variant-selector">Choose Options</h3>
|
|
248
|
+
{/* Variants */}
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
// Option 3: Custom trigger point
|
|
252
|
+
<StickyCartBar
|
|
253
|
+
product={product}
|
|
254
|
+
triggerElementId="custom-trigger-id"
|
|
255
|
+
/>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### 5. Responsive Behavior
|
|
259
|
+
|
|
260
|
+
All components are responsive by default:
|
|
261
|
+
|
|
262
|
+
- **Quick View**: 2-column on desktop, 1-column on mobile
|
|
263
|
+
- **Product Gallery**: Swipe gestures on mobile, mouse controls on desktop
|
|
264
|
+
- **Size Guide**: Scrollable tables on mobile
|
|
265
|
+
- **Sticky Cart Bar**: Mobile only (hidden on desktop with `md:hidden`)
|
|
266
|
+
|
|
267
|
+
### 6. Custom Styling
|
|
268
|
+
|
|
269
|
+
Override styles using Tailwind classes:
|
|
270
|
+
|
|
271
|
+
```tsx
|
|
272
|
+
// Example: Custom modal width
|
|
273
|
+
<DialogContent className="max-w-6xl">
|
|
274
|
+
{/* Content */}
|
|
275
|
+
</DialogContent>
|
|
276
|
+
|
|
277
|
+
// Example: Custom sticky bar position
|
|
278
|
+
<div className="fixed bottom-20 left-0 right-0">
|
|
279
|
+
<StickyCartBar {...props} />
|
|
280
|
+
</div>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 7. Event Tracking
|
|
284
|
+
|
|
285
|
+
Add analytics to track user interactions:
|
|
286
|
+
|
|
287
|
+
```tsx
|
|
288
|
+
// Quick View Modal
|
|
289
|
+
const handleQuickView = () => {
|
|
290
|
+
setShowQuickView(true);
|
|
291
|
+
|
|
292
|
+
// Track event
|
|
293
|
+
if (typeof window !== 'undefined' && window.gtag) {
|
|
294
|
+
window.gtag('event', 'quick_view', {
|
|
295
|
+
product_id: product.id,
|
|
296
|
+
product_name: product.name,
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// Size Guide
|
|
302
|
+
const handleSizeGuideOpen = () => {
|
|
303
|
+
setShowSizeGuide(true);
|
|
304
|
+
|
|
305
|
+
// Track event
|
|
306
|
+
if (typeof window !== 'undefined' && window.gtag) {
|
|
307
|
+
window.gtag('event', 'size_guide_open', {
|
|
308
|
+
product_type: 'apparel',
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
// Sticky Cart Bar
|
|
314
|
+
<StickyCartBar
|
|
315
|
+
product={product}
|
|
316
|
+
onAddToCart={() => {
|
|
317
|
+
// Track conversion from sticky bar
|
|
318
|
+
window.gtag?.('event', 'add_to_cart_sticky', {
|
|
319
|
+
product_id: product.id,
|
|
320
|
+
value: product.price,
|
|
321
|
+
});
|
|
322
|
+
}}
|
|
323
|
+
/>
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### 8. A/B Testing Setup
|
|
327
|
+
|
|
328
|
+
Test different trigger points and behaviors:
|
|
329
|
+
|
|
330
|
+
```tsx
|
|
331
|
+
// Example: Test scroll threshold
|
|
332
|
+
const stickyBarVariant = Math.random() > 0.5 ? 'early' : 'late';
|
|
333
|
+
|
|
334
|
+
<StickyCartBar
|
|
335
|
+
product={product}
|
|
336
|
+
triggerElementId={
|
|
337
|
+
stickyBarVariant === 'early'
|
|
338
|
+
? 'product-title'
|
|
339
|
+
: 'variant-selector'
|
|
340
|
+
}
|
|
341
|
+
/>
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### 9. Performance Optimization
|
|
345
|
+
|
|
346
|
+
```tsx
|
|
347
|
+
// Lazy load modals
|
|
348
|
+
import { lazy, Suspense } from 'react';
|
|
349
|
+
|
|
350
|
+
const SizeGuideModal = lazy(() =>
|
|
351
|
+
import('./SizeGuideModal').then(m => ({ default: m.SizeGuideModal }))
|
|
352
|
+
);
|
|
353
|
+
|
|
354
|
+
// Use with Suspense
|
|
355
|
+
<Suspense fallback={<div>Loading...</div>}>
|
|
356
|
+
<SizeGuideModal {...props} />
|
|
357
|
+
</Suspense>
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### 10. Error Handling
|
|
361
|
+
|
|
362
|
+
```tsx
|
|
363
|
+
// Add error boundaries
|
|
364
|
+
import { ErrorBoundary } from '@/components/ErrorBoundary';
|
|
365
|
+
|
|
366
|
+
<ErrorBoundary fallback={<div>Something went wrong</div>}>
|
|
367
|
+
<ProductGallery images={product.images} productName={product.name} />
|
|
368
|
+
</ErrorBoundary>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Common Patterns
|
|
374
|
+
|
|
375
|
+
### Pattern 1: Product Card Grid with Quick View
|
|
376
|
+
```astro
|
|
377
|
+
---
|
|
378
|
+
const products = await fetchProducts();
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
|
|
382
|
+
{products.map(product => (
|
|
383
|
+
<ProductCard client:load product={product} />
|
|
384
|
+
))}
|
|
385
|
+
</div>
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Pattern 2: Product Detail with All Features
|
|
389
|
+
```astro
|
|
390
|
+
<!-- See complete example above in section 2 -->
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### Pattern 3: Category Page with Filters
|
|
394
|
+
```astro
|
|
395
|
+
---
|
|
396
|
+
import { FilterSidebar } from '@/components/ecommerce/interactive/FilterSidebar';
|
|
397
|
+
import { ProductGrid } from '@/components/ecommerce/static/ProductGrid';
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
<div class="flex gap-6">
|
|
401
|
+
<aside class="w-64">
|
|
402
|
+
<FilterSidebar client:load />
|
|
403
|
+
</aside>
|
|
404
|
+
<main class="flex-1">
|
|
405
|
+
<ProductGrid client:load products={products} />
|
|
406
|
+
</main>
|
|
407
|
+
</div>
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## Troubleshooting
|
|
413
|
+
|
|
414
|
+
### Quick View Not Opening
|
|
415
|
+
- Check that `showQuickView` state is managed correctly
|
|
416
|
+
- Verify `client:load` is added to ProductCard
|
|
417
|
+
- Check browser console for errors
|
|
418
|
+
|
|
419
|
+
### Sticky Bar Not Appearing
|
|
420
|
+
- Verify `id="variant-selector"` exists on trigger element
|
|
421
|
+
- Check that component has `client:load` directive
|
|
422
|
+
- Test on mobile device or resize browser window
|
|
423
|
+
- Ensure element is in the DOM before scroll
|
|
424
|
+
|
|
425
|
+
### Image Zoom Not Working
|
|
426
|
+
- Verify `client:load` on ProductGallery
|
|
427
|
+
- Check that images array is not empty
|
|
428
|
+
- Test click events in browser console
|
|
429
|
+
|
|
430
|
+
### Size Guide Table Overflow
|
|
431
|
+
- Add `overflow-x-auto` to table wrapper
|
|
432
|
+
- Reduce font size on mobile
|
|
433
|
+
- Consider horizontal scroll indicator
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## Next Steps
|
|
438
|
+
|
|
439
|
+
1. Add these components to your product detail page
|
|
440
|
+
2. Test on multiple devices (mobile, tablet, desktop)
|
|
441
|
+
3. Track analytics events
|
|
442
|
+
4. A/B test different configurations
|
|
443
|
+
5. Monitor conversion rate improvements
|
|
444
|
+
|
|
445
|
+
Expected results based on industry benchmarks:
|
|
446
|
+
- 15-20% increase in add-to-cart rate (quick view)
|
|
447
|
+
- 25-30% reduction in returns (size guide)
|
|
448
|
+
- 10-15% increase in mobile conversions (sticky bar)
|
|
449
|
+
- 270% increase in conversions (high-quality images with zoom)
|