-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Content] Improve image thumbnails #3224
base: dev
Are you sure you want to change the base?
Conversation
}; | ||
const isFileZUID = !!params.value?.startsWith("3-"); | ||
|
||
const { data, isFetching } = useGetFileQuery(params.value, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? this will impact performance and this table is already very heavy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without fetching the media zuid's details, I can't get the need parameters to properly render the FileTypePreview
. In this case, the filename, also I'm not sure if passing in the media-resolver as src would work fine with that component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is the filename used in this experience? Shown on hover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shrunyan it's used to determine whether or not the thumbnail is going to render an image or check what file type icon will be rendered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@finnar-bin I see. Can we set up some time to run this locally and check performance dev tool tab to ensure we see no severe impacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agalin920 yeah I agree. Sure, do you have any specific time in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I just realized, I could probably just do a find
on all media assets instead of doing an api call to get this data, since we're already fetching all media on app load.
I'll update the PR first to make that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@agalin920 I have updated it to use the cached data from useGetAllBinFilesQuery
which is ran on app load. This way the api call is only done once and the ImageCell component only needs to do a .find
to get the File data that it needs
Show the appropriate thumbnail for non-image files
Resolves #3206