fix: guard tauri runtime and non-git folders#20
Merged
jmaxdev merged 6 commits intoTrixtyAI:mainfrom Apr 19, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR prevents crashes and repeated console noise when the desktop UI is executed outside the Tauri runtime (e.g., in a browser during dev) and when the Git Explorer is pointed at a non-git folder.
Changes:
- Added
isTauri()guards and alocalStoragefallback fortrixtyStoreto avoid plugin-store initialization crashes outside Tauri. - Switched
OnboardingWizardwindow APIs to dynamic imports gated byisTauri()and only render native window controls when running in a native window. - Made Git status polling quiet for “not a git repository”/“work tree” errors and ensured git UI state is reset when leaving a repo.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/desktop/src/components/OnboardingWizard.tsx | Guard Tauri window APIs via isTauri() + dynamic import; hide native window buttons outside Tauri |
| apps/desktop/src/api/store.ts | Add isTauri() guard and localStorage fallback for get/set/delete to avoid browser crashes |
| apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx | Silence expected git-status errors for non-repos and clear stale git UI state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
done |
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
Fixes tres crashes/noise que aparecen cuando el bundle corre fuera del runtime de Tauri y cuando se abre una carpeta que no es repo git:
apps/desktop/src/api/store.ts: agrego guarda conisTauri()y fallback alocalStorageparaget/set/delete. Antes caía conCannot read properties of undefined (reading 'invoke')al inicializar el store fuera del contexto de Tauri.apps/desktop/src/components/OnboardingWizard.tsx: paso el import de@tauri-apps/api/windowa dinámico y lo gatillo conisTauri(), replicando el patrón deTitleBar.tsx. Los botones de ventana (minimize/maximize/close) solo se renderizan cuando está corriendo nativo.apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx: llamo aget_git_statuscon{ silent: true }, trato "not a git repository" y "must be run in a work tree" como estados esperados, y reseteostagedChanges/gitChanges/branches/currentBranchcuando no es repo (antes quedaba data stale al cambiar de carpeta). Se preserva el flujo existente dedubious ownership.Issues