@kolbo/mcp 1.75.1 → 1.75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -54,6 +54,16 @@ function boot(sc) {
|
|
|
54
54
|
if (audioItems.length) {
|
|
55
55
|
h += audioItems.slice(0, 12).map(audioRowHTML).join('');
|
|
56
56
|
}
|
|
57
|
+
// Only a fixed page ever renders here (24 visual + 12 audio) — with a library
|
|
58
|
+
// in the thousands there was no way to reach the rest short of asking in
|
|
59
|
+
// chat. A visible "Load more" turns that into one click; it sends a message
|
|
60
|
+
// rather than calling the tool directly, since the widget has no host API
|
|
61
|
+
// to invoke a tool itself — same mechanism every other "Use" action here uses.
|
|
62
|
+
var shown = visualItems.length + audioItems.length;
|
|
63
|
+
if (sc.total != null && sc.total > shown) {
|
|
64
|
+
h += '<button class="k-btn" id="load-more" style="width:100%;margin-top:10px">Load more (' +
|
|
65
|
+
shown + ' of ' + sc.total + ' shown)</button>';
|
|
66
|
+
}
|
|
57
67
|
el('stage').innerHTML = h;
|
|
58
68
|
el('stage').classList.remove('k-empty');
|
|
59
69
|
wire();
|
|
@@ -78,6 +88,11 @@ function cellHTML(item, i) {
|
|
|
78
88
|
'</div>' +
|
|
79
89
|
'<div class="k-cell-label">' + esc(item.title || '') + '</div>' +
|
|
80
90
|
(item.subtitle ? '<div class="k-cell-sub">' + esc(item.subtitle) + '</div>' : '') +
|
|
91
|
+
// Clicking the cell itself already sends the use_hint (see wire()), but that
|
|
92
|
+
// wasn't discoverable — nothing on the tile signalled it was clickable. A
|
|
93
|
+
// visible button makes the affordance obvious, same reasoning as the audio
|
|
94
|
+
// rows' explicit "Use" button.
|
|
95
|
+
'<button class="k-btn" data-use="' + idx + '" style="margin:0 8px 8px;width:calc(100% - 16px)">Use</button>' +
|
|
81
96
|
'</div>';
|
|
82
97
|
}
|
|
83
98
|
|
|
@@ -121,6 +136,13 @@ function wire() {
|
|
|
121
136
|
holder.querySelector('video').onclick = function (ev) { ev.stopPropagation(); };
|
|
122
137
|
};
|
|
123
138
|
});
|
|
139
|
+
var loadMore = el('load-more');
|
|
140
|
+
if (loadMore) {
|
|
141
|
+
loadMore.onclick = function () {
|
|
142
|
+
window.kolbo.sendMessage('Show me the next page of this same media search (already saw ' +
|
|
143
|
+
(state.items.length) + ' of ' + state.total + ' results).');
|
|
144
|
+
};
|
|
145
|
+
}
|
|
124
146
|
}
|
|
125
147
|
|
|
126
148
|
function useItem(i) {
|