|
1071 | 1071 | --cc-warn: var(--vscode-editorWarning-foreground, var(--vscode-foreground)); --cc-danger: var(--vscode-errorForeground); } |
1072 | 1072 | .sesspanel .sessbar { display: flex; align-items: center; gap: 9px; padding: 12px 14px 10px; border-bottom: 1px solid var(--cc-line); } |
1073 | 1073 | .sesspanel .sesstitle { font-weight: 600; font-size: 14px; } |
1074 | | - .sesspanel .sesssearch { margin: 10px 12px 6px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; background: var(--cc-bg); border: 1px solid var(--cc-line); border-radius: 6px; color: var(--cc-text3); } |
1075 | | - .sesspanel .sesssearch input { flex: 1; background: transparent; border: none; outline: none; color: var(--cc-text); font: inherit; font-size: 12.5px; font-family: var(--vscode-editor-font-family, ui-monospace, monospace); } |
1076 | 1074 | .sesspanel .sesslist { flex: 1 1 auto; overflow-y: auto; padding: 2px 12px 14px; } |
1077 | 1075 | .sesspanel .sessbucket { font-family: var(--vscode-editor-font-family, ui-monospace, monospace); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--cc-text3); margin: 12px 4px 7px; } |
1078 | 1076 | .sesspanel .sessempty { padding: 44px 18px; text-align: center; color: var(--cc-text3); font-size: 13px; line-height: 1.6; } |
|
1224 | 1222 | <div class="sesspanel" role="dialog" aria-modal="true" aria-label="Sessions"> |
1225 | 1223 | <button class="ovclose" id="sessClose" title="Close" aria-label="Close">✕</button> |
1226 | 1224 | <div class="sessbar"><span class="sesstitle">Sessions</span></div> |
1227 | | - <div class="sesssearch"><span aria-hidden="true">⌕</span><input id="sessSearch" type="text" placeholder="Search sessions, files…" aria-label="Search sessions" /></div> |
1228 | 1225 | <div class="sesslist" id="sessList"></div> |
1229 | 1226 | </div> |
1230 | 1227 | </div> |
|
3298 | 3295 | if (days <= 7) { return 'This week'; } |
3299 | 3296 | return 'Earlier'; |
3300 | 3297 | } |
3301 | | - function sessMatch(entry, q){ |
3302 | | - if (!q) { return true; } |
3303 | | - const s = String(q).toLowerCase(); |
3304 | | - if (String(entry.title || '').toLowerCase().indexOf(s) >= 0) { return true; } |
3305 | | - if (String(entry.preview || '').toLowerCase().indexOf(s) >= 0) { return true; } |
3306 | | - return (entry.filesEdited || []).some((f) => String(f).toLowerCase().indexOf(s) >= 0); |
3307 | | - } |
3308 | 3298 | function sessModelShort(m){ const s = String(m || ''); const i = s.lastIndexOf('/'); return i >= 0 ? s.slice(i + 1) : s; } |
3309 | 3299 | function sessSparkSvg(spark){ |
3310 | 3300 | const a = (Array.isArray(spark) ? spark : []).map((x) => Math.max(0, Number(x) || 0)); |
|
3344 | 3334 | { id: 's2', title: 'Debug the flaky payment webhook test', createdAt: '2026-07-28T05:00:00Z', updatedAt: '2026-07-28T05:30:00Z', turns: 12, model: 'moonshotai/kimi-k2.7-code', state: 'interrupted', lifecycle: 'active', pinned: false, filesEdited: ['webhook_spec.rb'], spark: [2, 6, 3, 1] }, |
3345 | 3335 | { id: 's3', title: 'Tidy the CHANGELOG for v1.0.4', createdAt: '2026-07-27T12:00:00Z', updatedAt: '2026-07-27T12:20:00Z', turns: 6, model: 'anthropic/claude-opus-5', state: 'done', lifecycle: 'active', pinned: false, filesEdited: ['RELEASE-NOTES.md'], spark: [1, 2, 1] } |
3346 | 3336 | ]; |
3347 | | - let sessData = null, sessQuery = ''; |
| 3337 | + let sessData = null; |
3348 | 3338 | function renderSessions(){ |
3349 | 3339 | const list = document.getElementById('sessList'); if (!list) { return; } |
3350 | | - const entries = (sessData || []).filter((e) => (e.lifecycle || 'active') === 'active' && sessMatch(e, sessQuery)); |
| 3340 | + const entries = (sessData || []).filter((e) => (e.lifecycle || 'active') === 'active'); |
3351 | 3341 | if (!entries.length){ |
3352 | | - list.innerHTML = '<div class="sessempty">' + (sessQuery ? 'Nothing matches “' + esc(sessQuery) + '”.' : 'Every chat you have is saved here — automatically, on your machine.') + '</div>'; |
| 3342 | + list.innerHTML = '<div class="sessempty">Every chat you have is saved here — automatically, on your machine.</div>'; |
3353 | 3343 | return; |
3354 | 3344 | } |
3355 | 3345 | const now = Date.now(); let html = ''; |
|
3362 | 3352 | function openSessions(){ |
3363 | 3353 | const ov = document.getElementById('sessOverlay'); if (!ov) { return; } |
3364 | 3354 | if (sessData == null) { vscode.postMessage({ type: 'listSessions' }); sessData = MOCK_SESSIONS.slice(); } // TODO(adapter): drop the mock once extension.js posts 'sessions' |
3365 | | - sessQuery = ''; const inp = document.getElementById('sessSearch'); if (inp) { inp.value = ''; } |
3366 | 3355 | renderSessions(); ov.style.display = 'flex'; |
3367 | | - if (inp && inp.focus) { try { inp.focus(); } catch (e) {} } |
3368 | 3356 | } |
3369 | 3357 | function closeSessions(){ const ov = document.getElementById('sessOverlay'); if (ov) { ov.style.display = 'none'; } } |
3370 | 3358 | (function wireSessions(){ |
3371 | 3359 | const close = document.getElementById('sessClose'); if (close) { close.onclick = closeSessions; } |
3372 | 3360 | const ov = document.getElementById('sessOverlay'); if (ov) { ov.addEventListener('click', (e) => { if (e.target === ov) { closeSessions(); } }); } |
3373 | | - const inp = document.getElementById('sessSearch'); if (inp) { inp.addEventListener('input', () => { sessQuery = inp.value; renderSessions(); }); } |
3374 | 3361 | const list = document.getElementById('sessList'); |
3375 | 3362 | if (list) { list.addEventListener('click', (e) => { |
3376 | 3363 | const card = e.target.closest && e.target.closest('.sesscard'); if (!card) { return; } |
|
0 commit comments