fix: surface git diff and search-click errors instead of swallowing them#50
Merged
jmaxdev merged 2 commits intoTrixtyAI:mainfrom Apr 19, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes two silent-failure paths in the desktop Git Explorer so real underlying errors (git command failures and stale search result clicks) are surfaced instead of being mistaken for “no diff” / “nothing happened,” addressing issue #49.
Changes:
- Update the Tauri
get_git_diffcommand to returnstderron non-zero exit status (instead of always returningstdout). - Update
handleSearchClickto logread_fileerrors instead of swallowing them with an empty catch.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx | Stops swallowing read_file errors on search-result click, improving diagnosability. |
| apps/desktop/src-tauri/src/lib.rs | Aligns get_git_diff error handling with other git_* commands by checking output.status.success(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- get_git_diff: return stderr on non-zero exit, matching the pattern used by the other git_* commands - handleSearchClick: log read_file failures to the console instead of silently swallowing them, consistent with handleSearch
safeInvoke already logs Tauri invoke errors to the console when silent is not set, so the local catch was duplicating the trace. Pass silent: true and log once from the handler with the file_path for context.
036144a to
52ec47a
Compare
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.
Chages
get_git_diffnow checksstatus.success()stderrinstead of an emptystdout, matching the pattern already used by every othergit_*command inlib.rs.handleSearchClicklogsread_fileerrors instead of an emptycatch {}catch (e) { console.error(e); }, consistent with the siblinghandleSearch.No behavior change on the happy path; this only affects the error branches.
Issues