Skip to content

Post PR4475 fixes for Free to use only check box#4651

Draft
tonytw1 wants to merge 1 commit intoguardian:mainfrom
eelpie:eelpie/post-4475-fixes
Draft

Post PR4475 fixes for Free to use only check box#4651
tonytw1 wants to merge 1 commit intoguardian:mainfrom
eelpie:eelpie/post-4475-fixes

Conversation

@tonytw1
Copy link
Contributor

@tonytw1 tonytw1 commented Mar 3, 2026

After rebasing up to this point, we found the behaviour of the Free to use only check box regressed.
Screenshot 2026-03-03 at 21 36 58

Disclaimer; we are forked quite away from the main Grid so this may not reflect want happens in the main branch.
Provided FYI.

Back to search

With Free to use only checked,
clicking into an image then
click Back to search the Free to use only check box has lost it's state:

back-to-search.mov

Free to use only should have kept it's checked state

Logo click

With Free to use only checked and none of the other check boxes.
clicking on the Grid logo
Free to use only remains checked
and the next click to any of the check boxes is broken.

logo-click.mov

Free to use only should have reset to empty.
The other checkboxes should have worked as normal on the next click.

What does this change?

How should a reviewer test this change?

How can success be measured?

Who should look at this?

Tested? Documented?

  • locally by committer
  • locally by Guardian reviewer
  • on the Guardian's TEST environment
  • relevant documentation added or amended (if needed)

Fixes Free to use only check-box is cleared on Back to search
Fixes Free to use only check-box sticks on icon click.
let showPaid = newFilter.nonFree ? newFilter.nonFree : false;
if (sender && sender == "filterChange" && !newFilter.nonFree) {
showPaid = ctrl.user.permissions.showPaid;
if (ctrl.usePermissionsFilter) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the feature switch to bypass this new block restored the Back to search behaviour.


ctrl.sortProps = {
onSortSelect: updateSortChips,
onSelect: updateSortChips,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using bi-section,
reverting this line restored the logo click behaviour.

No idea why this is effective.
It could be something todo with the path into watchSearchChange been somehow bound to the state of the sort control?

@tonytw1
Copy link
Contributor Author

tonytw1 commented Mar 6, 2026

Breaks the sort by dropdown =(

@tonytw1
Copy link
Contributor Author

tonytw1 commented Mar 6, 2026

The way this fix for the checkbox breaks the sort drop down is interesting.

Removing the window.addEventListener("logoClick", handleLogoClick) listener on gr-sort-control.tsx restores the sort by drop drop and keeps the checkboxes fix.

The icon stays highlighted after click remains.

Something about the gr-sort-control.tsx interaction with the logo click event?

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.

1 participant