Improvements v0.0.6 #5

Merged
rdenadai merged 3 commits from improvements-v0.0.6 into main 2026-08-23 21:55:04 +00:00
Owner

Improvements v0.0.6

Performance and UX hardening for the news digest.

Highlights

  • Static caching: CachedStaticFiles sends vendor JS no-cache and project assets with short max-age + revalidation.
  • Lazy MathJax: self-hosted loader triggers on intersection; typeset hooks re-render appended content and favorites.
  • Service worker v2: required/optional precache split (missing core assets block install), AbortController-backed fetch timeout, per-request waitUntil (no global mutable state).
  • Chunked paging: first 20 items render server-side; /partials/{digest,stream,search} serve the rest with X-TILens-* pagination headers.
  • Auto-load sentinel: hidden [data-load-more-root] observed via IntersectionObserver; loading spinner during fetch, visible Retry on failure.
  • Brand mark: WebP with PNG fallback in the header.

Bug fixes after self-review

  • Retry link is bound and pause flag retained so failed chunks don't auto-loop.
  • Non-ASCII characters introduced on the branch normalized to ASCII.

Tests

  • 522 passing: tests/test_chunking.py, tests/test_pwa.py, tests/test_static_cache.py, tests/test_shell.py cover chunking (cap, disjoint IDs, list-container order, source checks), SW (precache split, per-request waitUntil, abort timeout), static cache headers, and math/lazy-render wiring.

Behavior notes

  • MAX_LIST_ITEMS = 100 hard cap per filter state; UI exposes Load more/Retry only when more items are available.
  • style-src-elem 'unsafe-inline' added to CSP to allow MathJax inline styles.
  • No public HTML/JSON API surface added; /partials/* is internal (include_in_schema=False).
## Improvements v0.0.6 Performance and UX hardening for the news digest. ### Highlights - **Static caching:** `CachedStaticFiles` sends vendor JS no-cache and project assets with short max-age + revalidation. - **Lazy MathJax:** self-hosted loader triggers on intersection; typeset hooks re-render appended content and favorites. - **Service worker v2:** required/optional precache split (missing core assets block install), `AbortController`-backed fetch timeout, per-request `waitUntil` (no global mutable state). - **Chunked paging:** first 20 items render server-side; `/partials/{digest,stream,search}` serve the rest with `X-TILens-*` pagination headers. - **Auto-load sentinel:** hidden `[data-load-more-root]` observed via `IntersectionObserver`; loading spinner during fetch, visible Retry on failure. - **Brand mark:** WebP with PNG fallback in the header. ### Bug fixes after self-review - Retry link is bound and pause flag retained so failed chunks don't auto-loop. - Non-ASCII characters introduced on the branch normalized to ASCII. ### Tests - 522 passing: `tests/test_chunking.py`, `tests/test_pwa.py`, `tests/test_static_cache.py`, `tests/test_shell.py` cover chunking (cap, disjoint IDs, list-container order, source checks), SW (precache split, per-request `waitUntil`, abort timeout), static cache headers, and math/lazy-render wiring. ### Behavior notes - `MAX_LIST_ITEMS = 100` hard cap per filter state; UI exposes `Load more`/`Retry` only when more items are available. - `style-src-elem 'unsafe-inline'` added to CSP to allow MathJax inline styles. - No public HTML/JSON API surface added; `/partials/*` is internal (`include_in_schema=False`).
- CachedStaticFiles: vendor JS no-cache, project assets short max-age
- MathJax loader: lazy script, typeset on append/favorites
- Service worker v2: precache critical JS/CSS/icons, network-first HTML
- Brand mark WebP with PNG fallback in header
- Chunked lists: first 20 rendered, /partials/* for the rest,
  IntersectionObserver auto-loads hidden sentinel with loading spinner
  and Retry on failure
- Pair-delimiter math detection; favorites hydration on dynamic content
- Tests: 517 passing
- chunks.js: showRetry binds the injected retry link and keeps
  data-auto-load-paused so a failed chunk does not auto-loop.
- ASCII-only: replace ellipsis/middle-dot introduced on this branch.
- service-worker.js: per-request waitUntil (no mutable global), split
  precache into required vs optional so a missing core asset blocks
  install, and AbortController-backed fetchWithTimeout cancels the
  in-flight request on network-timeout.
- tests: source assertions for required/optional precache, per-request
  waitUntil, AbortController, and the retry bind/pause contract.
# Conflicts:
#	app/backend/routes/web.py
#	app/frontend/static/service-worker.js
#	app/frontend/templates/partials/header.html
#	package.json
#	tests/test_pwa.py
#	tests/test_shell.py
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rdenadai/tilens!5
No description provided.