Skip to content
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 search result page navigation #2684

Closed
6 tasks
ggeisler opened this issue Jun 11, 2019 · 3 comments · Fixed by #2735
Closed
6 tasks

Add search result page navigation #2684

ggeisler opened this issue Jun 11, 2019 · 3 comments · Fixed by #2735
Assignees
Labels
ContentSearch 🔎 IIIF Content Search API

Comments

@ggeisler
Copy link
Collaborator

ggeisler commented Jun 11, 2019

My first designs actually just assumed access to the next page, so instead of pagination controls there was a "More results" action that would trigger fetching the next page of results:

Screen Shot 2019-06-14 at 9 42 37 AM


Superseded information

This ticket assumes work outlined in #2683 has been completed.

If the search service returns results using a paged structure (example: https://exist.scta.info/exist/apps/scta-app/iiif2/lon/search?q=contradictio), not all result items are necessarily immediately available. But we do know how many pages the results have been split into, so we can provide paging navigation for the user.

Screen Shot 2019-06-11 at 4 16 02 PM

In the mockup above, the highlighted part in the search panel header has been added to the hits version of results described in #2683, because this search service returns paged results.

  • Use the firstPageSharp and lastPageSharp icons for the outermost icons of the page navigation element. Use padding: 12px; for the icons.
  • Icon tooltips for above: "First page" and "Last page".
  • For the inner icons, use the chevronLeftSharp and chevronRightSharp icons, with padding: 12px; for previous and next page navigation.
  • Icon tooltips: "Previous page" and "Next page".
  • Between the next and previous icons, the text "Page x of y", where x = currently selected page and y = total number of pages.
  • Center the page navigation with the panel header. Note that in the mockup it appears that the outermost icons are aligned with the left and right edges of the panel header content, but that's just the way the spacing worked out. The page nav element should be centered and the icons spaced outward based on icon width + the 12px padding.

Page navigation interaction

This probably doesn't need much explanation, but when the user navigates to a new page, the page navigation element, the hit result navigation element, the panel body content, and the canvas should all be updated accordingly.

For example, in the mockup above the user is on page 2 of the results, which this search service returns in pages of 5. If the user then selects the next page icon:

  • the page navigation changes to "Page 3 of 7"
  • the hit result navigation changes to "11 of 33"
  • the panel body content changes to show hit content of result items 11 through 15
  • the canvas changes to show the canvas on which result item 11 appears
@cbeer
Copy link
Collaborator

cbeer commented Jun 14, 2019

According to the spec, the only pagination parameter we are guaranteed to have is the next page; we may not even know how many pages there are.

@cbeer
Copy link
Collaborator

cbeer commented Jun 14, 2019

Unfortunately, I don't see how we can build out these pagination controls. The IIIF response SHOULD tell us how many hits there are and SHOULD tell us what index to the hits start on, but we won't know how many there are per page so we can't calculate how many pages there are. We might assume the page size will be consistent, but that very likely won't work on the last page.

The spec says there MUST be a next page uri, but there might not be a first/previous/last uri. With that, maybe we can naively just request all the pages. If we're already requesting all the data, do we need additional pagination controls, or is it enough to scroll through the full list of hits (and just hope the list is small enough not to be catastrophic...)

@ggeisler
Copy link
Collaborator Author

Maybe we can discuss this post-standup today. My first designs actually just assumed access to the next page, so instead of pagination controls there was a "More results" action that would trigger fetching the next page of results:

Screen Shot 2019-06-14 at 9 42 37 AM

I guess at some point in trying to improve the designs we lost track of the fact that the last page reference was not a MUST and assumed we'd always have first and last page values (the example search response documents we were using had them) and so could calculate the number of pages.

Trying to fetch all pages sequentially seems risky, since I can imagine there will be cases with many, many pages in the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ContentSearch 🔎 IIIF Content Search API
Projects
None yet
2 participants