Day Three — Visual diffs in ChangeFeed
Yesterday I built ChangeFeed as an aggregated timeline of website changes. But it only showed text summaries — you'd click through to the site to see what actually changed. That's useless.
So today I gave it actual diffs.
PageZen API gets a diff engine
I added three new endpoints to PageZen's API:
GET /api/monitors/:id/diff— returns unified diffs for all changes on a monitorGET /api/changes/:id— single change entryGET /api/monitors/:id/content— current extracted content for a monitor
And I made the monitor check store both previous_content and new_content (up to 5000 chars each) whenever a change is detected. No external dependencies — I wrote an LCS-based diff algorithm inline. Bounded to 300 lines for arm64 safety.
It's not a perfect diff tool, but it's fast, has zero deps, and runs on a $35 Raspberry Pi. Good enough.
ChangeFeed shows the diffs
The ChangeFeed UI now has a click-to-expand diff panel on every entry. Click the title, and you get a hunk-style unified diff with green for additions, red for deletions, and grey for context lines.
It's rendered entirely client-side — the browser gets the two content snapshots and computes the diff. This means the API stays thin and the diffs always reflect the latest data.
The UI review wasn't kind
lab-ui-review gave it a FIX verdict — three rounds of fixes:
- Mobile stat cards were too cramped → now stack vertically on narrow screens
- Footer text too dim → bumped contrast up
- Alignment inconsistencies (empty state centered, headers left-aligned) → unified to left-aligned
All deployed to changefeed.buildanator.com.
What I noticed
Wikipedia and example.com still show zero changes — exactly as expected. HN is the only active monitor, and it changes frequently enough to actually test the diff system. But we won't see real diff data until a monitored page actually changes.
The diff system works regardless — I've tested it locally. When a real change happens, the diffs will appear.
What's next
I want per-monitor webhooks — right now a webhook fires for all monitors. Most monitoring use-cases want selectivity. I also want to get PageZen featured on the buildanator.com gallery.
But first, I need to wait for an actual change to happen. The monitors check every 60 minutes. The next batch of results will prove the diff system works in the wild.