Spaces:
Build error
Build error
ENHANCE: Break down menu items for individual tracking
Browse filesMenu Changes:
- Split combined item 2 into 5 distinct items:
1. Your name
2. The date
3. The time
4. The length (duration)
5. The agenda (meeting topic)
6. GoogleMeet or phone call
7. Your phone number
JavaScript Updates:
- Rewrote updateMenuItemColors() to track each item individually
- Each menu item now updates independently: RED (missing), GREEN (collected)
- Removed orange partial state for better clarity
Benefits:
- More granular visual feedback for users
- Clearer indication of exactly what information is still needed
- Better UX for multi-turn conversations
Version: 1.4.2
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- app/api/chat_widget.py +50 -17
- pyproject.toml +1 -1
- unit_tests/README.md +1 -1
- version.txt +1 -1
app/api/chat_widget.py
CHANGED
|
@@ -635,11 +635,14 @@ async def chat_widget(request: Request, email: str = None):
|
|
| 635 |
</div>
|
| 636 |
|
| 637 |
<div style="text-align: left; background: #e8f5e9; padding: 10px 15px; margin: 15px 15px 180px 15px; border-radius: 8px; border-left: 4px solid #4caf50; font-size: 14px;">
|
| 638 |
-
<p style="margin: 0; font-weight: bold; font-size: 15px;">To book a meeting:</p>
|
| 639 |
-
<p id="menuItem1" style="margin: 5px 0 2px 0; font-size: 13px; color: #
|
| 640 |
-
<p id="menuItem2" style="margin: 2px 0; font-size: 13px; color: #
|
| 641 |
-
<p id="menuItem3" style="margin: 2px 0; font-size: 13px; color: #
|
| 642 |
-
<p id="menuItem4" style="margin: 2px 0
|
|
|
|
|
|
|
|
|
|
| 643 |
</div>
|
| 644 |
|
| 645 |
<div class="quick-actions">
|
|
@@ -2436,28 +2439,22 @@ async def chat_widget(request: Request, email: str = None):
|
|
| 2436 |
}
|
| 2437 |
}
|
| 2438 |
|
| 2439 |
-
// Menu item 2: Date
|
| 2440 |
const menuItem2 = document.getElementById('menuItem2');
|
| 2441 |
if (menuItem2) {
|
| 2442 |
-
|
| 2443 |
-
userInfo.duration_minutes && userInfo.topic;
|
| 2444 |
-
if (hasAll) {
|
| 2445 |
menuItem2.style.color = '#4caf50'; // Green
|
| 2446 |
menuItem2.style.fontWeight = 'bold';
|
| 2447 |
-
} else if (userInfo.date_string || userInfo.time_string ||
|
| 2448 |
-
userInfo.duration_minutes || userInfo.topic) {
|
| 2449 |
-
menuItem2.style.color = '#ff9800'; // Orange (partial)
|
| 2450 |
-
menuItem2.style.fontWeight = 'normal';
|
| 2451 |
} else {
|
| 2452 |
menuItem2.style.color = '#f44336'; // Red
|
| 2453 |
menuItem2.style.fontWeight = 'normal';
|
| 2454 |
}
|
| 2455 |
}
|
| 2456 |
|
| 2457 |
-
// Menu item 3:
|
| 2458 |
const menuItem3 = document.getElementById('menuItem3');
|
| 2459 |
if (menuItem3) {
|
| 2460 |
-
if (userInfo.
|
| 2461 |
menuItem3.style.color = '#4caf50'; // Green
|
| 2462 |
menuItem3.style.fontWeight = 'bold';
|
| 2463 |
} else {
|
|
@@ -2466,10 +2463,10 @@ async def chat_widget(request: Request, email: str = None):
|
|
| 2466 |
}
|
| 2467 |
}
|
| 2468 |
|
| 2469 |
-
// Menu item 4:
|
| 2470 |
const menuItem4 = document.getElementById('menuItem4');
|
| 2471 |
if (menuItem4) {
|
| 2472 |
-
if (userInfo.
|
| 2473 |
menuItem4.style.color = '#4caf50'; // Green
|
| 2474 |
menuItem4.style.fontWeight = 'bold';
|
| 2475 |
} else {
|
|
@@ -2477,6 +2474,42 @@ async def chat_widget(request: Request, email: str = None):
|
|
| 2477 |
menuItem4.style.fontWeight = 'normal';
|
| 2478 |
}
|
| 2479 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2480 |
} catch (error) {
|
| 2481 |
console.error('Error updating menu colors:', error);
|
| 2482 |
}
|
|
|
|
| 635 |
</div>
|
| 636 |
|
| 637 |
<div style="text-align: left; background: #e8f5e9; padding: 10px 15px; margin: 15px 15px 180px 15px; border-radius: 8px; border-left: 4px solid #4caf50; font-size: 14px;">
|
| 638 |
+
<p style="margin: 0; font-weight: bold; font-size: 15px;">To book a meeting, tell me:</p>
|
| 639 |
+
<p id="menuItem1" style="margin: 5px 0 2px 0; font-size: 13px; color: #f44336;">1) Your name</p>
|
| 640 |
+
<p id="menuItem2" style="margin: 2px 0; font-size: 13px; color: #f44336;">2) The date</p>
|
| 641 |
+
<p id="menuItem3" style="margin: 2px 0; font-size: 13px; color: #f44336;">3) The time</p>
|
| 642 |
+
<p id="menuItem4" style="margin: 2px 0; font-size: 13px; color: #f44336;">4) The length (duration)</p>
|
| 643 |
+
<p id="menuItem5" style="margin: 2px 0; font-size: 13px; color: #f44336;">5) The agenda (meeting topic)</p>
|
| 644 |
+
<p id="menuItem6" style="margin: 2px 0; font-size: 13px; color: #f44336;">6) GoogleMeet or phone call</p>
|
| 645 |
+
<p id="menuItem7" style="margin: 2px 0 0 0; font-size: 13px; color: #f44336;">7) Your phone number</p>
|
| 646 |
</div>
|
| 647 |
|
| 648 |
<div class="quick-actions">
|
|
|
|
| 2439 |
}
|
| 2440 |
}
|
| 2441 |
|
| 2442 |
+
// Menu item 2: Date
|
| 2443 |
const menuItem2 = document.getElementById('menuItem2');
|
| 2444 |
if (menuItem2) {
|
| 2445 |
+
if (userInfo.date_string) {
|
|
|
|
|
|
|
| 2446 |
menuItem2.style.color = '#4caf50'; // Green
|
| 2447 |
menuItem2.style.fontWeight = 'bold';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2448 |
} else {
|
| 2449 |
menuItem2.style.color = '#f44336'; // Red
|
| 2450 |
menuItem2.style.fontWeight = 'normal';
|
| 2451 |
}
|
| 2452 |
}
|
| 2453 |
|
| 2454 |
+
// Menu item 3: Time
|
| 2455 |
const menuItem3 = document.getElementById('menuItem3');
|
| 2456 |
if (menuItem3) {
|
| 2457 |
+
if (userInfo.time_string) {
|
| 2458 |
menuItem3.style.color = '#4caf50'; // Green
|
| 2459 |
menuItem3.style.fontWeight = 'bold';
|
| 2460 |
} else {
|
|
|
|
| 2463 |
}
|
| 2464 |
}
|
| 2465 |
|
| 2466 |
+
// Menu item 4: Length (duration)
|
| 2467 |
const menuItem4 = document.getElementById('menuItem4');
|
| 2468 |
if (menuItem4) {
|
| 2469 |
+
if (userInfo.duration_minutes) {
|
| 2470 |
menuItem4.style.color = '#4caf50'; // Green
|
| 2471 |
menuItem4.style.fontWeight = 'bold';
|
| 2472 |
} else {
|
|
|
|
| 2474 |
menuItem4.style.fontWeight = 'normal';
|
| 2475 |
}
|
| 2476 |
}
|
| 2477 |
+
|
| 2478 |
+
// Menu item 5: Agenda (topic)
|
| 2479 |
+
const menuItem5 = document.getElementById('menuItem5');
|
| 2480 |
+
if (menuItem5) {
|
| 2481 |
+
if (userInfo.topic) {
|
| 2482 |
+
menuItem5.style.color = '#4caf50'; // Green
|
| 2483 |
+
menuItem5.style.fontWeight = 'bold';
|
| 2484 |
+
} else {
|
| 2485 |
+
menuItem5.style.color = '#f44336'; // Red
|
| 2486 |
+
menuItem5.style.fontWeight = 'normal';
|
| 2487 |
+
}
|
| 2488 |
+
}
|
| 2489 |
+
|
| 2490 |
+
// Menu item 6: GoogleMeet or phone call
|
| 2491 |
+
const menuItem6 = document.getElementById('menuItem6');
|
| 2492 |
+
if (menuItem6) {
|
| 2493 |
+
if (userInfo.preferences?.google_meet || userInfo.preferences?.phone_call) {
|
| 2494 |
+
menuItem6.style.color = '#4caf50'; // Green
|
| 2495 |
+
menuItem6.style.fontWeight = 'bold';
|
| 2496 |
+
} else {
|
| 2497 |
+
menuItem6.style.color = '#f44336'; // Red
|
| 2498 |
+
menuItem6.style.fontWeight = 'normal';
|
| 2499 |
+
}
|
| 2500 |
+
}
|
| 2501 |
+
|
| 2502 |
+
// Menu item 7: Phone number
|
| 2503 |
+
const menuItem7 = document.getElementById('menuItem7');
|
| 2504 |
+
if (menuItem7) {
|
| 2505 |
+
if (userInfo.phone) {
|
| 2506 |
+
menuItem7.style.color = '#4caf50'; // Green
|
| 2507 |
+
menuItem7.style.fontWeight = 'bold';
|
| 2508 |
+
} else {
|
| 2509 |
+
menuItem7.style.color = '#f44336'; // Red
|
| 2510 |
+
menuItem7.style.fontWeight = 'normal';
|
| 2511 |
+
}
|
| 2512 |
+
}
|
| 2513 |
} catch (error) {
|
| 2514 |
console.error('Error updating menu colors:', error);
|
| 2515 |
}
|
pyproject.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "voicecal-ai"
|
| 3 |
-
version = "1.4.
|
| 4 |
description = "A friendly interactive AI speechbot for booking Google Calendar appointments"
|
| 5 |
authors = ["Peter <pgits.job@gmail.com>"]
|
| 6 |
|
|
|
|
| 1 |
[tool.poetry]
|
| 2 |
name = "voicecal-ai"
|
| 3 |
+
version = "1.4.2"
|
| 4 |
description = "A friendly interactive AI speechbot for booking Google Calendar appointments"
|
| 5 |
authors = ["Peter <pgits.job@gmail.com>"]
|
| 6 |
|
unit_tests/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This directory contains unit tests for VoiceCal.ai components.
|
|
| 8 |
|
| 9 |
1. **SSH into your HuggingFace Space:**
|
| 10 |
```bash
|
| 11 |
-
ssh -i ~/.ssh/id_ed25519 pgits-voicecal-ai@ssh.hf.space
|
| 12 |
```
|
| 13 |
|
| 14 |
2. **Navigate to tests directory:**
|
|
|
|
| 8 |
|
| 9 |
1. **SSH into your HuggingFace Space:**
|
| 10 |
```bash
|
| 11 |
+
ssh -i ~/.ssh/id_ed25519 pgits-voicecal-ai-v3@ssh.hf.space
|
| 12 |
```
|
| 13 |
|
| 14 |
2. **Navigate to tests directory:**
|
version.txt
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
1.4.
|
|
|
|
| 1 |
+
1.4.2
|