This update introduces comprehensive language support (English/German) across the application, enabling localization for UI elements and settings dialogs. It also adds a dedicated Help Overlay component with detailed guides on using Gitty's core Git features.
- Adds language selection to App Settings
- Implements German translations in key areas
- Introduces global help documentation accessible via Ctrl+/
import {getCurrentWindow} from "@tauri-apps/api/window";
import {CloudDownload,Download,FolderOpen,GitBranch,GitCompare,History,ListRestart,LoaderCircle,Minus,RefreshCw,Search,Settings,Upload,X} from "@lucide/svelte";
import {CircleHelp,CloudDownload,Download,FolderOpen,GitBranch,GitCompare,History,ListRestart,LoaderCircle,Minus,RefreshCw,Search,Settings,Upload,X} from "@lucide/svelte";
import iconUrl from "../../src-tauri/icons/icon.png";
export let branch: string = "";
@@ -24,7 +24,9 @@
export let onReflog: () => void = () => {};
export let onOpenInExplorer: () => void = () => {};
export let onToggleAutoRefresh: () => void = () => {};
export let onOpenHelp: () => void = () => {};
export let onOpenSettings: () => void = () => {};
export let language: "en" | "de" = "en";
let win: ReturnType<typeofgetCurrentWindow> | null = null;
description: "Repository öffnen, Oberfläche verstehen und den ersten Commit erstellen.",
sections: [
{
id: "start-workflow",
title: "Dein erster Gitty-Workflow",
summary: "Vom Repository bis zum veröffentlichten Commit in fünf klaren Schritten.",
steps: [
"Öffne ein vorhandenes Repository oder klone ein Projekt über die Repository-Verwaltung.",
"Bearbeite deine Dateien. Gitty zeigt Änderungen im Arbeitsverzeichnis automatisch an.",
"Prüfe den Diff und stage einzelne Dateien, Zeilen oder alle passenden Änderungen.",
"Schreibe eine aussagekräftige Commit-Nachricht und erstelle den Commit.",
"Nutze Fetch, Pull und Push, um deinen Stand mit dem Remote-Repository abzugleichen.",
],
},
{
id: "start-layout",
title: "Die Oberfläche im Überblick",
summary: "Links findest du Branches, Stashes und Dateien. In der Mitte prüfst und commitest du Änderungen; rechts siehst du Verlauf und Dateihistorie.",
note: "Fast alle Bereiche lassen sich über die Trennlinien in der Größe anpassen oder über ihren Kopf einklappen.",
},
{
id: "start-safety",
title: "Sicher arbeiten",
summary: "Prüfe vor Commit, Pull, Rebase oder Verwerfen immer den aktuellen Branch und die betroffenen Dateien. Gitty fragt bei destruktiven Aktionen nochmals nach.",
},
],
},
{
id: "app",
label: "Arbeiten mit Gitty",
description: "Die wichtigsten Funktionen der App Schritt für Schritt.",
sections: [
{
id: "app-changes",
title: "Änderungen prüfen und stagen",
summary: "Wähle eine geänderte Datei, lies den Diff und verschiebe gezielt Änderungen in den Staging-Bereich.",
steps: [
"Unstaged enthält noch nicht vorbereitete Änderungen; Staged enthält den nächsten Commit-Inhalt.",
"Öffne eine Datei, um hinzugefügte und entfernte Zeilen zu prüfen.",
"Stage ganze Dateien oder nutze die Zeilen-/Hunk-Aktionen für kleinere, saubere Commits.",
"Verwerfen entfernt lokale Änderungen. Diese Aktion lässt sich nicht immer rückgängig machen.",
],
},
{
id: "app-history",
title: "Verlauf, Suche und Vergleich",
summary: "Der Commit-Verlauf zeigt Branches und Merges. Mit der globalen Suche findest du die Einführung von Code oder den Verlauf einer Datei.",
steps: [
"Klappe einen Commit auf, um seine Dateien zu sehen.",
"Vergleiche zwei Commits über Compare in der Titelleiste.",
"Nutze Reflog, um auch verschobene oder nicht mehr sichtbare Referenzen wiederzufinden.",
],
},
{
id: "app-stash",
title: "Zwischenstände mit Stash sichern",
summary: "Ein Stash parkt unvollständige Änderungen, ohne einen Commit zu erzeugen. Apply behält den Stash, Pop wendet ihn an und entfernt ihn.",
},
],
},
{
id: "basics",
label: "Git-Grundlagen",
description: "Alltägliche Befehle für Status, Änderungen, Commits und Wiederherstellung.",
sections: [
{
id: "basics-inspect",
title: "Repository prüfen",
summary: "Diese Befehle verändern nichts und eignen sich immer als erster Blick auf den aktuellen Zustand.",
commands: [
{command:"git status",description:"Arbeitsverzeichnis und Staging-Bereich anzeigen"},
{command:"git diff",description:"Noch nicht gestagte Änderungen anzeigen"},
{command:"git diff --staged",description:"Inhalt des nächsten Commits anzeigen"},
{command:"git log --oneline --graph --decorate --all",description:"Kompakten Branch- und Commit-Verlauf anzeigen"},
],
},
{
id: "basics-commit",
title: "Änderungen speichern",
summary: "Stage nur zusammengehörige Änderungen und beschreibe im Commit, warum die Änderung nötig ist.",
commands: [
{command:"git add <datei>",description:"Eine Datei für den Commit vormerken"},
{command:"git add -p",description:"Änderungen interaktiv und abschnittsweise stagen"},
{command:"git commit --amend",description:"Den letzten lokalen Commit ergänzen oder umbenennen"},
],
},
{
id: "basics-undo",
title: "Änderungen rückgängig machen",
summary: "Restore arbeitet am Arbeitsverzeichnis oder Staging-Bereich; Revert erzeugt einen neuen Gegen-Commit und ist für veröffentlichte Historie sicherer.",
commands: [
{command:"git restore <datei>",description:"Lokale, noch nicht gestagte Änderung verwerfen"},
{command:"git restore --staged <datei>",description:"Datei aus dem Staging-Bereich entfernen"},
{command:"git revert <commit>",description:"Wirkung eines Commits durch neuen Commit umkehren"},
],
note: "Vorsicht: git reset --hard verwirft lokale Änderungen. Verwende den Befehl nur, wenn du den Verlust bewusst akzeptierst.",
},
],
},
{
id: "branches",
label: "Branches & Merges",
description: "Parallele Arbeit organisieren, zusammenführen und aufräumen.",
sections: [
{
id: "branches-manage",
title: "Branches verwalten",
summary: "Ein Branch ist ein beweglicher Zeiger auf eine Commit-Linie. Erstelle für jede getrennte Aufgabe einen eigenen Branch.",
commands: [
{command:"git switch -c feature/meine-aenderung",description:"Neuen Branch erstellen und wechseln"},
{command:"git switch main",description:"Zu einem vorhandenen Branch wechseln"},
{command:"git branch -vv",description:"Lokale Branches mit Upstream-Status anzeigen"},
summary: "Ahead bedeutet: lokale Commits wurden noch nicht gepusht. Behind bedeutet: im Remote liegen neue Commits, die lokal fehlen. Beides gleichzeitig weist auf auseinanderlaufende Historien hin.",
},
],
},
{
id: "troubleshooting",
label: "Probleme lösen",
description: "Konflikte, verlorene Commits und typische Fehlermeldungen verstehen.",
sections: [
{
id: "trouble-conflicts",
title: "Merge-Konflikte lösen",
summary: "Ein Konflikt entsteht, wenn Git Änderungen nicht eindeutig kombinieren kann. Gitty bietet dafür einen eigenen Resolve-Dialog.",
steps: [
"Öffne jede Konfliktdatei und vergleiche Current, Incoming und das kombinierte Ergebnis.",
"Übernimm eine Seite oder bearbeite den Zielinhalt manuell.",
"Markiere die Datei als gelöst und prüfe anschließend den vollständigen Diff.",
"Führe Merge, Rebase oder Cherry-pick fort – oder brich die Operation vollständig ab.",
],
commands: [
{command:"git status",description:"Konfliktdateien und laufende Operation anzeigen"},
summary: "Reflog protokolliert lokale Bewegungen von HEAD und Branches. Kopiere den Hash des gesuchten Eintrags und erstelle daraus einen Sicherungs-Branch.",
note: "Auf macOS kannst du für Ctrl in der Regel die Command-Taste verwenden.",
},
],
},
];
const enCategories: HelpCategory[] = [
{
id: "start",
label: "Getting started",
description: "Open a repository, understand the interface, and create your first commit.",
sections: [
{
id: "start-workflow",
title: "Your first Gitty workflow",
summary: "From repository to published commit in five clear steps.",
steps: [
"Open an existing repository or clone a project from Repository Management.",
"Edit your files. Gitty automatically displays working-tree changes.",
"Review the diff and stage individual files, lines, or all related changes.",
"Write a meaningful commit message and create the commit.",
"Use Fetch, Pull, and Push to synchronize with the remote repository.",
],
},
{
id: "start-layout",
title: "Interface overview",
summary: "Branches, stashes, and files are on the left. Review and commit changes in the center; history and file history are on the right.",
note: "Most areas can be resized using their dividers or collapsed from their header.",
},
{
id: "start-safety",
title: "Work safely",
summary: "Before committing, pulling, rebasing, or discarding, always check the current branch and affected files. Gitty confirms destructive actions.",
},
],
},
{
id: "app",
label: "Working with Gitty",
description: "The app's most important features, explained step by step.",
sections: [
{
id: "app-changes",
title: "Review and stage changes",
summary: "Select a changed file, review its diff, and move changes into the staging area.",
steps: [
"Unstaged contains changes not yet prepared; Staged contains the next commit.",
"Open a file to review added and removed lines.",
"Stage whole files or use line and hunk actions for focused commits.",
"Discard removes local changes and cannot always be undone.",
],
},
{
id: "app-history",
title: "History, search, and comparison",
summary: "Commit History shows branches and merges. Global Search finds where code was introduced or displays a file's history.",
steps: [
"Expand a commit to inspect its files.",
"Compare two commits with Compare in the title bar.",
"Use Reflog to recover moved or otherwise hidden references.",
],
},
{
id: "app-stash",
title: "Save temporary work with Stash",
summary: "A stash parks unfinished changes without creating a commit. Apply keeps the stash; Pop applies and removes it.",
},
],
},
{
id: "basics",
label: "Git basics",
description: "Everyday commands for status, changes, commits, and recovery.",
sections: [
{
id: "basics-inspect",
title: "Inspect a repository",
summary: "These commands do not change anything and are always a good first look at the current state.",
commands: [
{command:"git status",description:"Show the working tree and staging area"},
{command:"git diff",description:"Show changes that have not been staged"},
{command:"git diff --staged",description:"Show the contents of the next commit"},
{command:"git log --oneline --graph --decorate --all",description:"Show a compact branch and commit graph"},
],
},
{
id: "basics-commit",
title: "Save changes",
summary: "Stage only related changes and explain why the change is needed in the commit message.",
commands: [
{command:"git add <file>",description:"Stage one file"},
{command:"git add -p",description:"Stage changes interactively by hunk"},
{command:"git commit -m \"Short description\"",description:"Create a commit"},
{command:"git commit --amend",description:"Update or rename the latest local commit"},
],
},
{
id: "basics-undo",
title: "Undo changes",
summary: "Restore changes the working tree or staging area. Revert creates a new inverse commit and is safer for published history.",
commands: [
{command:"git restore <file>",description:"Discard an unstaged local change"},
{command:"git restore --staged <file>",description:"Remove a file from the staging area"},
{command:"git revert <commit>",description:"Undo a commit through a new commit"},
],
note: "Caution: git reset --hard discards local changes. Use it only when that data loss is intentional.",
},
],
},
{
id: "branches",
label: "Branches & merges",
description: "Organize parallel work, integrate it, and clean up afterward.",
sections: [
{
id: "branches-manage",
title: "Manage branches",
summary: "A branch is a movable pointer to a commit line. Create a separate branch for each independent task.",
commands: [
{command:"git switch -c feature/my-change",description:"Create and switch to a new branch"},
{command:"git switch main",description:"Switch to an existing branch"},
{command:"git branch -vv",description:"Show local branches and upstream status"},
{command:"git branch -d <branch>",description:"Delete a branch that has already been merged"},
],
},
{
id: "branches-integrate",
title: "Merge or rebase?",
summary: "Merge preserves the actual branch structure. Rebase moves local commits onto a new base for a linear history.",
commands: [
{command:"git merge <branch>",description:"Integrate a branch into the current branch"},
{command:"git rebase main",description:"Move local commits onto the latest main"},
{command:"git rebase --continue",description:"Continue after resolving a conflict"},
{command:"git rebase --abort",description:"Abort and restore the original state"},
],
note: "Do not rebase commits other people are already using. Rewriting published history creates avoidable conflicts.",
},
],
},
{
id: "remote",
label: "Remote & sync",
description: "Exchange changes safely with GitHub, GitLab, or other remotes.",
sections: [
{
id: "remote-sync",
title: "Fetch, pull, and push",
summary: "Fetch downloads references without changing files. Pull integrates remote changes. Push publishes your commits.",
commands: [
{command:"git fetch --all --prune",description:"Download remote state and remove stale references"},
{command:"git pull --rebase",description:"Download changes and replay local commits on top"},
{command:"git push -u origin <branch>",description:"Publish a branch and set its upstream"},
summary: "Ahead means local commits have not been pushed. Behind means remote commits are missing locally. Both at once means the histories have diverged.",
},
],
},
{
id: "troubleshooting",
label: "Troubleshooting",
description: "Resolve conflicts, recover lost commits, and understand common errors.",
sections: [
{
id: "trouble-conflicts",
title: "Resolve merge conflicts",
summary: "A conflict occurs when Git cannot combine changes unambiguously. Gitty provides a dedicated Resolve dialog.",
steps: [
"Open each conflicted file and compare Current, Incoming, and the combined result.",
"Accept one side or edit the final content manually.",
"Mark the file resolved and review the complete diff.",
"Continue the merge, rebase, or cherry-pick—or abort the operation.",
],
commands: [
{command:"git status",description:"Show conflicts and the active operation"},
{command:"git merge --abort",description:"Abort the current merge"},
{command:"git cherry-pick --abort",description:"Abort the current cherry-pick"},
],
},
{
id: "trouble-reflog",
title: "Recover lost commits",
summary: "Reflog records local movements of HEAD and branches. Copy the desired hash and create a recovery branch from it.",
commands: [
{command:"git reflog",description:"Show local reference movements"},
{command:"git branch recovery/<name> <commit>",description:"Preserve the recovered commit with a branch"},
],
},
],
},
{
id: "shortcuts",
label: "Keyboard shortcuts",
description: "Use Gitty quickly without reaching for the mouse.",
sections: [
{
id: "shortcuts-main",
title: "Global controls",
summary: "Help is available everywhere. Dialogs close consistently and search fields receive focus automatically.",
commands: [
{command:"Ctrl + /",description:"Open this help center"},
{command:"Escape",description:"Close the current overlay or dialog"},
{command:"Tab / Shift + Tab",description:"Move between controls"},
{command:"Enter / Space",description:"Activate the focused control"},
],
note: "On macOS, you can generally use Command instead of Ctrl.",
},
],
},
];
let {language="en",onClose=()=>{}}: Props = $props();
<inputbind:this={searchInput}bind:value={searchQuery}type="search"placeholder={isGerman?"Hilfe und Git-Befehle durchsuchen …":"Search help and Git commands …"}aria-label={isGerman?"Hilfe durchsuchen":"Search help"}/>
<span>{isGerman?"Suche auch nach Befehlen wie":"Try commands such as"}<code>rebase</code>, <code>stash</code>{isGerman?"oder":"or"}<code>reflog</code>.</span>
<h3>{isGerman?"Kein Hilfethema gefunden":"No help topic found"}</h3>
<p>{isGerman?"Versuche einen allgemeineren Begriff wie „Commit“, „Branch“, „Remote“ oder „Konflikt“.":"Try a broader term such as “commit”, “branch”, “remote”, or “conflict”."}</p>
<buttonclass="btn-secondary"type="button"onclick={()=>{searchQuery="";}}>{isGerman?"Alle Themen anzeigen":"Show all topics"}</button>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.