llm-semantic-visualizer / src /ui /panels /ThreadsPanel.js
hbauzan's picture
Release v4.17.7 — sync from GitHub main
819a47f
Raw
History Blame Contribute Delete
1.24 kB
// Active Threads + Hunter Hits panel (extracted from Sidebar.js in H4 4.7).
// Two list containers populated externally (ui/Components.js via #thread-list-ul
// and #hunter-results). No own wiring. Returns a DocumentFragment so both cards
// land as siblings in the sidebar, preserving the original DOM exactly.
/** @typedef {import('../types.js').PanelContext} PanelContext */
/**
* Build the Active Threads and Hunter Hits list cards.
* @param {PanelContext} _ctx
* @returns {DocumentFragment}
*/
export function buildThreadsPanel(_ctx) {
const frag = document.createDocumentFragment();
const threadMgr = document.createElement('div');
threadMgr.className = 'section-card';
threadMgr.innerHTML = `
<div class="section-title">Active Threads</div>
<ul id="thread-list-ul" class="list-container"></ul>
`;
frag.appendChild(threadMgr);
const hunterResults = document.createElement('div');
hunterResults.className = 'section-card';
hunterResults.innerHTML = `
<div class="section-title">Hunter Hits</div>
<ul id="hunter-results" class="list-container" style="max-height: 180px; overflow-y: auto;"></ul>
`;
frag.appendChild(hunterResults);
return frag;
}