onlook
onlook copied to clipboard
fix: render image files correctly in dev tab instead of showing random string
Description
This PR fixes an issue where opening an image file in the dev tab displayed a random string instead of rendering the image preview.
Changes
- Detects image file types and renders them as images in the UI
- Ensures non-image files continue to display as code
Related Issues
Type of Change
- [x] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Release
- [ ] Refactor
- [ ] Other (please describe):
Testing
Screenshots (if applicable)
Additional Notes
[!IMPORTANT] Fixes image rendering in dev tab by detecting and rendering image files correctly.
- Behavior:
- Fixes image rendering in
DevTabinindex.tsxby detecting image file types and rendering them as images.- Non-image files continue to display as code.
- Functions:
- Adds
getFileUrl()andgetMimeType()inindex.tsxto handle image rendering.- Updates
openFile()inindex.tsto detect binary files and convert them to base64.- Constants:
- Adds
BINARY_EXTENSIONStofiles.tsfor image file type detection.This description was created by
for c5357d9f4974c6bba950d7667ed2cd813d4eff60. You can customize this summary. It will automatically update as commits are pushed.