gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

feat: Parse & display binary files

Open Zamoca42 opened this issue 1 year ago • 2 comments

Hi team! I’m happy to continue working on this task. I implemented binary file parsing in the backend and continued working on #4852 to view the results.

#4852 had too many changes to apply, making rebase burdensome, so I applied those changes in this PR.

ā˜•ļø Reasoning

The current implementation doesn't provide image previews and file sizes for binary files, especially image files.

In this PR, I implemented the parsing of binary files from read_file_from_workspace to display the size and image files in the fileDiff component.

🧢 Changes

  • Add size display for binary files in the fileDiff component.
  • Add image file preview in the fileDiff component.
  • Implemented binary file parsing in read_file_from_workspace.

Preview

https://github.com/user-attachments/assets/362548a6-6a6f-440f-9058-73a55e8d5e6f

šŸŽ« Affected issues

Fixes: #2752 Fixes: #3093 Fixes: #4957 Closes: #4852

Zamoca42 avatar Oct 10 '24 10:10 Zamoca42

@Zamoca42 is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Oct 10 '24 10:10 vercel[bot]

Thanks so much for picking this up and bringing it all together. I'd love to see this PR merged.

@estib-vega, maybe this PR would be interesting for you to review as it spans frontend and backend, and particularly in the frontend I think you'd do a much better job than me.

Byron avatar Oct 10 '24 14:10 Byron

Thank you for the thoughtful work on #5111. Building on that, I was able to modify read_file_from_workspace to check status_file and successfully read untracked binary files.

Preview

https://github.com/user-attachments/assets/f29bb6a3-0c3a-449b-9d53-ae71cf76996f

Zamoca42 avatar Oct 14 '24 18:10 Zamoca42

Thanks for taking a look. I plan to review/fixup and will merge when done. Should get to it ~~till lunch~~ today.

Byron avatar Oct 16 '24 08:10 Byron

Since I am very delayed here, let's merge, if there are fixes I'd like to make I will open a new PR for that.

Byron avatar Oct 16 '24 09:10 Byron