@schandlergarcia/sf-web-components 1.9.63 → 1.9.65

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.
@@ -79,7 +79,7 @@ Configured in both `vite.config.ts` and `tsconfig.json`:
79
79
 
80
80
  ## Key Conventions
81
81
 
82
- - **Dashboard pages** go in `src/components/pages/`. Wire into `CommandCenter.tsx` by importing and rendering.
82
+ - **Dashboard pages** go in `src/pages/` (NOT `src/components/pages/`). Wire into `CommandCenter.tsx` by importing and rendering.
83
83
  - **Outer app pages** go in `src/pages/` or `src/features/*/pages/`. Wire into `src/routes.tsx`.
84
84
  - **TypeScript** preferred for all code (`.tsx`/`.ts`). Core UI components converted to TypeScript. Legacy `.jsx` files being migrated.
85
85
  - **Component library** is a vendored copy from command-center-starter — not an npm package. Changes sync manually.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ 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.65] - 2026-04-01
9
+
10
+ ### Fixed
11
+ - **6 data bugs in engine-sample-data.js**:
12
+ 1. Added ESCALATION_CARDS alias export (was missing)
13
+ 2. Fixed MAP_OVERLAYS city→IATA lookup (was failing silently)
14
+ 3. Changed 2 bookings to "Pending approval" status (were showing as confirmed)
15
+ 4. Fixed EVA_ACTIONS to produce "pending" status correctly
16
+ 5. Fixed rebooking a05R1 contact mismatch (Sarah Chen → Priya Patel)
17
+ 6. Updated TXL → BER throughout (Berlin airport code change)
18
+
19
+ ### Updated
20
+ - **PRD (engine-command-center-prd.md)**:
21
+ - Fixed "Sarah Chen" → "Priya Patel" in section 8c escalation example
22
+ - Updated section 13 build prompts
23
+ - **Simplified .a4drules documentation** - Removed redundancy and contradictions:
24
+ - `features/engine-dashboard-rule.md` - Reduced from 310 to ~65 lines (non-negotiable constraints)
25
+ - `features/command-center-dashboard-rule.md` - Reduced from ~100 to ~30 lines (10 core constraints)
26
+ - `features/pre-code-checklist.md` - Reduced from 216 to ~25 lines (removed auto-load)
27
+ - `features/phase2-data-pattern.md` - Reduced from 167 to ~20 lines
28
+ - `skills/command-center-builder/SKILL.md` - Fixed map layout contradiction, removed validator
29
+ - `skills/command-center-builder/page-layout.md` - Fixed map layout contradiction
30
+ - `skills/command-center-builder/completion-checklist.md` - Replaced validator "MUST run" with "DO NOT run"
31
+ - `skills/command-center-builder/improved-build-process.md` - Reduced from 341 to ~30 lines
32
+ - `skills/command-center-project/SKILL.md` - Fixed file path contradiction (src/components/pages/ → src/pages/)
33
+ - `skills/command-center-guide/SKILL.md` - Reduced from 270 to ~45 lines (simplified routing guide)
34
+
35
+ **Context:** Streamlined documentation to eliminate confusion caused by scattered, contradictory guidance across multiple files.
36
+
37
+ ## [1.9.64] - 2026-04-01
38
+
39
+ ### Updated
40
+ - **Documentation improvements** - Synced latest changes from react-cursor-1 including data bug fixes and simplified .a4drules structure
41
+
8
42
  ## [1.9.63] - 2026-04-01
9
43
 
10
44
  ### Updated
@@ -301,7 +301,7 @@ Each escalation has:
301
301
  Examples from sample data:
302
302
  - "Processing approval for Omar Hassan" - subtitle: "Paris trip over budget · escalated to manager" (status: pending)
303
303
  - "Monitoring weather delay for Elena Rodriguez" - subtitle: "AF 99 · CDG arrival delayed 45 min · No action yet" (status: working)
304
- - "Rebooked cancelled flight for Sarah Chen" - subtitle: "LH 431 → LH 433 · Same fare class" (status: complete)
304
+ - "Rebooked cancelled flight for Priya Patel" - subtitle: "LH 431 → LH 433 · Same fare class" (status: complete)
305
305
 
306
306
  ### 8d. Monthly Spend Trend (1/2 width)
307
307
 
@@ -431,41 +431,39 @@ Mandatory on every element. The dashboard must work in both light and dark mode
431
431
 
432
432
  ## 13. Build Prompts
433
433
 
434
- **Build Methodology:** 4-phase incremental process (Layout → Components → Data → Agent). Run prompts in sequence. All detailed instructions are in the skills and PRD the phase prompts should be simple triggers.
434
+ **Build Methodology:** 4-phase incremental process (Layout → Components → Data → Agent). Each phase has a self-contained instruction file in `.a4drules/phases/` with code templates and exact imports.
435
435
 
436
436
  ---
437
437
 
438
438
  ### Phase 1: Layout & Structure
439
439
 
440
- > **Skills:** command-center-builder, command-center-project, component-library, outer-app
440
+ > Read `.a4drules/phases/phase-1-layout.md` and follow the code template.
441
441
  >
442
- > Scaffold the Engine Travel Command Center skeleton. Build the structure from section 5 (visualization-hero layout) with placeholder cards. No real data or components yet, just the layout structure.
442
+ > Scaffold the Engine Travel Command Center skeleton with header, hero map, glass KPI overlays, flight status strip, and 4 placeholder data panels.
443
443
 
444
444
  ---
445
445
 
446
446
  ### Phase 2: Components & Sample Data
447
447
 
448
- > **Skills:** command-center-builder, command-center-project, component-library
448
+ > Read `.a4drules/phases/phase-2-components.md` and follow the instructions.
449
449
  >
450
- > Replace placeholders with library components. Import data from the pre-existing `src/data/engine-sample-data.js` file. Build the 4 data panels from section 8: Disruptions, Active Travelers, Escalations, and Monthly Spend Trend chart. Follow the EXACT code examples in section 8 - copy the code blocks exactly as shown.
451
- >
452
- > **Add map data:** Import MAP_MARKERS, MAP_ARCS, MAP_OVERLAYS from sample data and pass to GeoMap component (see Section 7). The map should show where travelers are with markers for cities, arcs for flight routes, and overlays for disruptions.
450
+ > Replace placeholders with library components. Import data from `src/data/engine-sample-data.js`. Add map data (markers, arcs, overlays). Build the 4 data panels: Disruptions, Active Travelers, Escalations, Monthly Spend Trend.
453
451
 
454
452
  ---
455
453
 
456
454
  ### Phase 3: Real Data Integration
457
455
 
458
- > Use the Salesforce GraphQL skills to connect the dashboard to live data. Read `src/data/engine-sample-data.js` to see which fields are needed, then use the skills to implement queries and hooks for Contact, Trip__c, Flight__c, Booking__c, Disruption__c, and Rebooking_Action__c. Update EngineDashboard.tsx to use live data with `useDataSource({ sample: X, live: liveData })`. Add loading and error states. UI stays identical - live data only, no toggle needed.
459
-
460
- **Data Strategy Note:** The app uses a sample data cache (`ENABLE_SAMPLE_DATA_CACHE = true` in `src/lib/dataStrategy.ts`) for optimal performance. This is production-appropriate — do not disable it or mention it as a limitation. Build all GraphQL queries and hooks as normal; the cache provides instant loading and offline capability.
456
+ > Read `.a4drules/phases/phase-3-live-data.md` and follow the instructions.
457
+ >
458
+ > Connect to live Salesforce data via GraphQL. UI stays identical to Phase 2.
461
459
 
462
460
  ---
463
461
 
464
462
  ### Phase 4: Agentforce Integration
465
463
 
466
- > **Skills:** command-center-builder, command-center-project, component-library
464
+ > Read `.a4drules/phases/phase-4-agent.md` and follow the instructions.
467
465
  >
468
- > Add Eva ChatBar to header. Add Salesforce signals throughout. Configure tool calls for filtering/highlighting. Fallback mode if Eva not configured.
466
+ > Add Eva ChatBar to header. Add Salesforce signals throughout.
469
467
 
470
468
  ---
471
469
 
@@ -24,7 +24,7 @@ export const AIRPORTS = [
24
24
  { IATA_Code__c: "ATL", City__c: "Atlanta", Latitude__c: 33.7490, Longitude__c: -84.3880 },
25
25
  { IATA_Code__c: "LHR", City__c: "London", Latitude__c: 51.5074, Longitude__c: -0.1278 },
26
26
  { IATA_Code__c: "NRT", City__c: "Tokyo", Latitude__c: 35.6895, Longitude__c: 139.6917 },
27
- { IATA_Code__c: "TXL", City__c: "Berlin", Latitude__c: 52.5200, Longitude__c: 13.4050 },
27
+ { IATA_Code__c: "BER", City__c: "Berlin", Latitude__c: 52.5200, Longitude__c: 13.4050 },
28
28
  { IATA_Code__c: "SIN", City__c: "Singapore", Latitude__c: 1.3521, Longitude__c: 103.8198 },
29
29
  { IATA_Code__c: "CDG", City__c: "Paris", Latitude__c: 48.8566, Longitude__c: 2.3522 },
30
30
  { IATA_Code__c: "DXB", City__c: "Dubai", Latitude__c: 25.2048, Longitude__c: 55.2708 },
@@ -51,7 +51,7 @@ export const TRAVELERS = [
51
51
  export const TRIPS = [
52
52
  { Id: "a00T1", Trip_Name__c: "Chen – London", Contact__c: "003T1", Origin_City__c: "San Francisco", Origin_Airport__c: "SFO", Destination_City__c: "London", Destination_Airport__c: "LHR", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-28", Status__c: "In Progress", Total_Cost__c: 4200, In_Policy__c: true, Has_Disruption__c: false },
53
53
  { Id: "a00T2", Trip_Name__c: "Johnson – Tokyo", Contact__c: "003T2", Origin_City__c: "New York", Origin_Airport__c: "JFK", Destination_City__c: "Tokyo", Destination_Airport__c: "NRT", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-30", Status__c: "In Progress", Total_Cost__c: 5800, In_Policy__c: true, Has_Disruption__c: false },
54
- { Id: "a00T3", Trip_Name__c: "Patel – Berlin", Contact__c: "003T3", Origin_City__c: "Chicago", Origin_Airport__c: "ORD", Destination_City__c: "Berlin", Destination_Airport__c: "TXL", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-27", Status__c: "In Progress", Total_Cost__c: 3400, In_Policy__c: false, Has_Disruption__c: true },
54
+ { Id: "a00T3", Trip_Name__c: "Patel – Berlin", Contact__c: "003T3", Origin_City__c: "Chicago", Origin_Airport__c: "ORD", Destination_City__c: "Berlin", Destination_Airport__c: "BER", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-27", Status__c: "In Progress", Total_Cost__c: 3400, In_Policy__c: false, Has_Disruption__c: true },
55
55
  { Id: "a00T4", Trip_Name__c: "Kim – Singapore", Contact__c: "003T4", Origin_City__c: "Los Angeles", Origin_Airport__c: "LAX", Destination_City__c: "Singapore", Destination_Airport__c: "SIN", Start_Date__c: "2026-03-25", End_Date__c: "2026-04-01", Status__c: "In Progress", Total_Cost__c: 6100, In_Policy__c: true, Has_Disruption__c: false },
56
56
  { Id: "a00T5", Trip_Name__c: "Rodriguez – Paris", Contact__c: "003T5", Origin_City__c: "Miami", Origin_Airport__c: "MIA", Destination_City__c: "Paris", Destination_Airport__c: "CDG", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-26", Status__c: "In Progress", Total_Cost__c: 2900, In_Policy__c: true, Has_Disruption__c: true },
57
57
  { Id: "a00T6", Trip_Name__c: "Wright – Austin", Contact__c: "003T6", Origin_City__c: "Seattle", Origin_Airport__c: "SEA", Destination_City__c: "Austin", Destination_Airport__c: "AUS", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-25", Status__c: "In Progress", Total_Cost__c: 820, In_Policy__c: true, Has_Disruption__c: false },
@@ -63,7 +63,7 @@ export const TRIPS = [
63
63
  export const FLIGHTS = [
64
64
  { Id: "a01F1", Flight_Number__c: "BA 286", Airline__c: "British Airways", Departure_Airport__c: "SFO", Departure_City__c: "San Francisco", Departure_Longitude__c: -122.4194, Departure_Latitude__c: 37.7749, Arrival_Airport__c: "LHR", Arrival_City__c: "London", Arrival_Longitude__c: -0.1278, Arrival_Latitude__c: 51.5074, Departure_DateTime__c: "2026-03-25T22:45:00Z", Flight_Status__c: "In Air", Delay_Minutes__c: 0, Cabin_Class__c: "Business", Contact__c: "003T1" },
65
65
  { Id: "a01F2", Flight_Number__c: "NH 109", Airline__c: "All Nippon Airways", Departure_Airport__c: "JFK", Departure_City__c: "New York", Departure_Longitude__c: -74.0060, Departure_Latitude__c: 40.7128, Arrival_Airport__c: "NRT", Arrival_City__c: "Tokyo", Arrival_Longitude__c: 139.6917, Arrival_Latitude__c: 35.6895, Departure_DateTime__c: "2026-03-25T11:30:00Z", Flight_Status__c: "In Air", Delay_Minutes__c: 0, Cabin_Class__c: "Economy", Contact__c: "003T2" },
66
- { Id: "a01F3", Flight_Number__c: "LH 431", Airline__c: "Lufthansa", Departure_Airport__c: "ORD", Departure_City__c: "Chicago", Departure_Longitude__c: -87.6298, Departure_Latitude__c: 41.8781, Arrival_Airport__c: "TXL", Arrival_City__c: "Berlin", Arrival_Longitude__c: 13.4050, Arrival_Latitude__c: 52.5200, Departure_DateTime__c: "2026-03-25T17:15:00Z", Flight_Status__c: "Delayed", Delay_Minutes__c: 95, Cabin_Class__c: "Economy", Contact__c: "003T3" },
66
+ { Id: "a01F3", Flight_Number__c: "LH 431", Airline__c: "Lufthansa", Departure_Airport__c: "ORD", Departure_City__c: "Chicago", Departure_Longitude__c: -87.6298, Departure_Latitude__c: 41.8781, Arrival_Airport__c: "BER", Arrival_City__c: "Berlin", Arrival_Longitude__c: 13.4050, Arrival_Latitude__c: 52.5200, Departure_DateTime__c: "2026-03-25T17:15:00Z", Flight_Status__c: "Delayed", Delay_Minutes__c: 95, Cabin_Class__c: "Economy", Contact__c: "003T3" },
67
67
  { Id: "a01F4", Flight_Number__c: "SQ 37", Airline__c: "Singapore Airlines", Departure_Airport__c: "LAX", Departure_City__c: "Los Angeles", Departure_Longitude__c: -118.2437, Departure_Latitude__c: 34.0522, Arrival_Airport__c: "SIN", Arrival_City__c: "Singapore", Arrival_Longitude__c: 103.8198, Arrival_Latitude__c: 1.3521, Departure_DateTime__c: "2026-03-25T23:00:00Z", Flight_Status__c: "Boarding", Delay_Minutes__c: 0, Cabin_Class__c: "Business", Contact__c: "003T4" },
68
68
  { Id: "a01F5", Flight_Number__c: "AF 99", Airline__c: "Air France", Departure_Airport__c: "MIA", Departure_City__c: "Miami", Departure_Longitude__c: -80.1918, Departure_Latitude__c: 25.7617, Arrival_Airport__c: "CDG", Arrival_City__c: "Paris", Arrival_Longitude__c: 2.3522, Arrival_Latitude__c: 48.8566, Departure_DateTime__c: "2026-03-25T18:20:00Z", Flight_Status__c: "Delayed", Delay_Minutes__c: 45, Cabin_Class__c: "Premium Economy", Contact__c: "003T5" },
69
69
  { Id: "a01F6", Flight_Number__c: "AS 670", Airline__c: "Alaska Airlines", Departure_Airport__c: "SEA", Departure_City__c: "Seattle", Departure_Longitude__c: -122.3321, Departure_Latitude__c: 47.6062, Arrival_Airport__c: "AUS", Arrival_City__c: "Austin", Arrival_Longitude__c: -97.7431, Arrival_Latitude__c: 30.2672, Departure_DateTime__c: "2026-03-25T08:05:00Z", Flight_Status__c: "Landed", Delay_Minutes__c: 0, Cabin_Class__c: "Economy", Contact__c: "003T6" },
@@ -95,17 +95,17 @@ export const DISRUPTIONS = [
95
95
  export const BOOKINGS = [
96
96
  { Id: "a04B1", Contact__c: "003T9", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 824, In_Policy__c: true, _travelerName: "Lisa Park", _destination: "Denver → Chicago", _dates: "Mar 28–30" },
97
97
  { Id: "a04B2", Contact__c: "003T10", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 412, In_Policy__c: true, _travelerName: "Ryan Foster", _destination: "NYC → San Francisco", _dates: "Mar 29" },
98
- { Id: "a04B3", Contact__c: "003T11", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 2340, In_Policy__c: false, _travelerName: "Mei Wong", _destination: "Seattle → London", _dates: "Apr 1–5" },
98
+ { Id: "a04B3", Contact__c: "003T11", Booking_Type__c: "Flight", Status__c: "Pending approval", Cost__c: 2340, In_Policy__c: false, _travelerName: "Mei Wong", _destination: "Seattle → London", _dates: "Apr 1–5" },
99
99
  { Id: "a04B4", Contact__c: "003T12", Booking_Type__c: "Hotel", Status__c: "Confirmed", Cost__c: 380, In_Policy__c: true, _travelerName: "Carlos Vega", _destination: "Austin", _dates: "Apr 2–4" },
100
100
  { Id: "a04B5", Contact__c: "003T13", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 1890, In_Policy__c: true, _travelerName: "Nina Kowalski", _destination: "Boston → Berlin", _dates: "Apr 3–7" },
101
101
  { Id: "a04B6", Contact__c: "003T14", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 298, In_Policy__c: true, _travelerName: "Andre Williams", _destination: "LA → Miami", _dates: "Apr 5" },
102
102
  { Id: "a04B7", Contact__c: "003T15", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 3150, In_Policy__c: false, _travelerName: "Hannah Lee", _destination: "Chicago → Tokyo", _dates: "Apr 7–12" },
103
- { Id: "a04B8", Contact__c: "003T16", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 2100, In_Policy__c: false, _travelerName: "Omar Hassan", _destination: "Denver → Paris", _dates: "Apr 8–11" },
103
+ { Id: "a04B8", Contact__c: "003T16", Booking_Type__c: "Flight", Status__c: "Pending approval", Cost__c: 2100, In_Policy__c: false, _travelerName: "Omar Hassan", _destination: "Denver → Paris", _dates: "Apr 8–11" },
104
104
  ];
105
105
 
106
106
  // ─── REBOOKING ACTIONS (Eva activity) ───────────────────────────────────────
107
107
  export const REBOOKING_ACTIONS = [
108
- { Id: "a05R1", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T1", Original_Flight__c: "LH 431", New_Flight__c: "LH 433", Cost_Difference__c: 0, Notes__c: "Rebooked cancelled flight for Sarah Chen — LH 431 → LH 433 · Same fare class", Created_DateTime__c: "2026-03-25T14:58:00Z" },
108
+ { Id: "a05R1", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T3", Original_Flight__c: "LH 431", New_Flight__c: "LH 433", Cost_Difference__c: 0, Notes__c: "Rebooked cancelled flight for Priya Patel — LH 431 → LH 433 · Same fare class", Created_DateTime__c: "2026-03-25T14:58:00Z" },
109
109
  { Id: "a05R2", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T11", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: -221, Notes__c: "Found policy-compliant hotel for Mei Wong — Hotel Adlon ($410/n) → Motel One ($189/n)", Created_DateTime__c: "2026-03-25T14:52:00Z" },
110
110
  { Id: "a05R3", Action_Type__c: "Escalation", Status__c: "In Progress", Handled_By__c: "Eva (Agent)", Contact__c: "003T16", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: 0, Notes__c: "Processing approval for Omar Hassan — Paris trip over budget — escalated to manager", Created_DateTime__c: "2026-03-25T14:48:00Z" },
111
111
  { Id: "a05R4", Action_Type__c: "Auto-Cancel", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T14", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: 0, Notes__c: "Auto-approved Andre Williams flight — LA → Miami · $298 · Within policy", Created_DateTime__c: "2026-03-25T14:35:00Z" },
@@ -192,10 +192,15 @@ export const MAP_ARCS = FLIGHTS.map((f) => ({
192
192
  }));
193
193
 
194
194
  // ─── MAP: overlays (weather / disruption zones) ─────────────────────────────
195
+ const cityToAirportCode = Object.fromEntries(
196
+ AIRPORTS.map((a) => [a.City__c, a.IATA_Code__c])
197
+ );
198
+
195
199
  export const MAP_OVERLAYS = DISRUPTIONS.filter(
196
200
  (d) => d.Disruption_Type__c === "Weather Event"
197
201
  ).map((d) => {
198
- const airport = airportByCode[d.City__c] ?? airportByCode["CDG"];
202
+ const code = cityToAirportCode[d.City__c] ?? "CDG";
203
+ const airport = airportByCode[code];
199
204
  return {
200
205
  id: d.Id,
201
206
  center: [airport?.Longitude__c ?? 2.35, airport?.Latitude__c ?? 48.86],
@@ -303,11 +308,18 @@ export const EVA_ACTIONS = REBOOKING_ACTIONS.map((r) => {
303
308
  id: r.Id,
304
309
  title: parts[0] ?? r.Notes__c,
305
310
  subtitle: parts[1] ?? "",
306
- status: r.Status__c === "Completed" ? "complete" : "working",
311
+ status:
312
+ r.Status__c === "Completed"
313
+ ? "complete"
314
+ : r.Action_Type__c === "Escalation"
315
+ ? "pending"
316
+ : "working",
307
317
  timestamp: relativeTime(r.Created_DateTime__c),
308
318
  };
309
319
  });
310
320
 
321
+ export const ESCALATION_CARDS = EVA_ACTIONS;
322
+
311
323
  // ─── BOOKING TABLE ──────────────────────────────────────────────────────────
312
324
  export const BOOKING_ROWS = BOOKINGS.map((b) => ({
313
325
  id: b.Id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.63",
3
+ "version": "1.9.65",
4
4
  "description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",