Add file size column to workfiles in launcher #1898
Conversation
|
Resizing column is in pending. |
There was a problem hiding this comment.
Pull request overview
Adds workfile file-size metadata to the Launcher “Workfiles” listing so artists can spot empty/corrupt files before opening them.
Changes:
- Extend
WorkfileItemwith an optionalfile_sizefield. - Populate
file_sizein the launcher backend model when the workfile exists on disk. - Add a new “Size” column in the workfiles UI model and display formatted sizes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
client/ayon_core/tools/launcher/ui/workfiles_page.py |
Adds a 3rd column (“Size”), stores FILE_SIZE_ROLE, formats size for display, and exposes it through the model. |
client/ayon_core/tools/launcher/models/workfiles.py |
Computes file size from disk for existing workfiles and passes it into WorkfileItem. |
client/ayon_core/tools/launcher/abstract.py |
Extends WorkfileItem dataclass with optional file_size. |
Comments suppressed due to low confidence (1)
client/ayon_core/tools/launcher/ui/workfiles_page.py:266
- Size values are formatted to strings for
DisplayRole, so sorting the "Size" column will be lexicographic (e.g. "900.0 KB" > "1.0 MB"). Add a numeric comparison for column 2 usingFILE_SIZE_ROLEin the proxy'slessThanso sort works as expected.
class WorkfileSortFilterProxy(QtCore.QSortFilterProxyModel):
def lessThan(self, source_left, source_right):
l_host = source_left.data(HOST_NAME_ROLE)
r_host = source_right.data(HOST_NAME_ROLE)
if l_host != r_host:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BigRoy
left a comment
There was a problem hiding this comment.
Can we also make sure that by default there's no horizontal scrollbar - so we'll need to pick some decent default widths? Or trigger resize to fit contents for the columns whenever we switch - but not sure that's entirely nice 🤔
…egate and now model returns raw size for size column this helps for sorting too
|
…roper data handling upon feedback
…-and-size-in-the-launcher
moonyuet
left a comment
There was a problem hiding this comment.
Does testing with the launcher, working as expected. Please take a look at review and do the code changes so that we can possibly merge this PR. Thanks
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
…which copied from workfiles tool
…o that can also used in files_widget_published.py - Removed duplication of file_size_to_string from side_panel.py and used one from delegates - applied jakub suggestion in workfiles_page.py - changed font size to 10.5 in launcher_style.css
Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com>
…-and-size-in-the-launcher
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
…-and-size-in-the-launcher
|
I think we can merge it. Unless we want to keep Will leave up to @iLLiCiTiT |

Changelog Description
The Launcher currently shows no file metadata such as timestamp or file size. Could you please add file size and last modified timestamp allowing artists to quickly spot zero-size or potentially corrupt files before wasting time attempting to open them?
Additional info
last modified column is already there now implemented other column where includes workfile size
Testing notes: