Example to read aloud — not a recorded result
“"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."”
- · Illustrative practice text, not a recorded Halopen result.
- · Read a short section aloud, then check the inserted draft for errors.
- · Keep exact names, numbers and formatting under your own review.