sessions.ts
typescript
sha256:25d96102cb2d69a038356dff26f4633156da2f1faf98fe0d0e4438ff3f367f12
refactor: rename 0054/0055 migrations to standard convention
Sonnet 4.6
minor
⚠ breaking
22 days 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
2 commits
sha256:25d96102cb2d69a038356dff26f4633156da2f1faf98fe0d0e4438ff3f367f12
refactor: rename 0054/0055 migrations to standard convention
Sonnet 4.6
minor
⚠
22 days ago
sha256:4aed3d8601c8dd3ed37074de35f11f4a9699a0a4b99d43727048fd3f8e6fd13d
chore: doc sweep, ignore wrangler build state, misc fixes
Sonnet 4.6
minor
⚠
24 days ago