Skip to content

refactor: thumbnail components#26379

Merged
jrasm91 merged 1 commit intomainfrom
push-zxvnukqrtruv
Feb 23, 2026
Merged

refactor: thumbnail components#26379
jrasm91 merged 1 commit intomainfrom
push-zxvnukqrtruv

Conversation

@midzelis
Copy link
Collaborator

@midzelis midzelis commented Feb 19, 2026

Split thumbnail specific portion from #26305 26305

Before: (Showing broken images)
image

After: (Broken images)
image

Here is it with unbroken images
image

Key things to notice:

  • when an image is selected, it has rounded corners. Previously the outline was squared. Now, for selected images with round corners, the outline matches.
  • The broken asset text is not loaded on top of the thumbnail.


let { src, onStart, onLoad, onError, ref = $bindable(), ...rest }: Props = $props();

let capturedSource: string | undefined = $state();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@michelheusschen Hopefully the variable naming now makes it more clear that we only intend to operate on a single non-undefined src value. If you want this to call listeners and update multiple times based on updates to the src prop - surround this with a {#key} - or just use native <img>

src={url}
onLoad={setLoaded}
onError={setErrored}
class={['object-cover bg-gray-300 dark:bg-gray-700', optionalClasses, imageClass]}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This bg-gray-300 dark:bg-gray-700 only shows up when the image itself has a transparent background.

@midzelis midzelis force-pushed the push-zxvnukqrtruv branch 2 times, most recently from 46f88ba to 5578718 Compare February 20, 2026 01:49
@midzelis midzelis marked this pull request as draft February 20, 2026 02:15
@midzelis midzelis changed the base branch from main to face_flakiness February 20, 2026 02:59
@midzelis midzelis force-pushed the push-zxvnukqrtruv branch 5 times, most recently from 80d88a5 to 4bdd917 Compare February 20, 2026 13:56
Base automatically changed from face_flakiness to main February 20, 2026 14:23
@midzelis midzelis force-pushed the push-zxvnukqrtruv branch 3 times, most recently from c039995 to e458154 Compare February 21, 2026 20:55
@github-actions
Copy link
Contributor

github-actions bot commented Feb 21, 2026

Preview environment has been removed.

@midzelis midzelis marked this pull request as ready for review February 21, 2026 21:07
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.

I need to go through the class changes again and also actually test it. This PR seems well-contained though

</script>

{#if capturedSource}
{#key capturedSource}
Copy link
Member

Choose a reason for hiding this comment

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

You don't need the #key here, do you? It'll only re-render the img which will update/re-render anyways

@jrasm91 jrasm91 merged commit 60dafec into main Feb 23, 2026
54 checks passed
@jrasm91 jrasm91 deleted the push-zxvnukqrtruv branch February 23, 2026 16:56
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