Skip to content

refactor: thumbnail rendering with Image component, focus styling, data-selected#26305

Closed
midzelis wants to merge 1 commit intomainfrom
push-utotpurmrqyo
Closed

refactor: thumbnail rendering with Image component, focus styling, data-selected#26305
midzelis wants to merge 1 commit intomainfrom
push-utotpurmrqyo

Conversation

@midzelis
Copy link
Collaborator

No description provided.

{style}
alt={loaded || errored ? altText : ''}
{title}
class={['object-cover', optionalClasses, imageClass]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is optionalClasses removed?

document.removeEventListener('pointermove', moveHandler, true);
};
});
const backgroundColorClass = $derived.by(() => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

The gray background for selected thumbnails is now gone, is this an intentional change?

Before After
Image Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unintentional - nice catch. The reason why the background is being made transparent is so that the 'AlphaBackground' for transparent images can show through. Though, it was originally an actual overlay that used z-order and a wrapping div to contain it. I didn't like the extra DOM element - so I'm just setting a solid background-color on the itself, which will draw behind the image - so I think I'll be able to revert the transparent. If not, I can make it so the background only draws when its selected. (As a backup)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm reverting the border changes, and the unintentional background change. Transparent images still have a gray (slightly different tone) behind them.

image image

<!-- Outline on focus -->
<div
class={[
'pointer-events-none absolute z-1 size-full outline-immich-primary dark:outline-immich-dark-primary group-focus-visible:rounded-lg group-focus-visible:outline-2 group-focus-visible:-outline-offset-2',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I’m not a fan of the updated focus outline. It’s thinner so less visible, and it always uses rounded corners even though the thumbnails themselves don’t.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't have time to address all your comments right now, but this change also updates the thumbnails to use rounded corners when its outlined:
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In general, I feel like all selections (outlines) need to be consistent in the app. Personally, I thought the 4px in blue was pretty ugly and didn't match the rest of the theme within the app. But, if the vote is for 4px outlines - then we should standardize on 4px focus outlines for every component on the page - including the textboxes, buttons, menus, etc.

onStart?.();
});
return () => {
destroyed = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

destroyed is never set to false again, so onLoad and onError will never fire after the src is changed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct, working as designed.

Images should only be set once. If you want to re-load an <Image> put it in a {#key}

Comment on lines +57 to +68
let optionalClasses = $derived([
[
curve && 'rounded-xl',
circle && 'rounded-full',
shadow && 'shadow-lg',
(circle || !heightStyle) && 'aspect-square',
border && 'border-3 border-immich-dark-primary/80 hover:border-immich-primary',
brokenAssetClass,
]
.filter(Boolean)
.join(' '),
brokenAssetClass,
]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let optionalClasses = $derived([
[
curve && 'rounded-xl',
circle && 'rounded-full',
shadow && 'shadow-lg',
(circle || !heightStyle) && 'aspect-square',
border && 'border-3 border-immich-dark-primary/80 hover:border-immich-primary',
brokenAssetClass,
]
.filter(Boolean)
.join(' '),
brokenAssetClass,
]);
let optionalClasses = $derived([
curve && 'rounded-xl',
circle && 'rounded-full',
shadow && 'shadow-lg',
(circle || !heightStyle) && 'aspect-square',
border && 'border-3 border-immich-dark-primary/80 hover:border-immich-primary',
brokenAssetClass,
]);

@jrasm91
Copy link
Member

jrasm91 commented Feb 18, 2026

It looks like you are changing the design and look while also refactoring. Please only do one or the other.

@midzelis midzelis closed this Feb 19, 2026
@midzelis midzelis deleted the push-utotpurmrqyo branch February 20, 2026 02:29
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