feat(notes): add paginator to code notes page - #5203
Conversation
Greptile SummaryAdds paginated code-note loading and renders notes without legacy helpers. Confidence Score: 5/5Safe to merge; the previous empty-page crash is fixed. Empty result pages no longer dereference missing notes, and no new failures remain. Reviews (3): Last reviewed commit: "prevent exception selecting offset beyon..." | Re-trigger Greptile |
| ->offset($offset) | ||
| ->get(); | ||
|
|
||
| if ($codeNotes->empty()) { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Changed to empty($codeNotes). Why do they differ?
There was a problem hiding this comment.
Related: I noticed on this branch (and also tested on master). When clicking the keep buttons, they don't get hidden, while the note text and avatar do.
RAWeb/resources/views/pages-legacy/codenotes.blade.php
Lines 193 to 197 in 5fda24c
There was a problem hiding this comment.
collect([1, 2, 3])->empty() creates and returns an empty collection. In this sequence, ->empty() is a factory.
empty(collect([1, 2, 3])) checks if a given var is falsy. collect([1, 2, 3]) will never be falsy. This causes the current code to unfortunately break in a different way. Check http://localhost:64000/codenotes.php?g=25606&o=5000.
To confuse matters even more, the fix we probably want to reach for is yet another expression of emptiness:
if ($codeNotes->isEmpty()) {

Fixes out of memory error accessing http://localhost:64000/codenotes.php?g=2621
https://retroachievements.org/log-viewer?file=5a6da50a-laravel-2026-09-04.log&query=log-index%3A33