Skip to content

Conversation

@tonytw1
Copy link
Contributor

@tonytw1 tonytw1 commented Nov 30, 2025

What does this change?

Restore the Show Preview view and fix the historic stickiness.
Then make selection mode consistent with search view.

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)

When the user pages left or right, the new image item becomes available instantly on the template.
However, the imgops optimisedImage URL is not directly available on the image item seen by the template.

The image item optimisedImage field is a template with placeholders which can be used to build a full imgops URL.
When the image item changes after a page change, the controller uses getFullScreenUri function to calculare an imgops URL
and passes it to the template on the optimisiedImage observable

To prevent the user seeing an inconsistent view of the new images description overlaid over the previous image,
the controller and template instantly hide the image using the ctrl.loading flag

The controller watches for the optimisiedImage observable to emit the updated imgops URL before releasing the ctrl.loading flag to reveal the image.

The getFullScreenUri call does not need to be debounced because it's not actually loading the optimised image;
it's only calculating the URL and is operation is probably zero cost and nearly instant.

This nearly instance return, coupled with the debounce (which would make sense if we were loading the image)
probably contributes to a race condition (which I don't fully understand)
whereby the optimisedImage observable never emits an event and the ctrl.loading flag never resets.

The updated image is never revealed and the preview screen appears to stick when paging.

To complicate the situation, the entire RxJS graph driving this is plugged into the regular polling for new images on the main Grid view
which happens every 15 seconds.

When the preview UI gets stuck it will be nudged within at least 15 seconds by this polling and will reveal the new image.

Because 10-15s has traditionally been the same order of magnitude for a particularly slow impops load, this bug has been assumed to be an imgops issue.

It is not imgops related; imgops is never actually called from the stuck page.
…select check box is clobbered by click through to single image screen.
…selects from preview.

Attach the onImageClick behaviour from results so the entire image toggles the selection when in selection mode
and the click is handled by the range selection aware code.
@tonytw1 tonytw1 force-pushed the eelpie/restore-preview-fix-blocking branch from 90bdab3 to 42eb96e Compare November 30, 2025 19:49
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