Skip to content

Batch 1: Feed experience — load more, session cache, safe share button#27

Open
tinkerwise wants to merge 6 commits into
mainfrom
feature/batch-1-feed-experience
Open

Batch 1: Feed experience — load more, session cache, safe share button#27
tinkerwise wants to merge 6 commits into
mainfrom
feature/batch-1-feed-experience

Conversation

@tinkerwise

Copy link
Copy Markdown
Owner

Closes #22

Summary

  • Raises initial visible articles from 10 → 30; adds a Load More button (+20 per click, disappears when exhausted)
  • Adds a sessionStorage feed cache (20-min TTL) so return visits render immediately instead of showing a blank loading state
  • Replaces inline onclick share button with a delegated event listener using data-action="share"

Files changed

  • src/scripts/feedDisplay.jsMAX_VISIBLE_ARTICLES → 30, LOAD_MORE_BATCH = 20
  • src/scripts/feeds.js — cache read/write, load more wiring, delegated share listener
  • src/scripts/state.jsloadMoreVisible counter
  • src/scripts/app.js — reset loadMoreVisible on filter changes
  • public/style.css.load-more-btn styles

Test plan

  • Feed renders 30 articles on first load (no blank state)
  • Load More button appears when >30 articles available; disappears when exhausted
  • Reload page — cached articles appear instantly, then refresh silently in background
  • Share button works via delegated listener; no inline onclick in source

Generated by Claude Code

claude added 6 commits May 25, 2026 11:23
Feed experience (Batch 1):
- MAX_VISIBLE_ARTICLES bumped to 30; load-more adds 20 at a time
- loadMoreVisible state resets on filter/sort/search/category changes
- Share button converted from inline onclick to delegated data-action listener

Housekeeping (Batch 4):
- Audio path in easter-eggs.js uses BASE constant instead of hardcoded URL
- Auto-refresh skips fetches between midnight and 8am local time
- City Connect Friday auto-theme only applies when user has no saved preference
- Reader modal converted from hardcoded light colors to CSS theme variables

API abstraction (Batch 5 partial):
- New mlbApi.js with named functions for every MLB Stats API endpoint

https://claude.ai/code/session_01C1vhzbYUCRYNikqatrcAYN
- Show 30 articles initially (up from 10), Load More reveals 20 at a time
- sessionStorage cache (key: yardreport_feed_cache, TTL 20 min) serves
  stale-while-revalidate: instant render on reload, silent background refresh
- Share button inline onclick replaced with event-delegated data-action listener
- Load More button styled with orange accent (#df4601) consistent with dark theme
- loadMoreVisible resets to 0 on search/sort/filter/category changes

https://claude.ai/code/session_01C1vhzbYUCRYNikqatrcAYN
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.

Feed experience: load more, session cache, safe share button

2 participants