When browser-side search result resorting (search.jsresort=true) is enabled, the ranking buttons ("Context Ranking" and "Sort by Date") can become out of sync with the current search mode.
The sidebar is periodically refreshed by yacysort.js using yacysearchtrailer.html, but the request does not preserve all of the search state. As a result, the active ranking button may be incorrect, and repeated use of "Sort by Date" can also lead to inconsistent /date handling.
Steps to reproduce
Enable search.jsresort=true.
Perform a search.
Click Sort by Date.
Wait for the JavaScript sidebar refresh or perform another search.
Observe the ranking buttons.
Expected behaviour
The active ranking button should always reflect the current search mode.
Switching between Context Ranking and Sort by Date should be consistent.
/date should only appear once in the search query.
Actual behaviour
The ranking buttons can display the wrong active state after the sidebar refresh.
Search state is not always preserved during the JavaScript update.
The query may become inconsistent when repeatedly switching ranking modes.
Possible cause
yacysort.js periodically refreshes yacysearchtrailer.html, but does not preserve the complete ranking state when requesting the updated trailer. This can cause yacysearchtrailer.java to rebuild the ranking controls using incomplete request parameters rather than the current search state.
Patch
yacysort.js
When browser-side search result resorting (search.jsresort=true) is enabled, the ranking buttons ("Context Ranking" and "Sort by Date") can become out of sync with the current search mode.
The sidebar is periodically refreshed by yacysort.js using yacysearchtrailer.html, but the request does not preserve all of the search state. As a result, the active ranking button may be incorrect, and repeated use of "Sort by Date" can also lead to inconsistent /date handling.
Steps to reproduce
Enable search.jsresort=true.
Perform a search.
Click Sort by Date.
Wait for the JavaScript sidebar refresh or perform another search.
Observe the ranking buttons.
Expected behaviour
The active ranking button should always reflect the current search mode.
Switching between Context Ranking and Sort by Date should be consistent.
/date should only appear once in the search query.
Actual behaviour
The ranking buttons can display the wrong active state after the sidebar refresh.
Search state is not always preserved during the JavaScript update.
The query may become inconsistent when repeatedly switching ranking modes.
Possible cause
yacysort.js periodically refreshes yacysearchtrailer.html, but does not preserve the complete ranking state when requesting the updated trailer. This can cause yacysearchtrailer.java to rebuild the ranking controls using incomplete request parameters rather than the current search state.
Patch
yacysort.js