From 81fa5f3a08f519f7c7aaa48f8b0242a851fafc98 Mon Sep 17 00:00:00 2001 From: Chaim Date: Fri, 3 Apr 2026 15:53:01 +0000 Subject: [PATCH] feat: auto-refresh panels after Shira executes an action When Shira creates a task, meeting, or other entity, the current detail view panels now refresh automatically via model.trigger('update-all'). For tasks and meetings, also refreshes the activities/tasks side panels. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 2 +- .../src/views/floating-chat.js | 36 +++++++++++++++++++ manifest.json | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ce48def..fea8b1f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SmartAssistant - עוזר חכם -**גרסה:** 1.1.6 | **מחבר:** klear | **EspoCRM:** >= 8.0.0 +**גרסה:** 1.1.7 | **מחבר:** klear | **EspoCRM:** >= 8.0.0 ## תיאור עוזר AI מאוחד למשרד עורכי דין. מספק ממשק צ'אט צף עם שני מצבי עבודה: **מצב משרד** (סקירה כללית, התראות, סטטיסטיקות) ו**מצב תיק** (סיוע מעמיק בתיק ספציפי). כולל מערכת זיכרון תיק מובנית, ביצוע פעולות באישור המשתמש, ואינטגרציה עם Stream של EspoCRM. diff --git a/files/client/custom/modules/smart-assistant/src/views/floating-chat.js b/files/client/custom/modules/smart-assistant/src/views/floating-chat.js index 7e3a185..6dacbb3 100644 --- a/files/client/custom/modules/smart-assistant/src/views/floating-chat.js +++ b/files/client/custom/modules/smart-assistant/src/views/floating-chat.js @@ -480,6 +480,10 @@ define('modules/smart-assistant/views/floating-chat', ['view'], function (View) var cls = approved ? (result.success ? 'sa-msg-assistant' : 'sa-msg-error') : 'sa-msg-loading'; $messages.append('
' + self.escapeHtml(msg) + '
'); self.scrollToBottom(); + + if (approved && result.success) { + self.refreshCurrentView(result.entityType); + } }).catch(function () { $messages.append('
שגיאה בביצוע הפעולה
'); self.scrollToBottom(); @@ -620,5 +624,37 @@ define('modules/smart-assistant/views/floating-chat', ['view'], function (View) div.textContent = text; return div.innerHTML; }, + + refreshCurrentView: function (entityType) { + var mainView = this.getParentView(); + + while (mainView && mainView.getParentView()) { + mainView = mainView.getParentView(); + } + + if (!mainView) return; + + var currentView = mainView.getView('main'); + + if (!currentView) return; + + var recordView = currentView.getView('record'); + + if (recordView && recordView.model) { + recordView.model.trigger('update-all'); + } + + if (entityType === 'Task' || entityType === 'Meeting') { + var sideView = currentView.getView('side'); + + if (sideView) { + var activities = sideView.getView('activities'); + var tasks = sideView.getView('tasks'); + + if (activities && activities.actionRefresh) activities.actionRefresh(); + if (tasks && tasks.actionRefresh) tasks.actionRefresh(); + } + } + }, }); }); diff --git a/manifest.json b/manifest.json index a07eb8e..df827ff 100644 --- a/manifest.json +++ b/manifest.json @@ -3,7 +3,7 @@ "module": "SmartAssistant", "description": "Unified AI Assistant for Legal CRM — floating chat with case memory, office alerts, and n8n integration", "author": "klear", - "version": "1.1.6", + "version": "1.1.7", "acceptableVersions": [ ">=8.0.0" ],