Skip to content

Commit 76455bc

Browse files
committed
Fix template visibility and navigation issues (#13)
- Expand coach dropdown to show 9 templates instead of 3 by including multiple categories (sales_coach, customer_success, executive, support, partnership, technical) - Add copy functionality for system templates in Templates/Index.vue with proper duplication - Remove redundant RealtimeAgent/Settings.vue page and simplify navigation structure - Update template form routes from /realtime-agent/templates/* to /templates/* - Fix dark mode visibility issues by adding proper dark: classes to template headings - Improve template management UX with Copy/View buttons for system templates and Edit/Delete for user templates Resolves template dropdown limitations, navigation confusion, and missing copy functionality described in issue #13.
1 parent b9f7226 commit 76455bc

File tree

4 files changed

+70
-359
lines changed

4 files changed

+70
-359
lines changed

resources/js/pages/RealtimeAgent/Main.vue

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@
6969
<div
7070
class="scrollbar-thin scrollbar-thumb-gray-300 scrollbar-track-transparent hover:scrollbar-thumb-gray-400 flex-1 overflow-y-auto"
7171
>
72-
<div v-if="filteredSalesCoachTemplates.length === 0" class="p-3 text-center text-xs text-gray-600 dark:text-gray-400">
72+
<div v-if="filteredCoachingTemplates.length === 0" class="p-3 text-center text-xs text-gray-600 dark:text-gray-400">
7373
No templates found
7474
</div>
7575
<div
76-
v-for="template in filteredSalesCoachTemplates"
76+
v-for="template in filteredCoachingTemplates"
7777
:key="template.id"
7878
@click="
7979
selectTemplateFromDropdown(template);
@@ -251,11 +251,11 @@
251251
@click.stop
252252
/>
253253
<div class="max-h-36 overflow-y-auto">
254-
<div v-if="filteredSalesCoachTemplates.length === 0" class="p-2 text-center text-xs text-gray-600 dark:text-gray-400">
254+
<div v-if="filteredCoachingTemplates.length === 0" class="p-2 text-center text-xs text-gray-600 dark:text-gray-400">
255255
No templates found
256256
</div>
257257
<button
258-
v-for="template in filteredSalesCoachTemplates"
258+
v-for="template in filteredCoachingTemplates"
259259
:key="template.id"
260260
@click.stop="
261261
selectTemplateFromDropdown(template);
@@ -902,15 +902,19 @@ const { isOverlayMode, isSupported: isOverlaySupported, toggleOverlayMode } = us
902902
const hasApiKey = ref(false); // Will be checked on mount
903903
// const isDev = computed(() => import.meta.env.DEV)
904904
905-
// Sales coach templates filtered
906-
const salesCoachTemplates = computed(() => templates.value.filter((t) => t.category === 'sales_coach'));
905+
// Coaching templates filtered - expanded to include more relevant categories
906+
const coachingTemplates = computed(() => {
907+
// Include multiple relevant categories for broader template selection
908+
const relevantCategories = ['sales_coach', 'customer_success', 'executive', 'support', 'partnership', 'technical'];
909+
return templates.value.filter((t) => relevantCategories.includes(t.category));
910+
});
907911
908912
// Filtered templates based on search
909-
const filteredSalesCoachTemplates = computed(() => {
910-
if (!templateSearchQuery.value) return salesCoachTemplates.value;
913+
const filteredCoachingTemplates = computed(() => {
914+
if (!templateSearchQuery.value) return coachingTemplates.value;
911915
912916
const query = templateSearchQuery.value.toLowerCase();
913-
return salesCoachTemplates.value.filter((t) => t.name.toLowerCase().includes(query) || t.description?.toLowerCase().includes(query));
917+
return coachingTemplates.value.filter((t) => t.name.toLowerCase().includes(query) || t.description?.toLowerCase().includes(query));
914918
});
915919
916920
// New computed properties for intelligence dashboard
@@ -2508,8 +2512,10 @@ const fetchTemplates = async () => {
25082512
25092513
console.log(`✅ Loaded ${templates.value.length} templates`);
25102514
console.log(
2511-
'Sales coach templates:',
2512-
templates.value.filter((t) => t.category === 'sales_coach').map((t) => t.name),
2515+
'Available coaching templates:',
2516+
templates.value
2517+
.filter((t) => ['sales_coach', 'customer_success', 'executive', 'support', 'partnership', 'technical'].includes(t.category))
2518+
.map((t) => t.name),
25132519
);
25142520
25152521
// Load persisted template or select default
@@ -2524,7 +2530,9 @@ const fetchTemplates = async () => {
25242530
25252531
// Select default template if none selected
25262532
if (!selectedTemplate.value && templates.value.length > 0) {
2527-
const defaultTemplate = templates.value.find((t) => t.name === 'Friendly Helper' && t.category === 'sales_coach');
2533+
// Try to find the Sales Discovery Call template as default, otherwise use first available coaching template
2534+
const defaultTemplate =
2535+
templates.value.find((t) => t.name === 'Sales Discovery Call') || coachingTemplates.value[0] || templates.value[0];
25282536
if (defaultTemplate) {
25292537
selectedTemplate.value = defaultTemplate;
25302538
console.log('📌 Selected default template:', defaultTemplate.name);

0 commit comments

Comments
 (0)