@schandlergarcia/sf-web-components 1.9.46 → 1.9.48

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/CHANGELOG.md CHANGED
@@ -73,6 +73,76 @@ Between versions 1.9.29 and 1.9.42, a critical inconsistency existed that broke
73
73
 
74
74
  ---
75
75
 
76
+ ## [1.9.48] - 2026-04-01
77
+
78
+ ### Changed
79
+ - **scripts/reset-command-center.sh** - Home page now resets to search page template (not CommandCenter)
80
+ - Issue: Reset forced users into CommandCenter/BlankDashboard pattern
81
+ - Expected: Reset should restore template default (search page)
82
+ - Previous behavior: Home → CommandCenter → BlankDashboard → "Bespoke App Template" EmptyState
83
+ - New behavior: Home → Search page with UIInput/UIButton for finding Salesforce records
84
+ - Updated final message: "/ → Home (search page)" instead of "/ → Home (CommandCenter dashboard)"
85
+
86
+ ### Rationale
87
+ - **Reset should mean "go back to template"** not "force command center pattern"
88
+ - Users building command centers can manually wire their dashboard
89
+ - Search page is the more universal default
90
+ - CommandCenter/BlankDashboard still available, just not forced on reset
91
+ - Aligns with postinstall behavior (which installs search Home.tsx)
92
+
93
+ ### For Command Center Users
94
+ If you want Home to render a command center dashboard:
95
+
96
+ 1. Create your dashboard (e.g., `src/pages/EngineDashboard.tsx`)
97
+ 2. Update Home.tsx:
98
+ ```tsx
99
+ import EngineDashboard from './EngineDashboard';
100
+ export default function Home() {
101
+ return <EngineDashboard />;
102
+ }
103
+ ```
104
+
105
+ Or use CommandCenter as a wrapper:
106
+
107
+ 1. Edit `src/components/workspace/CommandCenter.tsx` to render your dashboard
108
+ 2. Update Home.tsx:
109
+ ```tsx
110
+ import CommandCenter from '../components/workspace/CommandCenter';
111
+ export default function Home() {
112
+ return <CommandCenter />;
113
+ }
114
+ ```
115
+
116
+ ---
117
+
118
+ ## [1.9.47] - 2026-04-01
119
+
120
+ ### Fixed
121
+ - **scripts/reset-command-center.sh** - Now removes ALL custom pages, not just files matching `*Dashboard*` pattern
122
+ - Issue: `EngineCommandCenter.tsx` wasn't removed because it doesn't match `*Dashboard*` pattern
123
+ - Cause: Script only looked for `*Dashboard*.jsx` and `*Dashboard*.tsx` files
124
+ - Fix: Changed logic to remove all `.jsx` and `.tsx` files in `src/pages/` except template files
125
+ - Template files (kept): `Home.tsx`, `Search.tsx`, `NotFound.tsx`, `BlankDashboard.tsx`
126
+ - Now removes: `EngineCommandCenter.tsx`, `MyDashboard.tsx`, `CustomPage.tsx`, etc.
127
+
128
+ ### Changed
129
+ - Reset script message updated from "Removing custom dashboards..." to "Removing custom pages..." to better reflect behavior
130
+ - Added explicit keep-list of template files for clarity
131
+
132
+ ### Technical Details
133
+ Previous pattern:
134
+ ```bash
135
+ for f in src/pages/*Dashboard*.jsx src/pages/*Dashboard*.tsx; do
136
+ ```
137
+
138
+ New approach:
139
+ ```bash
140
+ KEEP_FILES=("Home.tsx" "Search.tsx" "NotFound.tsx" "BlankDashboard.tsx")
141
+ # Remove all .jsx/.tsx except templates
142
+ ```
143
+
144
+ ---
145
+
76
146
  ## [1.9.46] - 2026-04-01
77
147
 
78
148
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "1.9.46",
3
+ "version": "1.9.48",
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",
@@ -73,6 +73,7 @@
73
73
  "world-atlas": "^2.0.0"
74
74
  },
75
75
  "dependencies": {
76
+ "@schandlergarcia/sf-web-components": "^1.9.47",
76
77
  "class-variance-authority": "^0.7.1",
77
78
  "clsx": "^2.1.1",
78
79
  "glob": "^11.0.0",
@@ -34,24 +34,42 @@ echo "║ Reset App → Baseline State ║"
34
34
  echo "╚════════════════════════════════════════════════╝"
35
35
  echo ""
36
36
 
37
- # ── 1. Remove custom dashboard pages (keep library & workspace) ─────────────
37
+ # ── 1. Remove custom dashboard/page files (keep templates) ─────────────────
38
38
 
39
- echo "→ Removing custom dashboards…"
39
+ echo "→ Removing custom pages…"
40
+
41
+ # List of template files that should NOT be removed
42
+ KEEP_FILES=("Home.tsx" "Search.tsx" "NotFound.tsx" "BlankDashboard.tsx")
40
43
 
41
44
  removed=0
42
- for f in src/pages/*Dashboard*.jsx src/pages/*Dashboard*.tsx; do
43
- if [ -f "$f" ]; then
44
- # Don't remove BlankDashboard.tsx (it's the template)
45
- if [[ "$(basename "$f")" != "BlankDashboard.tsx" ]]; then
46
- rm "$f"
47
- echo " ✓ Removed $(basename "$f")"
48
- removed=$((removed + 1))
45
+
46
+ # Remove all .jsx and .tsx files in src/pages/ except templates
47
+ if [ -d "src/pages" ]; then
48
+ for f in src/pages/*.jsx src/pages/*.tsx; do
49
+ if [ -f "$f" ]; then
50
+ filename="$(basename "$f")"
51
+
52
+ # Check if this file should be kept
53
+ should_keep=false
54
+ for keep in "${KEEP_FILES[@]}"; do
55
+ if [[ "$filename" == "$keep" ]]; then
56
+ should_keep=true
57
+ break
58
+ fi
59
+ done
60
+
61
+ # Remove if not in keep list
62
+ if [ "$should_keep" = false ]; then
63
+ rm "$f"
64
+ echo " ✓ Removed $(basename "$f")"
65
+ removed=$((removed + 1))
66
+ fi
49
67
  fi
50
- fi
51
- done
68
+ done
69
+ fi
52
70
 
53
71
  if [ "$removed" -eq 0 ]; then
54
- echo " (no custom dashboards found)"
72
+ echo " (no custom pages found)"
55
73
  fi
56
74
  echo ""
57
75
 
@@ -126,20 +144,73 @@ WRAPPER_EOF
126
144
  echo " ✓ Wired up BlankDashboard"
127
145
  echo ""
128
146
 
129
- # ── 4. Reset Home.tsx to render CommandCenter ────────────────────────────────
147
+ # ── 4. Reset Home.tsx to search page template ───────────────────────────────
130
148
 
131
149
  HOME="src/pages/Home.tsx"
132
- echo "→ Updating ${HOME}..."
150
+ echo "→ Restoring ${HOME} from template..."
133
151
 
134
152
  cat > "$HOME" << 'HOME_EOF'
135
- import CommandCenter from "../components/workspace/CommandCenter";
153
+ import { useState } from "react";
154
+ import { useNavigate } from "react-router";
155
+ import UIInput from '@/components/library/ui/UIInput';
156
+ import UIButton from '@/components/library/ui/UIButton';
157
+ import { Search } from "lucide-react";
158
+
159
+ export default function HomePage() {
160
+ const [searchQuery, setSearchQuery] = useState("");
161
+ const navigate = useNavigate();
162
+
163
+ const handleSearch = () => {
164
+ const trimmed = searchQuery.trim();
165
+ if (trimmed) {
166
+ navigate(`/accounts?search=${encodeURIComponent(trimmed)}`);
167
+ } else {
168
+ navigate('/accounts');
169
+ }
170
+ };
171
+
172
+ const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
173
+ if (e.key === "Enter") {
174
+ e.preventDefault();
175
+ handleSearch();
176
+ }
177
+ };
136
178
 
137
- export default function Home() {
138
- return <CommandCenter />;
179
+ return (
180
+ <div className="flex min-h-[80vh] items-center justify-center px-4 sm:px-6 lg:px-8 bg-slate-50 dark:bg-slate-950 transition-colors">
181
+ <div className="w-full max-w-4xl">
182
+ <div className="text-center mb-8">
183
+ <h1 className="text-4xl font-bold text-slate-900 dark:text-slate-50 mb-4">Search</h1>
184
+ <p className="text-lg text-slate-600 dark:text-slate-300">Find records across your organization.</p>
185
+ </div>
186
+ <div className="flex flex-col gap-4">
187
+ <div className="relative">
188
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-5 w-5 text-slate-400" />
189
+ <UIInput
190
+ type="text"
191
+ value={searchQuery}
192
+ onChange={(e) => setSearchQuery(e.target.value)}
193
+ onKeyDown={handleKeyDown}
194
+ placeholder="Search..."
195
+ className="pl-10 w-full"
196
+ />
197
+ </div>
198
+ <div className="flex gap-3 justify-center">
199
+ <UIButton onClick={handleSearch} variant="primary">
200
+ Search
201
+ </UIButton>
202
+ <UIButton onClick={() => navigate('/accounts')} variant="secondary">
203
+ Browse All
204
+ </UIButton>
205
+ </div>
206
+ </div>
207
+ </div>
208
+ </div>
209
+ );
139
210
  }
140
211
  HOME_EOF
141
212
 
142
- echo " ✓ Home renders CommandCenter"
213
+ echo " ✓ Home restored to search page"
143
214
  echo ""
144
215
 
145
216
  # ── 5. Ensure Search.tsx page exists ─────────────────────────────────────────
@@ -344,12 +415,14 @@ echo "║ • Salesforce SDK stubs for local dev ║"
344
415
  echo "║ • All styles & dependencies ║"
345
416
  echo "║ ║"
346
417
  echo "║ Layout: ║"
347
- echo "║ / → Home (CommandCenter dashboard) ║"
348
- echo "║ /search → Search (global search input) ║"
418
+ echo "║ / → Home (search page) ║"
419
+ echo "║ /search → Search (search page) ║"
349
420
  echo "║ Nav bar on Home + Search pages only ║"
350
421
  echo "║ ║"
351
422
  echo "║ Start building: ║"
352
- echo "║ Edit src/pages/BlankDashboard.tsx ║"
423
+ echo "║ • For dashboards: Edit BlankDashboard.tsx ║"
424
+ echo "║ then wire into routes or CommandCenter ║"
425
+ echo "║ • For search app: Ready to go! ║"
353
426
  echo "║ npm run dev ║"
354
427
  echo "╚════════════════════════════════════════════════╝"
355
428
  echo ""