@schandlergarcia/sf-web-components 1.9.76 → 1.9.77
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.
|
@@ -13,6 +13,8 @@ description: >-
|
|
|
13
13
|
|
|
14
14
|
These rules apply when building dashboards rendered by `CommandCenter.tsx`. For full component API details, read the **component-library** skill.
|
|
15
15
|
|
|
16
|
+
> **BUILD GUIDE:** The dashboard is built in 3 phases. Read [`getting-started.md`](getting-started.md) for what to build (and what to skip) in each phase. Do NOT build ahead — only build what the current phase asks for.
|
|
17
|
+
|
|
16
18
|
## WIRING — DO THIS FIRST (before building the dashboard)
|
|
17
19
|
|
|
18
20
|
**Building a dashboard requires updating 4 files. If you only create the dashboard file, the user will never see it — they'll see the old Account Search page instead.**
|
|
@@ -1 +1,98 @@
|
|
|
1
|
-
|
|
1
|
+
# Engine Travel Command Center — Build Guide
|
|
2
|
+
|
|
3
|
+
The dashboard is built in **3 phases**, one per user prompt. Each phase adds a layer. Do NOT build ahead — only build what the current phase asks for.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Phase 1 — Build the Dashboard (sample data only)
|
|
8
|
+
|
|
9
|
+
**What to build:**
|
|
10
|
+
- `src/pages/EngineDashboard.tsx` with:
|
|
11
|
+
- Sticky header (h-12, Engine logo, "Travel Command Center", "Powered by Agentforce" badge, bell icon, theme toggle)
|
|
12
|
+
- Hero GeoMap (h-[520px]) with markers, arcs, overlays from sample data
|
|
13
|
+
- Glass KPI overlays on the map (Active Travelers, Spend MTD, Compliance %, Eva Resolved)
|
|
14
|
+
- Flight status strip (horizontal scroll, glass pills)
|
|
15
|
+
- Escalations panel (BaseCard with "Assign to Agent" buttons, toast on click)
|
|
16
|
+
- Disruptions panel (severity dots, flight info, Eva action lines)
|
|
17
|
+
- Active Travelers panel (expandable cards with Avatar, details grid, "View in Salesforce" links)
|
|
18
|
+
- Monthly Spend chart (ChartCard + D3Chart groupedBarChart)
|
|
19
|
+
- All data from `src/data/engine-sample-data.js` via `useDataSource({ sample: SAMPLE_DATA, live: [] })`
|
|
20
|
+
- Brand tokens in `global.css`
|
|
21
|
+
|
|
22
|
+
**What to wire:**
|
|
23
|
+
- `CommandCenter.tsx` → import EngineDashboard
|
|
24
|
+
- `Home.tsx` → REPLACE with CommandCenter wrapper
|
|
25
|
+
- `routes.tsx` → Home as index route with label "Dashboard"
|
|
26
|
+
|
|
27
|
+
**What NOT to build (saved for later phases):**
|
|
28
|
+
- No ChatBar or Eva AI chat — that's Phase 3
|
|
29
|
+
- No AgentforceConversationClient — that's Phase 3
|
|
30
|
+
- No `useEngineLiveData` or live data wiring — that's Phase 2
|
|
31
|
+
- No Salesforce metadata (custom fields, platform events, Apex) — that's Phases 2-3
|
|
32
|
+
- Leave `live:` props empty (`live: []` or `live: undefined`) — Phase 2 fills them in
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Phase 2 — Connect to Live Data
|
|
37
|
+
|
|
38
|
+
**What to build:**
|
|
39
|
+
- Import `useEngineLiveData` from `src/hooks/useEngineLiveData.ts`
|
|
40
|
+
- Wire `live` prop on every `useDataSource` call:
|
|
41
|
+
```tsx
|
|
42
|
+
const live = useEngineLiveData();
|
|
43
|
+
const markers = useDataSource({ sample: MAP_MARKERS, live: live.mapMarkers });
|
|
44
|
+
const arcs = useDataSource({ sample: MAP_ARCS, live: live.mapArcs });
|
|
45
|
+
```
|
|
46
|
+
- Update KPI overlays to use active metrics:
|
|
47
|
+
```tsx
|
|
48
|
+
const activeMetrics = live.loading ? METRICS : live.metrics;
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**What to do after wiring:**
|
|
52
|
+
- Proactively suggest creating `Flight__c.Weather_Impact__c` custom field
|
|
53
|
+
- If confirmed, create SFDX XML from PRD section 14a and deploy
|
|
54
|
+
|
|
55
|
+
**What NOT to build:**
|
|
56
|
+
- No ChatBar or Eva — that's Phase 3
|
|
57
|
+
- No platform events or Apex — that's Phase 3
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Phase 3 — Add Agentforce
|
|
62
|
+
|
|
63
|
+
**What to build:**
|
|
64
|
+
- `ChatBar` between the map and data panels:
|
|
65
|
+
```tsx
|
|
66
|
+
<div className="px-4 pt-4">
|
|
67
|
+
<ChatBar
|
|
68
|
+
title="Eva"
|
|
69
|
+
placeholder="Ask Eva anything about travelers, bookings, policy, or spend…"
|
|
70
|
+
suggestions={CHAT_SUGGESTIONS}
|
|
71
|
+
onSend={handleChat}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
```
|
|
75
|
+
- Suggestions: weather warning, rebooking policy, notify travelers, create support case
|
|
76
|
+
- `handleChat` mock response at module scope
|
|
77
|
+
- `AgentforceConversationClient` with `agentId="0Xxa5000000relhCAA"` and `agentLabel="Eva"`
|
|
78
|
+
|
|
79
|
+
**What to do after adding Eva:**
|
|
80
|
+
- Proactively suggest creating `Travel_Disruption_Alert__e` platform event
|
|
81
|
+
- If confirmed, create SFDX XML from PRD section 14b and deploy
|
|
82
|
+
- Then suggest creating `TravelDisruptionEventService` Apex class
|
|
83
|
+
- If confirmed, create from PRD section 14c and deploy
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Phase Summary
|
|
88
|
+
|
|
89
|
+
| | Phase 1 | Phase 2 | Phase 3 |
|
|
90
|
+
|---|---------|---------|---------|
|
|
91
|
+
| Dashboard layout & panels | Build | — | — |
|
|
92
|
+
| Sample data | Wire | — | — |
|
|
93
|
+
| Live data | Skip | Wire | — |
|
|
94
|
+
| Custom field metadata | Skip | Suggest | — |
|
|
95
|
+
| ChatBar (Eva) | Skip | Skip | Build |
|
|
96
|
+
| AgentforceConversationClient | Skip | Skip | Build |
|
|
97
|
+
| Platform event | Skip | Skip | Suggest |
|
|
98
|
+
| Apex service | Skip | Skip | Suggest |
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.9.77] - 2026-04-04
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Three-phase build guide (`getting-started.md`)** — Replaced one-liner pointer with a full phase-by-phase guide telling the agent exactly what to build and what to skip in each phase. Includes code snippets, explicit "NOT in this phase" callouts, and a summary table
|
|
12
|
+
- **Build guide callout in SKILL.md** — Added a prominent callout at the top of the builder skill pointing to the build guide so agents see it immediately
|
|
13
|
+
|
|
14
|
+
**Context:** Agent was building everything (including Eva ChatBar) in Phase 1 because there was no guide telling it to stop. The PRD had phase instructions but nothing in the skills enforced it. Now `getting-started.md` defines exactly what belongs in each of the 3 phases.
|
|
15
|
+
|
|
8
16
|
## [1.9.76] - 2026-04-04
|
|
9
17
|
|
|
10
18
|
### Fixed
|
|
@@ -326,7 +326,7 @@ Build incrementally in 3 prompts. Each prompt builds on the previous result. The
|
|
|
326
326
|
|
|
327
327
|
### Prompt 1 — Build the Dashboard
|
|
328
328
|
|
|
329
|
-
> Build me a travel command center for Engine. There's a PRD with the full spec. I want the big hero map showing where all our travelers are with flight arcs, glass KPI overlays on top of the map, a flight status ticker, and then below that the main panels — escalations that need attention, active disruptions, our traveler roster with expandable details, and a spend trend chart. Hook it all up to the sample data so it looks real. Make it the home page when you're done — I want to see it when I open the app.
|
|
329
|
+
> Build me a travel command center for Engine. There's a PRD with the full spec. I want the big hero map showing where all our travelers are with flight arcs, glass KPI overlays on top of the map, a flight status ticker, and then below that the main panels — escalations that need attention, active disruptions, our traveler roster with expandable details, and a spend trend chart. Hook it all up to the sample data so it looks real. Don't worry about the AI assistant or live data yet — we'll layer those on after. Make it the home page when you're done — I want to see it when I open the app.
|
|
330
330
|
|
|
331
331
|
**What the agent must do:**
|
|
332
332
|
|
|
@@ -337,6 +337,11 @@ Build incrementally in 3 prompts. Each prompt builds on the previous result. The
|
|
|
337
337
|
5. **Update `src/routes.tsx`** to set Home as the index route with label "Dashboard"
|
|
338
338
|
6. Add Engine brand tokens to `global.css` if not already present
|
|
339
339
|
|
|
340
|
+
**What the agent must NOT do in this prompt:**
|
|
341
|
+
- Do NOT add the ChatBar or any Eva/Agentforce integration — that's Prompt 3
|
|
342
|
+
- Do NOT wire up live data or `useEngineLiveData` — that's Prompt 2
|
|
343
|
+
- Do NOT create Salesforce metadata (custom fields, platform events, Apex) — that's Prompts 2 and 3
|
|
344
|
+
|
|
340
345
|
**Common failure:** The agent creates the dashboard file but forgets to update `Home.tsx` and `routes.tsx`, so the user still sees the Account Search page. The wiring section at the top of `.a4drules/skills/command-center-builder/SKILL.md` explains all required file changes.
|
|
341
346
|
|
|
342
347
|
---
|
package/package.json
CHANGED