Skip to content

Use cursor keys left/right to go through search result pages#406

Merged
jsuto merged 2 commits into
jsuto:masterfrom
larsen0815:cursorkeys_pagination
Mar 30, 2026
Merged

Use cursor keys left/right to go through search result pages#406
jsuto merged 2 commits into
jsuto:masterfrom
larsen0815:cursorkeys_pagination

Conversation

@larsen0815

Copy link
Copy Markdown
Contributor

In #381, you recently added the possibility to go through mails by cursor keys up/down. This PR should do the same for left/right: Go to the previous/next page of search results.

The user could then easily go through all mails and pages just using the cursor keys.

However, this is just a draft. I am not a web dev and ChatGPT wasn't able to create working code to detect the current page.
If you could plese tell me how to solve this, I would update the PR accordingly.

@larsen0815 larsen0815 requested a review from jsuto as a code owner January 20, 2026 16:55
@jsuto

jsuto commented Jan 21, 2026

Copy link
Copy Markdown
Owner

Did it work when you tried it?

@larsen0815

larsen0815 commented Jan 21, 2026

Copy link
Copy Markdown
Contributor Author

No, as I said: Just a draft, needs code to get the current page number to then call navigation(). And I don't have the experience how to write that code.

@larsen0815

Copy link
Copy Markdown
Contributor Author

So, could you please provide a hint how I can get the current page number?

@jsuto

jsuto commented Jan 26, 2026

Copy link
Copy Markdown
Owner

templates/common/paging.tpl implements the pagination, it calls navigation() in assets/js/piler.js

@larsen0815 larsen0815 marked this pull request as draft January 27, 2026 15:55
@larsen0815

Copy link
Copy Markdown
Contributor Author

Yes, but what is the equivalent of $prev_page and $next_page (from paging.tpl) in "piler.js"?
Which variable can be used to get the current page number?

@larsen0815

Copy link
Copy Markdown
Contributor Author

Can you help me here? Otherwise I won't get this implemented.

@jsuto

jsuto commented Feb 11, 2026

Copy link
Copy Markdown
Owner

It's Piler.Shared.page. The navigation() function updates this variable.

@larsen0815

Copy link
Copy Markdown
Contributor Author

Thanks, I think I can continue with this in two weeks.

@larsen0815 larsen0815 marked this pull request as ready for review March 3, 2026 14:59
@larsen0815

Copy link
Copy Markdown
Contributor Author

Working now. The code handles not going to page 0, but doesn't handle going past the last page as I couldn't find a variable that stores the maximum page number. Doesn't show an error though, so this should be fine.

@larsen0815

Copy link
Copy Markdown
Contributor Author

Do you need anything else to be able to merge this?

@jsuto jsuto merged commit 777e009 into jsuto:master Mar 30, 2026
4 checks passed
@jsuto

jsuto commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Thank you!

@larsen0815 larsen0815 deleted the cursorkeys_pagination branch March 30, 2026 15:23
@larsen0815

Copy link
Copy Markdown
Contributor Author

Thanks for merging!

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