feat(polish): close all 6 review nitpicks in one sweep

closes board-viewer-polish

- M1 src/parser.ts: comment explaining why **Status:** text field is intentionally
  ignored (emoji is canonical, prevents future-reader head-scratch)
- M2 src/render.ts + tests: clamp future ISO to '0m' (server clock drift safety)
  + inline comment + test
- M3 .tasks/board-viewer-gitea-reader.md: decisions-log clarifying orphan
  per-task files are out of scope by design (STATUS.md = index of record)
- M4 static/board.{js,css} + src/render.ts: filter rebuilt to query records
  (not DOM badge text); 5 status-filter pill buttons in header with active
  toggle state; smoke-verified blocked filter
- M5 deploy/Dockerfile.build: HEALTHCHECK (file fresher than 2×tick) and
  stderr redirect for failures with timestamp
- M6 src/reader.ts: parallelize getLatestCommitIso per-repo via Promise.all
  (preserves block order)

49 tests pass (was 43 pre-polish), typecheck clean, smoke against real Gitea
returns 81 records from 4 repos.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
vitya
2026-05-22 15:46:47 +03:00
parent 930e404545
commit 469ff112cc
10 changed files with 126 additions and 20 deletions

View File

@@ -81,6 +81,36 @@ header h1 {
font-variant-numeric: tabular-nums;
}
.status-filters {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
margin-top: 0.5rem;
width: 100%;
}
.status-filter {
font: inherit;
font-size: 0.75rem;
padding: 0.2rem 0.55rem;
background: transparent;
border: 1px solid var(--border);
border-radius: 999px;
color: var(--muted);
cursor: pointer;
transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.status-filter:hover {
border-color: var(--muted);
}
.status-filter.active {
background: var(--accent);
color: var(--bg);
border-color: var(--accent);
}
main.board {
display: grid;
grid-template-columns: repeat(5, minmax(14rem, 1fr));

View File

@@ -142,15 +142,30 @@ function updateRefreshInfo() {
updateRefreshInfo();
setInterval(updateRefreshInfo, 30_000);
const recordsBySlug = new Map(records.map((r) => [r.slug, r]));
const activeStatuses = new Set();
function applyFilter(query) {
const q = query.trim().toLowerCase();
document.querySelectorAll('.card').forEach((card) => {
const slug = card.dataset.slug || '';
const project = card.querySelector('.badge.project')?.textContent || '';
const status = card.querySelector('.badge.status')?.textContent || '';
const title = card.querySelector('.card-title')?.textContent || '';
const hay = `${slug} ${project} ${status} ${title}`.toLowerCase();
card.dataset.hidden = q === '' || hay.includes(q) ? 'false' : 'true';
const rec = recordsBySlug.get(slug);
if (!rec) {
card.dataset.hidden = 'true';
return;
}
const textHay = [
rec.slug,
rec.title,
rec.project,
rec.project_owner ?? '',
rec.status,
]
.join(' ')
.toLowerCase();
const textMatch = q === '' || textHay.includes(q);
const statusMatch = activeStatuses.size === 0 || activeStatuses.has(rec.status);
card.dataset.hidden = textMatch && statusMatch ? 'false' : 'true';
});
}
@@ -158,6 +173,21 @@ filterInput?.addEventListener('input', (e) => {
applyFilter(e.target.value);
});
document.querySelectorAll('.status-filter').forEach((btn) => {
btn.addEventListener('click', () => {
const s = btn.dataset.status;
if (!s) return;
if (activeStatuses.has(s)) {
activeStatuses.delete(s);
btn.classList.remove('active');
} else {
activeStatuses.add(s);
btn.classList.add('active');
}
applyFilter(filterInput?.value || '');
});
});
toggleArchived?.addEventListener('change', (e) => {
document.body.classList.toggle('show-archived', e.target.checked);
});