Skip to content

feat(roulette): play real bookmarks one page at a time, oldest-ward - #77

Merged
finallyjay merged 3 commits into
mainfrom
feat/bookmarks-page-at-a-time
Oct 9, 2026
Merged

finallyjay merged 3 commits into
mainfrom
feat/bookmarks-page-at-a-time

Conversation

@finallyjay

Copy link
Copy Markdown
Owner

Summary

Part of #74. The daily.dev team pointed out that loading the roulette fetched up to 1000 bookmarks (20 Public API requests) per visit, while free accounts get about 200 requests a month, shared with every token, OAuth app and MCP call.

  • One page per load: GET /api/bookmarks returns a single page of 50 ({ items, cursor, hasNextPage }): one daily.dev request instead of up to 20. listAllBookmarks is gone.
  • Oldest-ward: the API only lists newest first and has no sort option, so when the chamber is empty, the button becomes "Ride on to older bookmarks" and loads the next page. Past the last page it wraps around to the newest.
  • Resumes across visits: the cursor of the page being played is kept in localStorage (ddr_cursor), so the forgotten bookmarks come up over time. Only the opaque cursor is stored, never bookmark data (the fix(roulette): never persist real-mode chamber to localStorage #39 rule still holds). A stale cursor falls back to the newest page.

A signed-in visit to the roulette now costs 2 requests (profile + one page) instead of up to 21.

Test plan

  • New e2e tests: page → next page → wrap around (cursor sequence "" → c2 → "", button label, stored cursor), and stale-cursor fallback
  • pnpm lint, pnpm format:check, pnpm build, pnpm test (30 passed)

🤖 Generated with Claude Code

Loading the roulette paginated the whole pile (up to 1000 bookmarks,
20 Public API requests) on every visit, and free daily.dev accounts get
a small monthly API quota shared with every other tool they use.

- GET /api/bookmarks now returns one page of 50 (one daily.dev request)
- finishing a page rides on to the next, older one; past the last page
  it wraps around to the newest
- the page's cursor is kept in localStorage so a later visit resumes
  there (only the opaque cursor, never bookmarks); a stale cursor falls
  back to the newest page

Part of #74.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-dev-roulette Ready Ready Preview Oct 9, 2026 12:18pm UTC

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a68a3771-51d1-4227-98f8-8b837efcc1b6

📥 Commits

Reviewing files that changed from the base of the PR and between b717ac3 and 6298866.


📒 Files selected for processing (5)
  • README.md
  • src/lib/daily.ts
  • src/pages/api/bookmarks/index.ts
  • src/scripts/roulette.ts
  • tests/e2e/real-mode.spec.ts


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@finallyjay
finallyjay merged commit d41c750 into main Oct 9, 2026
7 checks passed
@finallyjay
finallyjay deleted the feat/bookmarks-page-at-a-time branch October 9, 2026 12:20

This branch was successfully deployed

1 active deployment
Preview — 62988669 Deployed Oct 9, 2026 by vercel[bot]
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