Skip to content

feat: complete git system in source control panel#48

Merged
jmaxdev merged 2 commits intoTrixtyAI:mainfrom
matiaspalmac:feat/git-system
Apr 19, 2026
Merged

feat: complete git system in source control panel#48
jmaxdev merged 2 commits intoTrixtyAI:mainfrom
matiaspalmac:feat/git-system

Conversation

@matiaspalmac
Copy link
Copy Markdown
Contributor

Chages

Branches

  • Wire checkout on the branch dropdown and wire the existing + to create branches via git switch -c.
  • Inline merge button per branch with confirmation, using git merge --no-edit.
  • Filter input in the dropdown when there are more than 6 branches.
  • Detached HEAD pill badge (no SHA resolution — the label covers the case).

Remote

  • Pull (with rebase option) and Fetch as icon buttons in the panel header.
  • Push auto-falls back to --set-upstream origin <branch> on the first push of a new branch.

Commit

  • Amend last commit via a dropdown attached to the Commit button (split-button).
  • Larger, resizable commit textarea.
  • Commit disabled while there are unresolved merge conflicts, with a red conflict banner.

History

  • Collapsible history section (last 30 commits, with "Load more" for +30).
  • Per-commit actions: reset --soft, reset --mixed (confirmed), reset --hard (confirmed), revert (confirmed).
  • Localized relative time labels (EN/ES).

Stash

  • Collapsible stash section.
  • Save with optional message; per-entry pop / apply / drop (drop confirmed).

Files

  • Click a staged / unstaged file to open a diff viewer with syntax-colored + / - / @@ lines.
  • Discard (git restore) an unstaged change, with confirmation.

Polish / hardening

  • Normalizes the get_git_branches payload so a non-array shape no longer crashes the panel (branches.map is not a function).
  • 5s poll skips while a user-triggered operation is in flight to avoid races.
  • Feedback toast timeout is cleared on unmount.
  • New Rust commands validate branch names where applicable (reusing upstream's validate_branch_name).

Out of scope (can be separate issues if needed):

  • Branch deletion.
  • Resolving detached HEAD to a commit/tag via git rev-parse --short HEAD — the explicit label covers the case.

Issues

Copilot AI review requested due to automatic review settings April 19, 2026 09:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Completes the built-in Source Control panel’s Git feature set by adding common remote, history, stash, branch, and file-diff operations, plus backend Tauri commands to execute them safely.

Changes:

  • Added new Tauri invoke typings + UI wiring for pull/fetch, merge, reset/revert, stash, per-file diff viewing, discard, and commit amend.
  • Implemented history/stash sections with localized relative-time labels and new confirmation prompts/toasts.
  • Extended the Rust Tauri backend with the required git_* commands and push “set upstream” fallback.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
apps/desktop/src/api/tauri.ts Adds TS types and command map entries for new Git Tauri commands (log/stash/diff/etc.) and git_commit amend option.
apps/desktop/src/api/builtin.l10n.ts Adds EN/ES translations for the new Git UI actions, confirmations, sections, and relative time units.
apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Implements the expanded Git UI (pull/fetch, merge, stash, history actions, diff modal, conflict banner, polling guard).
apps/desktop/src-tauri/src/lib.rs Adds/updates Rust Tauri commands to run Git operations (pull/fetch/log/merge/reset/revert/stash/restore/file diff) and push upstream fallback logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop/src-tauri/src/lib.rs
Comment thread apps/desktop/src/addons/builtin.git-explorer/GitExplorerComponent.tsx Outdated
Comment thread apps/desktop/src/api/builtin.l10n.ts Outdated
Comment thread apps/desktop/src-tauri/src/lib.rs Outdated
Comment thread apps/desktop/src-tauri/src/lib.rs
- git_revert / git_reset: reject empty or leading '-' args (option injection)
- get_git_file_diff: return stderr on non-zero exit
- handleDiscard: wrap in setGitLoading for polling guard consistency
- stash entries: render localized pop/apply labels
- commit options toggle: localized aria-label, aria-haspopup/expanded, disabled with commit button conditions
- l10n ES: fix "Resolvelos" -> "Resuélvelos"
@jmaxdev jmaxdev merged commit b3a0203 into TrixtyAI:main Apr 19, 2026
4 checks passed
@matiaspalmac matiaspalmac deleted the feat/git-system branch April 20, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Complete git system in Source Control panel [Bug]: Source control panel crashes with "branches.map is not a function"

3 participants