Jiseoup/showmycodePublic
EN|KO
  • Code
  • Commits
  • Pull Requests
← Back to list
Merged

feat: make commits and pulls page size configurable via env vars

#9
JiseoupJiseoup · May 4, 2026feat/configurable-pagination → main
feat
OverviewCommitsFiles changed

Related Issue

N/A — small operability improvement.

Changes

Make the items-per-page on the commits and pulls list configurable via env vars, so each deployment can tune list density without code changes (e.g. denser for power users, sparser for demo screens).

  • Add COMMITS_PER_PAGE (default 50) for /[lang]/repository/[owner]/[repo]/commits.
  • Add PULLS_PER_PAGE (default 30) for /[lang]/repository/[owner]/[repo]/pulls.
  • Follow the existing FILE_TREE_DEPTH pattern (Number(process.env.X) || <default>) — no new abstraction, no client-side clamp.
  • Document both vars in .env.example, including the GitHub API hard cap of 100.
  • Update the routing table in CLAUDE.md to note the defaults are configurable.

Note on the GitHub API cap: per_page is silently capped at 100 by GitHub. Setting a value above 100 will make the "next page" link disappear (because hasNext = results.length === PER_PAGE can never be true). The cap is documented in .env.example rather than enforced in code, matching the FILE_TREE_DEPTH precedent.

How to Verify

  1. npm install (no new deps).
  2. npm run format:check && npm run lint && npm run typecheck && npm run build → all pass.
  3. Default behavior (no override):
    npm run dev
    
    • Visit /[lang]/repository/[owner]/[repo]/commits → 50 items per page, ?page=2 works.
    • Visit /[lang]/repository/[owner]/[repo]/pulls → up to 30 items per page.

Checklist

  • npm run format:check passes
  • npm run lint passes
  • npm run typecheck passes
  • npm run build passes
  • PR title follows Conventional Commits (feat:, fix:, chore:, refactor:, docs:, test:, )
i18n: