Currently when loading facets for a page facets are calculated for the set number of records but only 5 are pushed to the html. Click the "Show more" link on any facet group requires performing the whole search again. If I am right, the heavy work is pulling facets from the records, so I say, why not push all the facets to the page and make them collapsible to save space?
Created attachment 40339 [details] [review] Bug 14419 - Expanding facets (Show more) performs a new search This is a proof of concept patch, it is for discussion/demonstration and only affects the OPAC. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Tell me to make this a valid patch or do so yourself :-)
Nick, That's a good idea. Todo: 1/ "Show more" is no longer a link 2/ If expanded, the link should not be "show more" :) 3/ Should be done at the intranet too
Created attachment 40425 [details] [review] Bug 14419 - Expanding facets (Show more) performs a new search This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page. Updated tests included. Whitespace patches still needed. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Repeat for staff client 10 - Prove t/Search.t NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet. Ending punctuation seems to confuse the matcher, I'll fix it if I figure it out, but I didn't cause it.
After I apply this patch I can't click 'Show More' at all.
*** Bug 11326 has been marked as a duplicate of this bug. ***
Possibly related to this? We find in some searches the "Show more" does not appear at all when there should be more than 5 facets. Cannot see a pattern to when the "Show more" is missing. (Koha ver 3.22)
See possibly related Bug 16821. 'Show more' may be missing if loading facets is restricted to only first page of results
Is this the same as Bug 22903 ?
Created attachment 91185 [details] [review] Bug 14419: Expanding facets (Show more) performs a new search This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page. Updated tests included. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Repeat for staff client 10 - Prove t/Search.t NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet. Ending punctuation seems to confuse the matcher.
(In reply to Fridolin SOMERS from comment #8) > Is this the same as Bug 22903 ? Yes, it does seem to be. Also this supersedes the need for 22924 We will need to decide which one we want.
Created attachment 91234 [details] [review] Bug 14419: Expanding facets (Show more) performs a new search This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page. Updated tests included. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Repeat for staff client 10 - Prove t/Search.t NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet. Ending punctuation seems to confuse the matcher. Signed-off-by: Michal Denar <black23@gmail.com>
Created attachment 91241 [details] [review] Bug 14419: Expanding facets (Show more) performs a new search This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page. Updated tests included. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Repeat for staff client 10 - Prove t/Search.t NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet. Ending punctuation seems to confuse the matcher. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Created attachment 91242 [details] [review] Bug 14419: (QA follow-up) Restore the link styling Test plan: Look at Show more/less links in facets, in opac and staff client --> without this patch they are pure text, no styling, no hand cursor --> with this patch it is link, but continues to work as before Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Nice work! Pushed to master for 19.11.00
*** Bug 22924 has been marked as a duplicate of this bug. ***
*** Bug 22903 has been marked as a duplicate of this bug. ***
This is a rather big patch, and is more an enhancement. I'll wait a bit to see if bugs are found before considering backport.
Created attachment 96355 [details] [review] Bug 14419: [19.05.x] (squashed) Expanding facets (Show more) performs a new search This patch removes the constraint of only passing 5 facets to the template unless the list is expanded, in fact, it removes the 'expanded' attribute from Search.pm Now that all facets are passed to page it adds a 'show more' link at the bottom of lists and allows user to expand or collapse any facet set without reloading page. Updated tests included. To test: 1 - Perform an OPAC search that returns more than 5 of any given facet type 2 - Click the "Show more" link on the facets and see that the search is reloaded 3 - Apply patch 4 - Repeat search 5 - Note that you can click "Show more" without reloading page 6 - Test that page load is not greatly affected 7 - Ensure that all facet links function normally 8 - Ensure that facets are the same a prior to patch 9 - Repeat for staff client 10 - Prove t/Search.t NOTE: This patch makes it much easier to see that there is an existing issue with marking the "active" facet. Ending punctuation seems to confuse the matcher. Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Bug 14419: (QA follow-up) Restore the link styling Test plan: Look at Show more/less links in facets, in opac and staff client --> without this patch they are pure text, no styling, no hand cursor --> with this patch it is link, but continues to work as before Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
backported the 19.05.x patchset for 19.05.07