Claude #3

Merged
biosias merged 12 commits from claude into main 2026-10-26 23:32:56 +01:00
12 Commits
Author SHA1 Message Date
biosiasandClaude Sonnet 5 96cefba24d Cache per-query search matches so repeat searches skip unchanged articles (AI)
Adds a searchQueries IndexedDB store (js/cache.js) keyed by the exact
search text, holding a { articlePath: { mtime, matched } } map per
query. loadSearch() loads it once per new query, trusts a cached
result whenever an article's mtime still matches instead of running
matchesQuery() again, and writes back whatever's newly checked each
scan round. Repeat searches for the same term — even after a page
reload — now only need to actually check articles that are new or
have changed since, not the whole site again. Capped at
MAX_CACHED_SEARCHES (30) distinct queries with least-recently-used
eviction so trying many different terms over time doesn't grow the
cache unbounded.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:18:03 +02:00
biosiasandClaude Sonnet 5 4e2229fed9 Log hydration failures instead of swallowing them silently (AI)
hydrateArticleNow()'s catch-all discarded network, HTTP, and parsing
errors alike with no diagnostic, using the same fallback for all of
them. A real bug in parseFrontmatter()/deriveContentFields() would
silently leave an article title-less forever with no way to tell it
apart from a transient fetch blip. Now logged via console.error.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:08:17 +02:00
biosiasandClaude Sonnet 5 2b2cdb1d3c Translate the optional #site-title header link at startup (AI)
document.title was already set from the siteName string, but a
visible #site-title header link stayed hardcoded in whatever language
it was typed in — a translated site showed a translated tab title
next to an untranslated header. Set once in router.js's init() rather
than showListView(), so a page that loads straight into an article
route still gets it. Documented #site-title as optional embedding
markup and corrected README's claim that <title> isn't JS-templated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:07:45 +02:00
biosiasandClaude Sonnet 5 057f6673cb Cap concurrent per-author listing fetches during indexing (AI)
Wave 2 of the crawl fetched every author's directory listing via a
plain Promise.all, with no limit — a site with hundreds of authors
fired one simultaneous request per author on every cold-cache load.
Routed through mapWithConcurrency/MAX_CONCURRENT_REQUESTS, the same
cap hydrateArticles() already respects for content fetches.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:05:54 +02:00
biosiasandClaude Sonnet 5 cf2733368f Catch render() errors from the progress-listener callback (AI)
The onArticlesProgress listener invoked async render() without
awaiting or catching it, unlike the final render() call, which is
inside a try/catch. A mid-crawl render failure was an unhandled
rejection that left the list stuck on its loading state forever
instead of showing articlesLoadError.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:04:49 +02:00
biosiasandClaude Sonnet 5 6d424ffbc9 Stop crawl-health warning false-positiving on non-article files (AI)
The loaded/total ratio check treated a low filename-match rate as a
sign of network/CORS breakage, but indexing does no per-article fetch
at all — a low ratio just means many non-conforming .md files coexist
with real articles, which is normal and not a health problem. Removed
that heuristic and its now-unused crawlHealthArticlesFailed string;
real breakage is still fully caught by the authors-failed check.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:04:10 +02:00
biosiasandClaude Sonnet 5 c3d8f0171c Fix blank line silently dropping YAML block arrays (AI)
A blank line between a block-array key and its "- item" lines matched
neither the item nor the key regex, resetting arrayKey to null and
causing the following items to be silently skipped. Blank lines are
now ignored instead of ending the array.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:02:38 +02:00
biosiasandClaude Sonnet 5 ae9bcfec3a Fix IndexedDB cache being defeated when mtime is unparseable (AI)
resolveStub() required a non-null mtime to reuse a cached hydrated
entry, so any listing without a parseable mtime (HTML-autoindex
fallback edge cases) rebuilt every stub from scratch on every crawl.
Comparing mtime directly (including null === null) trusts the cache
when there's no evidence either way, same as before this changed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 16:02:31 +02:00
biosiasandClaude Sonnet 5 c8464398b9 Replace underscore draft convention with author/draft/ folder (AI)
Drafts now live in an author's own draft/ subdirectory instead of a
leading-underscore filename prefix. The crawler already skips
subdirectories when listing an author's files, so nothing under
draft/ is ever indexed; nginx should also deny that path outright so
drafts aren't fetchable by a guessed direct URL either.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 15:49:00 +02:00
biosiasandClaude Sonnet 5 730f16934d Remove category/year filtering, keep tag-only filtering (AI)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 15:19:59 +02:00
biosiasandClaude Sonnet 5 91a24574a8 Remove last literal mentions of the old project name (AI)
cache.js's comment explaining the DB_NAME prefix change referenced
the old "cmjs-" prefix literally as a historical note. Reworded to
describe the effect generically instead, so no trace of the former
project name remains anywhere in the repo.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 14:58:17 +02:00
biosiasandClaude Sonnet 5 16395fa7c5 Rename project from cmjs to cmkiss (AI)
Updates every in-repo mention: README.md title/prose/example paths,
code comments in config-default.js and router.js, and the IndexedDB
DB_NAME prefix in cache.js (cmjs-cache-v3 -> cmkiss-cache-v3).

The DB_NAME change has the same effect as a schema-version bump --
every returning visitor's browser opens a fresh, empty cache under the
new name and the old cmjs-cache-v3 database is left as orphaned
storage. Harmless (cache.js degrades to live-fetch when the cache is
empty), noted in a comment there rather than left as an unexplained
side effect.

Two things this commit does NOT cover, both outside this checkout:
- The local directory itself (still /home/user/Projects/cmjs) --
  renamed separately right after this commit.
- The git hosting-side repo name/remote URL
  (git.astronomickaexpedice.cz, Astronomicka_Expedice/cmjs.git) --
  requires server-side access this session doesn't have; needs a
  manual rename on the host plus a local `git remote set-url` update
  to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-22 14:56:09 +02:00