AUXteam commited on
Commit
1b1fb7e
·
verified ·
1 Parent(s): 6aefcc0

Upload folder using huggingface_hub

Browse files
components/SimulationGraph.tsx CHANGED
@@ -177,14 +177,6 @@ const SimulationGraph: React.FC<SimulationGraphProps> = ({ isBuilding, societyTy
177
 
178
  return (
179
  <div className="relative w-full h-full bg-black">
180
- {/* Loading Overlay */}
181
- {isBuilding && (
182
- <div className="absolute inset-0 z-50 flex flex-col items-center justify-center bg-black/80 backdrop-blur-sm transition-opacity duration-300">
183
- <div className="w-16 h-16 border-4 border-teal-900 border-t-teal-500 rounded-full animate-spin mb-4"></div>
184
- <p className="text-teal-400 font-mono animate-pulse">Constructing Focus Group Graph...</p>
185
- </div>
186
- )}
187
-
188
  {/* The Graph */}
189
  <div ref={graphDiv} className="w-full h-full" />
190
 
 
177
 
178
  return (
179
  <div className="relative w-full h-full bg-black">
 
 
 
 
 
 
 
 
180
  {/* The Graph */}
181
  <div ref={graphDiv} className="w-full h-full" />
182
 
components/SimulationPage.tsx CHANGED
@@ -450,6 +450,8 @@ const SimulationPage: React.FC<SimulationPageProps> = ({
450
  onClick={async () => {
451
  if (activeModal === 'assemble') {
452
  setIsBuilding(true);
 
 
453
  try {
454
  // 1. Generate personas based on profile and company info
455
  const personas = await GradioService.generatePersonas(formData.companyInfo, formData.customerProfile, Math.ceil(formData.personaScale / 20));
@@ -472,12 +474,10 @@ const SimulationPage: React.FC<SimulationPageProps> = ({
472
  // 4. Update UI
473
  setSocieties(prev => [groupName, ...prev]);
474
  setSociety(groupName);
475
- setActiveModal('none');
476
  alert('Focus group assembled and selected!');
477
  } catch (e) {
478
  console.error(e);
479
- alert('Failed to assemble group via API. Falling back to local save.');
480
- setActiveModal('none');
481
  } finally {
482
  setIsBuilding(false);
483
  }
@@ -533,6 +533,18 @@ const SimulationPage: React.FC<SimulationPageProps> = ({
533
  <button onClick={() => setIsRightPanelOpen(false)} className="text-gray-500 hover:text-white"><PanelRightClose size={18}/></button>
534
  </div>
535
  <div className="flex-1 overflow-y-auto p-4 space-y-4">
 
 
 
 
 
 
 
 
 
 
 
 
536
  <div className="bg-gray-900/50 border border-gray-800 rounded-xl p-4">
537
  <div className="flex items-center justify-between mb-2">
538
  <p className="text-xs text-gray-500">Simulation Results</p>
 
450
  onClick={async () => {
451
  if (activeModal === 'assemble') {
452
  setIsBuilding(true);
453
+ setIsRightPanelOpen(true);
454
+ setActiveModal('none');
455
  try {
456
  // 1. Generate personas based on profile and company info
457
  const personas = await GradioService.generatePersonas(formData.companyInfo, formData.customerProfile, Math.ceil(formData.personaScale / 20));
 
474
  // 4. Update UI
475
  setSocieties(prev => [groupName, ...prev]);
476
  setSociety(groupName);
 
477
  alert('Focus group assembled and selected!');
478
  } catch (e) {
479
  console.error(e);
480
+ alert('Failed to assemble group via API.');
 
481
  } finally {
482
  setIsBuilding(false);
483
  }
 
533
  <button onClick={() => setIsRightPanelOpen(false)} className="text-gray-500 hover:text-white"><PanelRightClose size={18}/></button>
534
  </div>
535
  <div className="flex-1 overflow-y-auto p-4 space-y-4">
536
+ {isBuilding && (
537
+ <div className="bg-teal-900/20 border border-teal-500/30 rounded-xl p-4 mb-4 animate-in fade-in slide-in-from-top-2">
538
+ <div className="flex items-center gap-3">
539
+ <RefreshCw className="w-4 h-4 text-teal-400 animate-spin" />
540
+ <div className="flex flex-col">
541
+ <span className="text-xs font-bold text-teal-400">Assembling...</span>
542
+ <span className="text-[10px] text-teal-400/60 font-mono">Constructing network mesh</span>
543
+ </div>
544
+ </div>
545
+ </div>
546
+ )}
547
+
548
  <div className="bg-gray-900/50 border border-gray-800 rounded-xl p-4">
549
  <div className="flex items-center justify-between mb-2">
550
  <p className="text-xs text-gray-500">Simulation Results</p>