feat(requests): keyset pagination for the request list (#48) - #58
Merged
Merged
Conversation
The request list shows 50 requests per page, newest first, keyset-paged on (created_at desc, id desc). The cursor is the id of the last row; its position is resolved inside the tenant transaction at full timestamp precision, so a malformed, unknown or foreign cursor falls back to the first page. Filters are kept in the "Ältere Anfragen" / "Zurück zum Anfang" links; export records are loaded only for the rows of the current page. The start page counts requests per status in the database instead of loading the whole list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
…ositioned page (#48 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1
Owner
Author
Frischer Review (read-only Subagent) – Ergebnis und UmgangNichts blockierend. Bestätigt: Sortierung
Nach den Änderungen: Generated by Claude Code |
Fluory
marked this pull request as ready for review
September 24, 2026 11:52
This was referenced Sep 24, 2026
…ist-paging-48 # Conflicts: # CHANGELOG.md
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warum
Fixes #48 · Die Anfragenliste lud bisher alle Anfragen der Firma auf einmal – mit wachsender Nutzung wird die Seite langsam. Gestapelt auf #53 (neues Design); Basis
claude/feat-ui-design-52, nach dessen Merge aufmainumstellen.Arbeitsstand
(created_at desc, id desc), Cursor?after=<uuid>, Links „Ältere Anfragen“ / „Zurück zum Anfang“, Exportdaten nur für die Seite, Startseite zählt percountRequestsByStatusin der DB, Tests, CHANGELOG, frischer Review eingearbeitet,verifygrün, E2E-Smokes 2/2, CI grün.mainumstellen; Review/Merge durch den Orchestrator.Was ist passiert (Klartext)
Die Anfragenliste zeigt jetzt höchstens 50 Anfragen auf einmal, die neuesten zuerst. Mit „Ältere Anfragen“ blättert man weiter, mit „Zurück zum Anfang“ wieder nach vorn; gesetzte Filter (Status, mögliche Duplikate) bleiben dabei erhalten. Das Blättern merkt sich die letzte gezeigte Anfrage statt einer Seitennummer – kommen währenddessen neue Anfragen herein, rutscht nichts doppelt oder verloren durch. Die Startseite zählt die offenen Anfragen jetzt direkt in der Datenbank, statt alle zu laden.
Plan-Pflicht (SYSTEM.md §4)
Geändert
src/features/requests/cursor.ts(+ Test): Cursor lesen/prüfen – alles außer genau einer UUID → Seite 1src/features/requests/repository.ts,index.ts:listRequests(tx, filter, { after })→{ rows, nextCursor, firstPage }(51 holen, 50 zeigen; Cursor-Zeile in einer Abfrage mit voller Zeitgenauigkeit gelesen, fremde/unbekannte Cursor → Seite 1),countRequestsByStatussrc/app/requests/page.tsx: Blätter-Links mit Filtern (rel="next"), „Zurück zum Anfang“ nur auf einer positionierten Seite, Exportdaten nur für die Seitesrc/app/page.tsx: Zählung per DBtests/integration/request-list.test.ts(6 neu),tenancy.test.ts(.rows)CHANGELOG.mdNachweis (SYSTEM.md §11)
verify:changed: grün –request-list12/12, Cursor-Unit-Tests 10verify: grün nach den Review-Änderungen – unit 164, integration 120 (lint, typecheck, depcruise, build, audit); CIcheckgrünverify:full/ E2E-Spec:review-smoke,line-items-smoke2/2 grün (beide über/requests)Doku-Entscheidung (genau eine)
api.mdunberührt: die API-Route nimmt nur Uploads an)[Unreleased](sichtbares Feature oder Verhalten – im selben PR, nie „später")Entferntes oder Umbenanntes:
docs/+ README gegrept, Treffer bereinigt: nichts entferntDateigrößen und neue Bausteine (SYSTEM.md §7)
Dateien über 500 Zeilen im Diff (Ausnahmen: generierter Code, Lockfiles, Fixtures, Migrationen, Schemas, Ressourcen, Doku, Konfiguration):
Über 800 Zeilen mit neuer Fachlogik oder über 1000 Zeilen (P1/P2): nicht betroffen
Neue Shared-Komponente, Utility-Datei, Adapter oder fachlicher Service:
cursor,pagination,after,limitinsrc/; gefunden: nichts Gleiches –cursor.tsbleibt im ModulrequestsSubagent-Einsätze
Risiken / offene Punkte
(company_id, created_at, id): jede Seite sortiert alle Anfragen der Firma, um 51 zu nehmen – im Pilot unkritisch; Index als eigene Migration (menschliche Freigabe) vorschlagen.🤖 Generated with Claude Code
https://claude.ai/code/session_01DJ5vaKvTYiMvdngT4d3xo1