Skip to content

Conversation

uhthomas
Copy link
Collaborator

@uhthomas uhthomas commented Aug 6, 2025

Description

The height of the search results element was unrestricted, which meant that the asset visibility calculations were completely incorrect. The consequence of this is that assets which should not have been visible, were. In practical terms, all assets below the viewport were rendered when they shouldn't have been which is terrible for performance. Limiting the height of the viewport fixes that calculation and assets are correctly hidden.

The consequence of limiting the height of the viewport is that the intersector then incorrectly thought the scroll position was always at the end. This has been fixed by calculating the position of sliding window against the calculated asset layout container height.

How Has This Been Tested?

Tested locally.

Screenshots (if appropriate)

Before:

image

After:

image

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)

The height of the search results element was unrestricted, which meant that the
asset visibility calculations were completely incorrect. The consequence of
this is that assets which should not have been visible, were. In practical
terms, all assets below the viewport were rendered when they shouldn't have
been which is terrible for performance. Limiting the height of the viewport
fixes that calculation and assets are correctly hidden.

The consequence of limiting the height of the viewport is that the intersector
then incorrectly thought the scroll position was always at the end. This has
been fixed by calculating the position of sliding window against the calculated
asset layout container height.
Copy link
Contributor

github-actions bot commented Aug 6, 2025

Deploying preview environment to https://pr-20727.preview.internal.immich.cloud/

Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

LGTM. Also always happy to see (slight) complexity reductions in the timeline-related code

@alextran1502 alextran1502 merged commit 746252f into main Aug 6, 2025
52 checks passed
@alextran1502 alextran1502 deleted the fix-web-search-max-height branch August 6, 2025 22:05
@github-actions github-actions bot removed the preview label Aug 6, 2025
ollioddi pushed a commit to ollioddi/immich that referenced this pull request Aug 11, 2025
The height of the search results element was unrestricted, which meant that the
asset visibility calculations were completely incorrect. The consequence of
this is that assets which should not have been visible, were. In practical
terms, all assets below the viewport were rendered when they shouldn't have
been which is terrible for performance. Limiting the height of the viewport
fixes that calculation and assets are correctly hidden.

The consequence of limiting the height of the viewport is that the intersector
then incorrectly thought the scroll position was always at the end. This has
been fixed by calculating the position of sliding window against the calculated
asset layout container height.

Co-authored-by: Alex <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants