Skip to content

feat(feed-directory): rebuild browse UI as layered, testable module tree - #1243

Merged
gildesmarais merged 7 commits into
mainfrom
feat/feed-directory-rebuild
Aug 22, 2026
Merged

feat(feed-directory): rebuild browse UI as layered, testable module tree#1243
gildesmarais merged 7 commits into
mainfrom
feat/feed-directory-rebuild

Conversation

@gildesmarais

@gildesmarais gildesmarais commented Aug 22, 2026

Copy link
Copy Markdown
Member

What changed

  • Replaced monolithic FeedDirectory.astro, feed-directory.js, and catalogClient.js with src/components/feed-directory/ (adapters, domain, app, ui, CSS) mounted from feed-directory/FeedDirectory.astro.
  • Catalog wire handling lives in adapters/catalog-api.ts: GET /api/v1/configs envelope validation, row normalization to FeedDirectoryEntry, and catalog_version gate (supported: [1]).
  • Browser concerns split into adapters (browser-storage, browser-location, browser-download) so domain code stays free of window / document.
  • App layer uses directory-state.ts for filter/pagination transitions and FeedDirectoryApp.ts for fetch/render orchestration; ui/render.ts builds HTML from a view model.
  • Added Vitest (vitest.config.ts, make test, make check) with unit tests for catalog parsing, filters, language matching, OPML, and directory state.
  • UX: two-column feed cards, URL-synced filters (q, topic, lang, sort, page), base language codes (de matches de-DE), disabled Starlight TOC on /feed-directory/ for full width.
  • Docs: CONTEXT.md glossary (catalog seam, instance persistence), expanded AGENTS.md module layout and verification gates; removed legacy instanceUrl.js.

Why

The prior browse UI was hard to scan and lived in one large script bundle. The rebuild keeps the same thin-client contract over a running html2rss-web instance while making layout, filtering, and instance deep links maintainable. Follow-on commits after the initial tree split wire parsing and browser I/O behind adapters and add tests so catalog envelope changes fail in CI instead of only in the browser.

Risk

  • Low functional risk — still client-only over GET /api/v1/configs; instance default, #!url= deep link, and html2rss.feedDirectory.instanceUrl localStorage behavior are documented in CONTEXT.md.
  • Intentional break: no legacy DOM hooks or old script paths (feed-directory.js, catalogClient.js, instanceUrl.js).
  • After deploy, spot-check filter URL sharing, instance change, OPML export, params rows, and catalog-disabled / unreachable instance error states.

Review map

  1. src/components/feed-directory/adapters/catalog-api.test.ts and domain/filters.test.ts — expected wire shapes, filter/language edge cases
  2. src/components/feed-directory/adapters/catalog-api.ts — sole catalog wire parser; version gate and FeedDirectoryEntry mapping
  3. src/components/feed-directory/app/FeedDirectoryApp.ts and app/directory-state.ts — load/error flows and state transitions vs URL params
  4. src/components/feed-directory/adapters/browser-*.ts — instance persistence, filter sync, OPML download
  5. src/components/feed-directory/ui/render.ts and feed-directory.css — row layout and Starlight-aligned styling
  6. CONTEXT.md and AGENTS.md — glossary and contributor contracts

Validation

  • make check (lint + Vitest, exit 0)
  • make build (exit 0 on prior PR pass; re-run before merge if Astro content changed since)
  • Manual: spot-check /feed-directory/ against an instance with catalog enabled

@gildesmarais gildesmarais changed the title feat(feed-directory): rebuild browse UI as Astro module tree feat(feed-directory): rebuild browse UI as layered, testable module tree Aug 22, 2026
@gildesmarais
gildesmarais marked this pull request as ready for review August 22, 2026 11:28
@gildesmarais
gildesmarais merged commit f3f2c53 into main Aug 22, 2026
5 checks passed
@gildesmarais
gildesmarais deleted the feat/feed-directory-rebuild branch August 22, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant