feat: improve binary file handling#33
Merged
jmaxdev merged 3 commits intoTrixtyAI:mainfrom Apr 19, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dedicated “binary” tab type so binary/unsupported-encoding files render a centered placeholder message instead of being shown inside Monaco as sentinel text.
Changes:
- Extend
FileState.type/openFileto support a new"binary"file type. - Render a centered translated placeholder in
EditorAreafor"binary"tabs (skips Monaco). - Open files as
"binary"on UTF-8 decode failures and updateeditor.bin_filetranslations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| apps/desktop/src/context/AppContext.tsx | Adds "binary" to the file/tab type union used throughout the app. |
| apps/desktop/src/components/EditorArea.tsx | Renders a centered placeholder for binary tabs instead of mounting Monaco. |
| apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx | Opens binary tabs on UTF-8 decode failures when reading files. |
| apps/desktop/src/api/builtin.l10n.ts | Updates EN/ES editor.bin_file text to a full descriptive sentence. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5d0fd1d to
ccd05f0
Compare
jmaxdev
approved these changes
Apr 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Bundles two related improvements for how the app handles non-UTF-8 / binary files clicked from the explorer.
1. Quieter error path (supersedes #31).
read_fileis now called with{ silent: true }, and the caller distinguishes the expected UTF-8 decoding error from real failures:"binary"type (see below).console.errorfrom the caller so real failures stay visible instead of being swallowed.Previously
safeInvokelogged[Tauri Invoke Error] read_file: "stream did not contain valid UTF-8"for every binary-file click even though the flow was handled correctly — just noise.2. Descriptive placeholder view. Instead of rendering
--- BINARY ---as literal text inside Monaco (with cursor, minimap, line numbers), binary files now show a centered message in the editor area — same UX pattern as VS Code.apps/desktop/src/context/AppContext.tsx: extendsFileState.typeandopenFileto accept"binary"alongside"file"and"virtual".apps/desktop/src/components/EditorArea.tsx: adds anisBinaryTabbranch that renders a centered placeholder, skipping Monaco entirely.apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx: silencesread_file, routes UTF-8 errors to a"binary"tab, logs everything else.apps/desktop/src/api/builtin.l10n.ts: rewriteseditor.bin_fileinenandesto a full-sentence, VS-Code-style message.Net: 4 files, small additions.
Issues