@schandlergarcia/sf-web-components 1.9.69 → 1.9.71

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.
@@ -46,7 +46,7 @@ The component library (`@/components/library`) provides pre-built, themed, dark-
46
46
  | KPI / stat | `MetricCard` | `<div className="bg-white border ..."><h3>Total Spend</h3><span>$4,903</span></div>` |
47
47
  | List of items | `ListCard` | `<div className="bg-white ..."><div className="space-y-3">` with custom item rows |
48
48
  | Activity feed (display only) | `ActivityCard` or `FeedPanel` | `<div>` with hand-rolled interaction rows |
49
- | Activity feed (with per-item actions) | Custom markup inside `BaseCard` | `ActivityCard` (doesn't support per-item buttons) |
49
+ | **Activity feed (with per-item actions like "Assign to Agent")** | **Custom markup inside `BaseCard`** | **`ActivityCard` (doesn't support per-item buttons — see Engine PRD Section 8a)** |
50
50
  | Data table | `TableCard` | `<table>` or custom grid of rows |
51
51
  | Stats panel | `WidgetCard` or `SectionCard` | `<div className="bg-white ... p-6">` with label/value pairs |
52
52
  | Custom interactive content (expand/collapse, inline details) | `WidgetCard` (sections accept arbitrary JSX) or `ListCard` (with `onItemClick` + `itemActions`) | Hand-rolled `<div>` card with custom expand/collapse logic |
@@ -104,7 +104,7 @@ No `<nav>`, header bar, tab bar, or content-swapping via `useState("activeTab")`
104
104
 
105
105
  - Dashboard page files: `src/pages/` (e.g. `EngineDashboard.tsx`, `FleetDashboard.tsx`) — **NOT** `src/components/pages/`
106
106
  - File format: `.tsx` (MUST be TypeScript) — this is a TypeScript project, all React components use `.tsx`, NEVER `.jsx`.
107
- - `CommandCenter.tsx` wraps with `AppThemeProvider` + `DataModeProvider` + `Toaster`. **Never recreate these providers in dashboard pages.**
107
+ - `CommandCenter.tsx` wraps with `heroui-scope` div + `AppThemeProvider` + `DataModeProvider` + `Toast.Provider` from `@heroui/react`. **Never recreate these providers in dashboard pages.** When wiring a new dashboard, only change the import — preserve the `heroui-scope` wrapper and `Toast.Provider` exactly as-is. For toasts inside dashboards, use `toast` from `sonner` (not `addToast` from HeroUI).
108
108
 
109
109
  ### Wiring a new dashboard (REQUIRED STEPS)
110
110
 
@@ -125,22 +125,24 @@ export default function MyDashboard() {
125
125
  }
126
126
  ```
127
127
 
128
- **Step 2:** Update `CommandCenter.tsx` to import and render it:
128
+ **Step 2:** Update `CommandCenter.tsx` to import and render it. Only change the import line — preserve `heroui-scope` and `Toast.Provider`:
129
129
  ```tsx
130
130
  // src/components/workspace/CommandCenter.tsx
131
131
  import AppThemeProvider from "@/components/library/theme/AppThemeProvider";
132
132
  import DataModeProvider from "@/components/library/data/DataModeProvider";
133
- import { Toaster } from "sonner";
134
- import MyDashboard from "../../pages/MyDashboard"; // ← change this import
133
+ import { Toast } from "@heroui/react";
134
+ import MyDashboard from "../../pages/MyDashboard"; // ← change ONLY this import
135
135
 
136
136
  export default function CommandCenter() {
137
137
  return (
138
- <AppThemeProvider initialMode="light">
139
- <DataModeProvider initialMode="sample">
140
- <MyDashboard /> {/* ← change this */}
141
- <Toaster position="bottom-right" />
142
- </DataModeProvider>
143
- </AppThemeProvider>
138
+ <div className="heroui-scope"> {/* ← preserve this wrapper */}
139
+ <AppThemeProvider initialMode="light">
140
+ <DataModeProvider initialMode="sample">
141
+ <MyDashboard /> {/* ← change this */}
142
+ <Toast.Provider placement="bottom end" /> {/* ← preserve this */}
143
+ </DataModeProvider>
144
+ </AppThemeProvider>
145
+ </div>
144
146
  );
145
147
  }
146
148
  ```
@@ -501,7 +503,8 @@ Instead, verify correctness by reviewing the code against the Pre-Completion Che
501
503
  - Using `template` prop on D3Chart — use `renderChart={D3ChartTemplates.lineChart}`
502
504
  - Passing D3Chart as children to ChartCard — use `chart={<D3Chart ... />}` prop
503
505
  - Adding `<nav>` or tab-swapping (`useState("activeTab")`) inside dashboards
504
- - Recreating providers — `CommandCenter.tsx` already provides them
506
+ - Recreating providers — `CommandCenter.tsx` already provides them. Do not replace `Toast.Provider` with `Toaster` from sonner, and do not remove the `heroui-scope` div
507
+ - Using `addToast` from `@heroui/react` — use `toast` / `toast.success` from `sonner` instead
505
508
  - Using `text-black`, `text-white`, `bg-black` — use slate scale
506
509
  - Hardcoded data without `useDataSource` — always support sample/live switching
507
510
  - `position: fixed` without `createPortal`
package/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ 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.71] - 2026-04-02
9
+
10
+ ### Updated
11
+ - **PRD (engine-command-center-prd.md)** - Latest updates from react-cursor-1
12
+
13
+ ## [1.9.70] - 2026-04-02
14
+
15
+ ### Updated
16
+ - **PRD (engine-command-center-prd.md)** - 5 edits for phasing clarity and toast API:
17
+ - Section 4 (Architecture): Added explicit rules to preserve `heroui-scope` wrapper and `Toast.Provider` in CommandCenter. Added `toast` from `sonner` as the correct toast API
18
+ - Section 6 (Header): Added "(Phase 4)" tag to "Powered by Agentforce" badge
19
+ - Section 8a (Escalations): Added "(Phase 4)" tag to "Assign to Agent" button, noted `toast.success` comes via `sonner`, added instruction to render button with empty `onClick` in Phase 2 and wire toast in Phase 4
20
+ - Section 10 (Signals): Changed `toast()` and `toast.success()` to include full call examples with "via sonner" annotation
21
+ - Section 13, Phase 3 prompt: Added file paths for queries and hook, code example showing how to wire `useEngineLiveData()` into `useDataSource({ sample: ..., live: live.xxx })`, clarified hook should match sample data shape
22
+
23
+ - **Builder skill (SKILL.md)** - 3 edits for toast API and wiring:
24
+ - Wiring section: Changed description from Toaster to `heroui-scope` + `Toast.Provider` from `@heroui/react`. Added rule to use `toast` from `sonner` for dashboard toasts
25
+ - Wiring example (Step 2): Replaced sonner Toaster code with actual pattern: `heroui-scope` div, `Toast.Provider` from `@heroui/react`, with comments marking "preserve this" vs "change this"
26
+ - Component table: Bolded "per-item actions" row and added "see Engine PRD Section 8a" cross-reference
27
+ - Anti-patterns: Added two entries: (1) don't replace `Toast.Provider` with sonner's `Toaster` or remove `heroui-scope`, (2) don't use `addToast` from HeroUI — use `toast` from `sonner`
28
+
29
+ **Context:** Clarified phasing tags for Phase 4 features (badge, agent buttons) and documented correct toast API pattern (HeroUI provider + sonner toast function).
30
+
8
31
  ## [1.9.69] - 2026-04-01
9
32
 
10
33
  ### Fixed
@@ -50,7 +50,8 @@ Use `brand-*` Tailwind classes for brand elements. Tailwind built-in colors (gre
50
50
  ## 4. Architecture
51
51
 
52
52
  - **Dashboard file:** `src/pages/EngineDashboard.tsx`
53
- - **Wiring:** `CommandCenter.tsx` imports and renders `EngineDashboard` inside the existing provider stack. Never recreate providers in the dashboard.
53
+ - **Wiring:** `CommandCenter.tsx` imports and renders `EngineDashboard` inside the existing provider stack. Never recreate providers in the dashboard. When updating `CommandCenter.tsx`, only change the dashboard import line — preserve the `heroui-scope` wrapper div and `Toast.Provider` from `@heroui/react` exactly as-is.
54
+ - **Toasts:** Import `toast` from `@heroui/react` in dashboard pages. Use `toast.success("message")` for success toasts and `toast("message")` for informational ones. The `Toast.Provider` in CommandCenter handles rendering — do not add a second `Toaster` or replace the existing provider.
54
55
  - **Imports:** Components from `@/components/library`. Theme from `@/components/library/theme/AppThemeProvider`.
55
56
 
56
57
  ---
@@ -119,7 +120,7 @@ Compact `h-12` sticky header (`bg-slate-900 dark:bg-slate-950`). No ChatBar in t
119
120
 
120
121
  | Left | Right |
121
122
  |------|-------|
122
- | Engine logo (`GlobeAltIcon` in `bg-brand-600` square) + "ENGINE" wordmark + separator + "Travel Command Center" + "Powered by Agentforce" badge (`bg-brand-900/40 text-brand-400 rounded-full text-[10px]`) | Notification bell (badge count) + theme toggle (sun/moon) |
123
+ | Engine logo (`GlobeAltIcon` in `bg-brand-600` square) + "ENGINE" wordmark + separator + "Travel Command Center" + "Powered by Agentforce" badge (Phase 4: `bg-brand-900/40 text-brand-400 rounded-full text-[10px]`) | Notification bell (badge count) + theme toggle (sun/moon) |
123
124
 
124
125
  ---
125
126
 
@@ -169,7 +170,7 @@ Custom inline panel in BaseCard. Do NOT use ActivityCard — this panel has per-
169
170
  Each escalation row:
170
171
  - Status icon: `CheckCircleIcon` (complete, green), `ArrowPathIcon` (working, brand), `ClockIcon` (pending, amber)
171
172
  - Title + subtitle + timestamp
172
- - **"Assign to Agent" button** on items where status is NOT `"complete"`: teal button (`bg-brand-600`) with `SparklesIcon` + "Assign to Agent" text. On click: `toast.success("Assigned to Eva")`
173
+ - **"Assign to Agent" button** (Phase 4) on items where status is NOT `"complete"`: teal button (`bg-brand-600`) with `SparklesIcon` + "Assign to Agent" text. On click: `toast.success("Assigned to Eva")` via `@heroui/react`. In Phase 2, render the button but leave the `onClick` empty — wire the toast in Phase 4.
173
174
 
174
175
  ```tsx
175
176
  <BaseCard>
@@ -292,8 +293,8 @@ Subtle indicators, not banners.
292
293
  |--------|----------|
293
294
  | "Powered by Agentforce" | Header, next to "Travel Command Center" (small rounded badge) |
294
295
  | "View in Salesforce" | Traveler expanded view (micro-link, muted text) |
295
- | "Salesforce updated" | After rebook/approve actions (`toast()`) |
296
- | "Assigned to Eva" | After "Assign to Agent" button click (`toast.success()`) |
296
+ | "Salesforce updated" | After rebook/approve actions `toast("Opening in Salesforce…")` via `@heroui/react` |
297
+ | "Assigned to Eva" | After "Assign to Agent" button click `toast.success("Assigned to Eva")` via `@heroui/react` |
297
298
 
298
299
  ---
299
300
 
@@ -328,7 +329,14 @@ Build in 4 incremental phases.
328
329
 
329
330
  ### Phase 3: Real Data Integration
330
331
 
331
- > Connect the dashboard to live Salesforce data using GraphQL. Read the sample data file to see which fields are needed, then build queries and hooks for each object. The UI should stay identical just swap the data source.
332
+ > Connect the dashboard to live Salesforce data using GraphQL. Read the sample data file to see which fields are needed, then build queries in `src/api/engine/queries.ts` and a hook in `src/hooks/useEngineLiveData.ts` for each object. The hook should return the same data shape as the sample data exports. Wire it into the dashboard by populating the `live` prop on each `useDataSource` call:
333
+ >
334
+ > ```tsx
335
+ > const live = useEngineLiveData();
336
+ > const markers = useDataSource({ sample: MAP_MARKERS, live: live.mapMarkers });
337
+ > ```
338
+ >
339
+ > The UI should stay identical — only the data source changes.
332
340
 
333
341
  ### Phase 4: Agentforce Integration
334
342
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.69",
3
+ "version": "1.9.71",
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",