diff --git a/assets/sai.js b/assets/sai.js
index bf3c54b..6b78440 100644
--- a/assets/sai.js
+++ b/assets/sai.js
@@ -966,8 +966,6 @@ var sb_selected_project = null, sb_selected_ref = null;
function sai_sb_request_overview(offset)
{
var o = (typeof offset === 'number') ? offset : 0;
- console.log("[sb] -> overview req project='" + sb_selected_project +
- "' ref='" + sb_selected_ref + "'");
sai.send("{\"schema\":\"com.warmcat.sai.taskinfo\"," +
"\"js_api_version\": " + SAI_JS_API_VERSION + "," +
"\"offset\": " + o + "," +
@@ -977,13 +975,11 @@ function sai_sb_request_overview(offset)
function sai_sb_request_projects()
{
- console.log("[sb] -> requesting projlist");
sai.send("{\"schema\":\"com.warmcat.sai.projlist\"}");
}
function sai_sb_request_branches(project)
{
- console.log("[sb] -> requesting branchlist for", project);
sai.send("{\"schema\":\"com.warmcat.sai.branchlist\"," +
"\"project\":" + JSON.stringify(project || "") + "}");
}
@@ -2860,10 +2856,9 @@ function ws_open_sai()
// return;
try {
jso = JSON.parse(msg.data);
- } catch {
- console.log("Bad JSON received:");
- console.log(msg.data);
- return
+ } catch (err) {
+ console.log("Bad JSON received:", err.message);
+ return;
}
// console.log(jso.schema);
@@ -3114,7 +3109,6 @@ function ws_open_sai()
* for deep links (?event=/?task=) so the
* deep-linked event isn't displaced.
*/
- console.log("[sb] <- projlist reply:", jso);
sb_projects = (jso.projects && Array.isArray(jso.projects)) ? jso.projects : [];
if (!sb_selected_project && !selected_event_uuid &&
!selected_task_uuid && sb_projects.length)
@@ -3127,9 +3121,8 @@ function ws_open_sai()
/*
* Unique refs for the selected project,
* newest-first. Auto-select the most recent
- * branch so col 4 populates immediately.
- */
- console.log("[sb] <- branchlist reply:", jso);
+ * branch so col 4 populates immediately.
+ */
sb_branches = (jso.branches && Array.isArray(jso.branches)) ? jso.branches : [];
if (!sb_selected_ref && sb_branches.length)
selectSbBranch(sb_branches[0]);
@@ -3208,7 +3201,6 @@ function ws_open_sai()
* branchlist reply arrives later it overrides this.
*/
if ((!sb_projects || !sb_projects.length) && loaded_events.length) {
- console.log("[sb] FALLBACK: deriving projects from loaded_events (no projlist reply)");
var _pset = {};
loaded_events.forEach(function(o) {
if (o && o.e && o.e.repo_name)
@@ -3220,7 +3212,6 @@ function ws_open_sai()
render_sb_projects();
}
if (sb_selected_project && (!sb_branches || !sb_branches.length) && loaded_events.length) {
- console.log("[sb] FALLBACK: deriving branches from loaded_events (no branchlist reply)");
var _bset = {};
loaded_events.forEach(function(o) {
if (o && o.e && o.e.repo_name === sb_selected_project && o.e.ref)
diff --git a/src/web/w-ws-browser.c b/src/web/w-ws-browser.c
index 52fe289..f7553b2 100644
--- a/src/web/w-ws-browser.c
+++ b/src/web/w-ws-browser.c
@@ -1377,10 +1377,6 @@ saiw_browser_queue_overview(struct vhd *vhd, struct pss *pss)
}
}
- lwsl_notice("%s: DBG overview filt='%s' limit=%d offset=%u total=%u\n",
- __func__, filt[0] ? filt : "(none)", n,
- pss->overview_offset, total_events);
-
pss->wants_event_updates = 1;
if (lws_struct_sq3_deserialize(vhd->pdb, filt[0] ? filt : NULL,
"created ", lsm_schema_sq3_map_event,
@@ -1390,9 +1386,6 @@ saiw_browser_queue_overview(struct vhd *vhd, struct pss *pss)
return 0;
}
- lwsl_notice("%s: DBG overview returned %u events\n",
- __func__, (unsigned int)owner.count);
-
/*
* we get zero or more sai_event_t laid out in pss->query_ac,
* and listed in pss->query_owner
@@ -1523,6 +1516,14 @@ saiw_browser_queue_overview(struct vhd *vhd, struct pss *pss)
* user selects a specific event.
*/
if (pss->selected_project[0] || pss->selected_ref[0]) {
+ /*
+ * Sidebar-scoped path: emit a tiny per-event payload
+ * (empty task array + server-computed summary) instead
+ * of the full task list, so many events fit the buflist.
+ * We close the {"e":...} wrapper object here with '}'
+ * and skip the shared "]" below (which closes the task
+ * array opened by the unscoped path).
+ */
char sum[96], esc_sum[128];
e = lws_container_of(walk, sai_event_t, list);
@@ -1534,10 +1535,28 @@ saiw_browser_queue_overview(struct vhd *vhd, struct pss *pss)
sizeof(sum));
sai_event_db_close(&vhd->sqlite3_cache, &pdb);
}
+
+ if (lws_ptr_diff_size_t(end, p) < 160) {
+ saiw_ws_browser_queue_REQUIRES_LWS_PRE(pss,
+ start, lws_ptr_diff_size_t(p, start),
+ lws_write_ws_flags(LWS_WRITE_TEXT, 0, 0));
+ p = start;
+ }
p += lws_snprintf((char *)p, lws_ptr_diff_size_t(end, p),
- ", \"t\":[], \"summary\":\"%s\"",
+ ", \"t\":[], \"summary\":\"%s\"}",
lws_json_purify(esc_sum, sum, sizeof(esc_sum) - 1,
NULL));
+
+ /* advance to the next event like the unscoped path */
+ if (pss->specificity && pss->specificity != SAIM_SPECIFIC_TASK)
+ walk = walk->next;
+ else
+ walk = walk->prev;
+
+ if (walk && (!pss->specificity ||
+ pss->specificity == SAIM_SPECIFIC_TASK))
+ continue;
+ goto so_finish;
} else {
p += lws_snprintf((char *)p, lws_ptr_diff_size_t(end, p), ", \"t\":[");