-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more parametrisation to the box partial #1451
Comments
@swombat I think this be a good candidate for 3 smaller PRs instead of one big one. Item 1 seems like a solid fix for a bug. Item 2 seems like an interesting addition, but I'd like a chance to play with it a bit (in a branch/PR) just to make sure that it will behave under a variety of circumstances. Item 3 I'm not so sure about. Generally I'm not a fan of top-of-list pagination controls, and I think users are used to looking for them at the bottom of the list. I also don't think it's great for usability if the bottom pagination controls are sometimes there and sometimes not depending on the size of the list you're looking at. I'd be happy to try it out in a PR, but I can't promise that we'd merge that one. |
Cool. I'll give those a go then. On item 3, I see what you're saying. The problem I'm trying to solve is I literally watched a user recorded session where they couldn't figure out there were new results appearing (created by an AI) because the pagy was at the bottom, off-screen, so the only visual change as new results were added was... nothing. So they just sat there waiting for something to happen and nothing happened. The reason to then make the bottom one only appear with more than 10 results was that if there's very few results and two paginators it looks quite clunky. |
A few features/adjustments would be nice, and can be done in one fix, if this is worth doing (I've already done these locally):
1. don't display title/description section if both are missing
Currently, the box starts with the following code:
So if neither title nor description are provided, you get a massive blank space at the top. Kinda fugly, so I fixed it like this:
2. Shortcut buttons:
Also in the header, having shortcut buttons at the top right of the card seems like a useful reusable pattern, like a show/hide invisible, or other utility buttons:
This is easily done by further updating the following to the box heading section:
3. Make pagy position parametrisable
If the list is longer than the screen (e.g. the default 20 items), then when you're looking at the top of the page you won't know that there are new items in the list (e.g. if they're being added by the backend).
Luckily pagy has no issues with being displayed twice on the page. I solved it by having 2 pagys. One above the body:
And one below:
To avoid clutter, the bottom one only shows if there are more than 10 items in the list.
For BulletTrain I would make this parametrisable. Add a parameter to the box partial of
:pagy_placement
, defaulting to:bottom
as that is the current default. But also offer the option of:top
,:both
or:none
to disable pagy entirely.The text was updated successfully, but these errors were encountered: