sessions.ts
typescript
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2
feat: add repair-commit wire endpoint (API parity with repa…
Opus 4.8
minor
⚠ breaking
1 day ago
| 1 | /** |
| 2 | * sessions.ts — MuseHub sessions page module. |
| 3 | */ |
| 4 | |
| 5 | export function initSessions(): void { |
| 6 | const filterTabs = document.querySelectorAll<HTMLAnchorElement>('.sess-filter-tab'); |
| 7 | const searchInput = document.getElementById('sess-search') as HTMLInputElement | null; |
| 8 | const list = document.getElementById('session-rows'); |
| 9 | let activeFilter = 'all'; |
| 10 | |
| 11 | function applyFilters(): void { |
| 12 | const q = searchInput ? searchInput.value.toLowerCase() : ''; |
| 13 | const cards = list ? list.querySelectorAll<HTMLElement>('.sess-card') : []; |
| 14 | cards.forEach(card => { |
| 15 | const status = (card.dataset.status || '').toLowerCase(); |
| 16 | const text = (card.dataset.intent || '').toLowerCase() + ' ' + (card.dataset.location || '').toLowerCase(); |
| 17 | const statusMatch = activeFilter === 'all' || status === activeFilter; |
| 18 | const searchMatch = !q || text.includes(q); |
| 19 | card.style.display = statusMatch && searchMatch ? '' : 'none'; |
| 20 | }); |
| 21 | } |
| 22 | |
| 23 | filterTabs.forEach(tab => { |
| 24 | tab.addEventListener('click', e => { |
| 25 | e.preventDefault(); |
| 26 | filterTabs.forEach(t => t.classList.remove('active')); |
| 27 | tab.classList.add('active'); |
| 28 | activeFilter = tab.dataset.filter || 'all'; |
| 29 | applyFilters(); |
| 30 | }); |
| 31 | }); |
| 32 | |
| 33 | if (searchInput) { |
| 34 | searchInput.addEventListener('input', applyFilters); |
| 35 | } |
| 36 | } |
File History
1 commit
sha256:3ff9c9863a9891bdcde71b4a43228f66d0493e38b7cc1d09fe9eb7de774046b2
feat: add repair-commit wire endpoint (API parity with repa…
Opus 4.8
minor
⚠
1 day ago