Halopen output
“"Goal: replace the homemade pagination logic across the dashboard pages with a single shared usePagination hook. Approach: First, inventory every place pagination logic exists today. Search for any code that references page, pageSize, offset, or limit in component files under apps slash web slash app slash dashboard. Produce a markdown file at docs slash refactors slash pagination-inventory dot md listing every file and the current behavior. Second, design the usePagination hook in lib slash hooks slash use-pagination dot ts. It should accept a totalItems count and a pageSize, and return currentPage, setCurrentPage, totalPages, hasNext, hasPrev, and a paginatedItems helper that takes an array and returns the slice for the current page. Third, migrate each dashboard page from its existing logic to the hook. Don't change any rendered output — the user-visible behavior must be identical. Tests for each page must stay green throughout. Fourth, write a single regression test that mounts each dashboard page with a 500-item dataset and verifies pagination renders correctly. Constraints: don't add a new dependency. Don't change the existing URL-state behavior. Stop and ask before doing the migration phase if more than three files are using a pattern not anticipated in the inventory."”
- · 290-word multi-phase spec dictated in a single ~110-second hold
- · Four numbered phases, each with explicit constraints, all preserved verbatim
- · Stop-and-ask escalation rule preserved exactly as spoken
- · File paths and helper names captured verbatim
- · Voice version: ~110 seconds; typed version would have been 6-8 minutes