Skip to content
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

Display beginning of non-text files as text instead of triggering a download #15447

Merged

Conversation

SergeyYakubov
Copy link
Contributor

display the first 100K of a binary file or a file whose type is unknown to Galaxy as ASCII text instead of downloading this file.

If a user clicks on the "eye" button for a binary dataset (or a dataset with an unknown type), Galaxy downloads the whole file. This is probably not what a user wants, especially for large files. Even worse, when using an object store, the file will be fetched from that store and then sent to the web client. So, we implemented displaying a warning and first 100K as an ASCII text, which in many cases still gives an idea of what is inside the file.

image

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. Upload a binary file to Galaxy
    2. Click on the "eye" button to display the file.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@jdavcs
Copy link
Member

jdavcs commented Jun 20, 2023

The test failures were, likely, relevant (can't verify as logs have expired). Also, there's a conflict that needs to be resolved.
Bumping to 23.2 for now. We can re-tag it with 23.1, if needed, if these are resolved tomorrow.

@jdavcs jdavcs modified the milestones: 23.1, 23.2 Jun 20, 2023
@jdavcs
Copy link
Member

jdavcs commented Jun 20, 2023

Thank you for addressing these!
Can you, please, do a rebase instead of a merge? That way we get a clean commit history. I'm happy to help if needed (feel free to ping me).

@SergeyYakubov
Copy link
Contributor Author

Thank you for addressing these! Can you, please, do a rebase instead of a merge? That way we get a clean commit history. I'm happy to help if needed (feel free to ping me).

I tried to rebase first, but I got much more conflicts this way :(. Apparently, merge and rebase use different algorithms. But if you know how to rebase without conflicts, please let me know.

@jdavcs
Copy link
Member

jdavcs commented Jun 20, 2023

I tried to rebase first, but I got much more conflicts this way ...

I've looked at it; there is one conflict, which seems not too complicated, unless I'm missing something. Still, I'd verify that your logic is still intact and all works as expected after the conflict is fixed. I'll post the specific steps for fixing it to the dev channel.

display the first 100K of a binary file or a file whose type is unknown to Galaxy
as ASCII text instead of downloading this file.
Copy link
Member

@jdavcs jdavcs left a comment

Choose a reason for hiding this comment

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

Thank you, @SergeyYakubov, this should be quite useful!

@jdavcs jdavcs merged commit 77265db into galaxyproject:dev Jul 10, 2023
@galaxyproject galaxyproject deleted a comment from github-actions bot Jul 10, 2023
@martenson
Copy link
Member

This is great, thanks @SergeyYakubov !

@mvdbeek mvdbeek changed the title implement display function for all datatypes Display the first 100K of non-text files as ASCII text instead of triggering a download Jan 10, 2024
@mvdbeek mvdbeek changed the title Display the first 100K of non-text files as ASCII text instead of triggering a download Display beginning of non-text files as text instead of triggering a download Jan 10, 2024
@jdavcs jdavcs added the highlight/power-user Included at bottom of user-facing release notes (please use either this or highlight, but not both) label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datatypes area/UI-UX highlight/power-user Included at bottom of user-facing release notes (please use either this or highlight, but not both) kind/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants