-
משימות אחרונות
-
diff --git a/files/client/custom/modules/knowledge-base/src/views/kb/index.js b/files/client/custom/modules/knowledge-base/src/views/kb/index.js
index 3a19291..937aff0 100644
--- a/files/client/custom/modules/knowledge-base/src/views/kb/index.js
+++ b/files/client/custom/modules/knowledge-base/src/views/kb/index.js
@@ -236,6 +236,10 @@ define('modules/knowledge-base/views/kb/index', ['view'], function (Dep) {
const topicId = (topicAttr === '' || topicAttr == null) ? null : parseInt(topicAttr, 10);
if (batchId) this._openBatch(String(batchId), topicId);
},
+ 'click [data-action="toggleSection"]': function (e) {
+ e.preventDefault();
+ this._toggleSection($(e.currentTarget).closest('.kb-collapsible'));
+ },
},
// Cancel any in-flight ask/search, drop the cached last-result for
@@ -325,14 +329,11 @@ define('modules/knowledge-base/views/kb/index', ['view'], function (Dep) {
// here. The polling continues silently in the background.
}
- // Always refresh the recent-jobs list on mount.
- this._loadJobsList();
- // Phase 3: load the sources table when the manage tab is open.
- this._loadAdminSources();
+ // Sources / Labels / Recent-Jobs panels are collapsed by default
+ // (they're long lists the user usually doesn't need on mount).
+ // Their data loads lazily on first expand via _toggleSection.
// Phase 4: load the topics admin table (firm-wide, not topic-scoped).
this._loadAdminTopics();
- // Phase 6: load the labels admin table.
- this._loadAdminLabels();
// Phase 6: load batches that still need review (RAM-only
// _activeBatch is wiped by hard refresh; this lets the user
// resume any pending batch from the panel).
@@ -344,6 +345,29 @@ define('modules/knowledge-base/views/kb/index', ['view'], function (Dep) {
}
},
+ _toggleSection: function ($panel) {
+ if (!$panel || !$panel.length) return;
+ const isCollapsed = $panel.hasClass('kb-collapsed');
+ const $body = $panel.find('.kb-collapsible-body').first();
+ const $chev = $panel.find('.kb-collapse-chevron').first();
+ if (isCollapsed) {
+ $panel.removeClass('kb-collapsed');
+ $chev.removeClass('glyphicon-chevron-left').addClass('glyphicon-chevron-down');
+ $body.slideDown(150);
+ // Lazy-load on first expand. The individual loaders are
+ // idempotent — they early-out if the list is in the DOM but
+ // already populated. Pass force=true so a stale "טוען…"
+ // placeholder gets replaced even on second expand.
+ if ($panel.hasClass('kb-sources-panel')) this._loadAdminSources(true);
+ else if ($panel.hasClass('kb-labels-panel')) this._loadAdminLabels(true);
+ else if ($panel.hasClass('kb-jobs-panel')) this._loadJobsList();
+ } else {
+ $panel.addClass('kb-collapsed');
+ $chev.removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-left');
+ $body.slideUp(150);
+ }
+ },
+
_loadJobsList: function () {
const self = this;
const $list = this.$el.find('.kb-jobs-list');
@@ -1214,7 +1238,15 @@ define('modules/knowledge-base/views/kb/index', ['view'], function (Dep) {
let s = it.status;
if (s === 'processing' && it.processing_stage === 'classifying') s = 'classifying';
else if (s === 'processing' && it.processing_stage === 'embedding') s = 'committing';
- card.status = s;
+ // Don't downgrade a locally-set 'committing' back to
+ // 'awaiting_review' just because the POST commit
+ // hasn't reached the DB yet — that re-enables the
+ // button and lets the user re-submit, which then
+ // explodes with HTTP 400 once the first commit
+ // races to 'done'.
+ if (!(card.status === 'committing' && s === 'awaiting_review')) {
+ card.status = s;
+ }
card.error = it.error_message || null;
// Parse ai_suggestions if string
let ai = it.ai_suggestions;
diff --git a/manifest.json b/manifest.json
index d1722e9..3c344d6 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,14 +1,14 @@
{
"name": "KnowledgeBase",
"module": "KnowledgeBase",
- "version": "0.8.0",
+ "version": "0.8.1",
"acceptableVersions": [
">=8.0.0"
],
"php": [
">=8.1"
],
- "releaseDate": "2026-04-25",
+ "releaseDate": "2026-04-26",
"author": "klear",
"description": "Knowledge Base — Israeli National Insurance law, regulations, and circulars. Hybrid search + ask-shira, powered by shira-hermes KB.",
"displayLabel": "מאגר ידע"