Skip to content

feat(notes): add paginator to code notes page - #5203

Open
Jamiras wants to merge 4 commits into
RetroAchievements:masterfrom
Jamiras:feature/code_note_pagination
Open

feat(notes): add paginator to code notes page#5203
Jamiras wants to merge 4 commits into
RetroAchievements:masterfrom
Jamiras:feature/code_note_pagination

Conversation

@Jamiras

@Jamiras Jamiras commented Sep 8, 2026

Copy link
Copy Markdown
Member

@Jamiras Jamiras changed the title add paginator to code notes page feat(notes): add paginator to code notes page Sep 8, 2026
@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds paginated code-note loading and renders notes without legacy helpers.

Confidence Score: 5/5

Safe 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

Comment thread resources/views/pages-legacy/codenotes.blade.php
Comment thread resources/views/pages-legacy/codenotes.blade.php Outdated
Comment thread resources/views/pages-legacy/codenotes.blade.php
Comment thread resources/views/pages-legacy/codenotes.blade.php Outdated
Comment thread resources/views/pages-legacy/codenotes.blade.php Outdated
->offset($offset)
->get();

if ($codeNotes->empty()) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This disables all subset merging.

http://localhost:64000/codenotes.php?g=25606

Prod:

Image

Local:

Image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to empty($codeNotes). Why do they differ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

rowEl.querySelector('.keep-base-btn').classList.add('hidden');
rowEl.querySelector('.keep-subset-btn').classList.add('hidden');
rowEl.querySelector('.subset-note-display').classList.add('hidden');
rowEl.querySelector('.subset-note-author').classList.add('hidden');
rowEl.querySelector('.edit-btn').classList.remove('hidden');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {

Comment thread resources/views/pages-legacy/codenotes.blade.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants