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:
@@ -42,6 +42,12 @@ describe('formatAge', () => {
|
||||
test('returns "0m" for sub-minute differences', () => {
|
||||
expect(formatAge('2026-05-22T11:59:30Z', now)).toBe('0m');
|
||||
});
|
||||
|
||||
test('clamps future timestamps to "0m" (server clock drift safety)', () => {
|
||||
// ISO in the future of `now` — can happen with clock drift between
|
||||
// VDS and Gitea. Should clamp to "0m" rather than throw or surface negative.
|
||||
expect(formatAge('2026-05-22T13:00:00Z', now)).toBe('0m');
|
||||
});
|
||||
});
|
||||
|
||||
describe('partitionByStatus', () => {
|
||||
@@ -184,6 +190,14 @@ describe('renderBoard', () => {
|
||||
expect(html).not.toMatch(/<span class="date"/);
|
||||
});
|
||||
|
||||
test('renders 5 status-filter pill buttons in canonical order', () => {
|
||||
const html = renderBoard([], { generatedAt: now });
|
||||
|
||||
const re = /<button[^>]*class="status-filter"[^>]*data-status="([^"]+)"[^>]*>/g;
|
||||
const matches = [...html.matchAll(re)].map((m) => m[1]);
|
||||
expect(matches).toEqual(['open', 'in_progress', 'paused', 'blocked', 'done']);
|
||||
});
|
||||
|
||||
test('writes generation timestamp as data-generated attribute on the header', () => {
|
||||
const html = renderBoard([], { generatedAt: now });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user