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