Compare commits
22
Commits
eed7325719
...
2026.7.17
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35d9fc969c | ||
|
|
710c6d4a53 | ||
|
|
0877d5a568 | ||
|
|
f79f3dc1ec | ||
|
|
cf2773b6f4 | ||
|
|
0ba7169efd | ||
|
|
c087171735 | ||
|
|
2d3c30b553 | ||
|
|
8409556158 | ||
|
|
db60f57544 | ||
|
|
cb5865094f | ||
|
|
c74db60daf | ||
|
|
812027abcf | ||
|
|
c8d5553214 | ||
|
|
8d9dedf93c | ||
|
|
2c9b8adb9e | ||
|
|
e6d9e60b8f | ||
|
|
8627012d93 | ||
|
|
a21fa9e54c | ||
|
|
adfb5f4158 | ||
|
|
6f3f438f15 | ||
|
|
b495313a51 |
@@ -96,7 +96,11 @@
|
||||
"Bash(identify src-tauri/icons/GitCat.ico)",
|
||||
"Bash(python3 -c \"import PIL; print\\(PIL.__version__\\)\")",
|
||||
"Bash(python3 *)",
|
||||
"Bash(xxd -l 16 src-tauri/icons/GitCat.ico)"
|
||||
"Bash(xxd -l 16 src-tauri/icons/GitCat.ico)",
|
||||
"Bash(pkg-config --exists openssl)",
|
||||
"Bash(sudo apt-get install -y libssl-dev pkg-config)",
|
||||
"Bash(dpkg -L libssl3t64)",
|
||||
"Bash(grep *)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,51 @@
|
||||
<div align="center">
|
||||
|
||||
<img src="public/splash-icon.png" alt="Gitty Logo" width="360">
|
||||
|
||||
# Gitty
|
||||
|
||||
**A lightweight, modern Git client built with Tauri.**
|
||||
|
||||
Fast, simple, and designed for developers who want a clean Git experience without unnecessary complexity.
|
||||
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## ✨ Features
|
||||
|
||||
- 🚀 Fast native performance
|
||||
- 🌿 Branch management
|
||||
- 📝 Commit history
|
||||
- 🔄 Pull, Push & Fetch
|
||||
- 🔀 Merge & Rebase
|
||||
- 📦 Repository management
|
||||
- 🎨 Modern and intuitive UI
|
||||
|
||||
---
|
||||
|
||||
## 📸 Preview
|
||||
|
||||
> Screenshots coming soon.
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Built With
|
||||
|
||||
- **Tauri**
|
||||
- **Rust**
|
||||
- **Svelte**
|
||||
|
||||
---
|
||||
|
||||
## 🚧 Status
|
||||
|
||||
Gitty is currently under active development.
|
||||
|
||||
Contributions, feedback and feature requests are always welcome!
|
||||
|
||||
---
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "gitty",
|
||||
"version": "0.200.2",
|
||||
"version": "2026.7.16",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "gitty",
|
||||
"version": "0.200.2",
|
||||
"version": "2026.7.16",
|
||||
"dependencies": {
|
||||
"@lucide/svelte": "^1.21.0",
|
||||
"@tailwindcss/vite": "^4.3.1",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gitty",
|
||||
"version": "0.200.2",
|
||||
"version": "2026.7.16",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
Generated
+126
-9
@@ -2543,6 +2543,7 @@ dependencies = [
|
||||
"tauri-build",
|
||||
"tauri-plugin-aptabase",
|
||||
"tauri-plugin-dialog",
|
||||
"tauri-plugin-single-instance",
|
||||
"tauri-plugin-updater",
|
||||
"tokio",
|
||||
]
|
||||
@@ -3420,7 +3421,7 @@ dependencies = [
|
||||
"security-framework 2.11.1",
|
||||
"security-framework 3.7.0",
|
||||
"windows-sys 0.60.2",
|
||||
"zbus",
|
||||
"zbus 4.4.0",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
@@ -5895,7 +5896,7 @@ dependencies = [
|
||||
"rand 0.8.6",
|
||||
"serde",
|
||||
"sha2",
|
||||
"zbus",
|
||||
"zbus 4.4.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7066,6 +7067,21 @@ dependencies = [
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-single-instance"
|
||||
version = "2.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c8f29386f5e9fdc699182388a33ee80a56de436d91b67459e86afef426282af"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tauri",
|
||||
"thiserror 2.0.18",
|
||||
"tracing",
|
||||
"windows-sys 0.60.2",
|
||||
"zbus 5.17.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tauri-plugin-updater"
|
||||
version = "2.10.1"
|
||||
@@ -9126,9 +9142,44 @@ dependencies = [
|
||||
"uds_windows",
|
||||
"windows-sys 0.52.0",
|
||||
"xdg-home",
|
||||
"zbus_macros",
|
||||
"zbus_names",
|
||||
"zvariant",
|
||||
"zbus_macros 4.4.0",
|
||||
"zbus_names 3.0.0",
|
||||
"zvariant 4.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus"
|
||||
version = "5.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a28b97f866896a4be7aefd2b5a8e01bb6773d19a775d54ab28b4d094b9a4480e"
|
||||
dependencies = [
|
||||
"async-broadcast",
|
||||
"async-executor",
|
||||
"async-io",
|
||||
"async-lock",
|
||||
"async-process",
|
||||
"async-recursion",
|
||||
"async-task",
|
||||
"async-trait",
|
||||
"blocking",
|
||||
"enumflags2",
|
||||
"event-listener",
|
||||
"futures-core",
|
||||
"futures-lite",
|
||||
"hex",
|
||||
"libc",
|
||||
"ordered-stream",
|
||||
"rustix",
|
||||
"serde",
|
||||
"serde_repr",
|
||||
"tracing",
|
||||
"uds_windows",
|
||||
"uuid 1.23.4",
|
||||
"windows-sys 0.61.2",
|
||||
"winnow 1.0.3",
|
||||
"zbus_macros 5.17.0",
|
||||
"zbus_names 4.3.3",
|
||||
"zvariant 5.13.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9141,7 +9192,22 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.118",
|
||||
"zvariant_utils",
|
||||
"zvariant_utils 2.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus_macros"
|
||||
version = "5.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e05ad887425eecf5e8384dc2406a4a9313eb73468712fc1cdea362eb4fe0469"
|
||||
dependencies = [
|
||||
"proc-macro-crate 3.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.118",
|
||||
"zbus_names 4.3.3",
|
||||
"zvariant 5.13.0",
|
||||
"zvariant_utils 3.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9152,7 +9218,18 @@ checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"static_assertions",
|
||||
"zvariant",
|
||||
"zvariant 4.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zbus_names"
|
||||
version = "4.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1039ca249fee9559680f3a9f05b55e0761fee51af4f6c1e7d8c1f31e549721d2"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"winnow 1.0.3",
|
||||
"zvariant 5.13.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9313,7 +9390,21 @@ dependencies = [
|
||||
"enumflags2",
|
||||
"serde",
|
||||
"static_assertions",
|
||||
"zvariant_derive",
|
||||
"zvariant_derive 4.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zvariant"
|
||||
version = "5.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7cf057bb00bf5c9ad77abb6147b0ca4818236a1858416e9d988e40d6322fefa7"
|
||||
dependencies = [
|
||||
"endi",
|
||||
"enumflags2",
|
||||
"serde",
|
||||
"winnow 1.0.3",
|
||||
"zvariant_derive 5.13.0",
|
||||
"zvariant_utils 3.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9326,7 +9417,20 @@ dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.118",
|
||||
"zvariant_utils",
|
||||
"zvariant_utils 2.1.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zvariant_derive"
|
||||
version = "5.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8118ca6bda77bfc0ab51d660db0c955f2505eef854c9a449435bccb616933b31"
|
||||
dependencies = [
|
||||
"proc-macro-crate 3.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.118",
|
||||
"zvariant_utils 3.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -9339,3 +9443,16 @@ dependencies = [
|
||||
"quote",
|
||||
"syn 2.0.118",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zvariant_utils"
|
||||
version = "3.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "90cb9383f9b45290407a1258b202d3f8f01db719eb60b4e4055c6375af4fc7c7"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"serde",
|
||||
"syn 2.0.118",
|
||||
"winnow 1.0.3",
|
||||
]
|
||||
|
||||
@@ -26,6 +26,7 @@ tokio = "1.52.3"
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
||||
tauri-plugin-single-instance = "2"
|
||||
tauri-plugin-updater = "2"
|
||||
|
||||
# ── Build profiles ───────────────────────────────────────────────────────────
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
WriteRegStr HKCU "${UNINSTKEY}" "Publisher" "${MANUFACTURER}"
|
||||
WriteRegStr HKCU "${UNINSTKEY}" "InstallLocation" "$\"$INSTDIR$\""
|
||||
WriteRegStr HKCU "${UNINSTKEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||
WriteRegStr HKCU "${UNINSTKEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||
WriteRegDWORD HKCU "${UNINSTKEY}" "NoModify" "1"
|
||||
WriteRegDWORD HKCU "${UNINSTKEY}" "NoRepair" "1"
|
||||
!macroend
|
||||
|
||||
+83
-22
@@ -681,7 +681,14 @@ pub fn create_tag(
|
||||
Some(message) => {
|
||||
run_git(
|
||||
&repo,
|
||||
["tag", "-a", name.as_str(), "-m", message.as_str(), target.as_str()],
|
||||
[
|
||||
"tag",
|
||||
"-a",
|
||||
name.as_str(),
|
||||
"-m",
|
||||
message.as_str(),
|
||||
target.as_str(),
|
||||
],
|
||||
)?;
|
||||
}
|
||||
None => {
|
||||
@@ -755,7 +762,11 @@ fn validate_existing_tag_name(repo: &Path, name: &str) -> Result<String, String>
|
||||
|
||||
fn validate_tag_ref_name(name: &str) -> Result<String, String> {
|
||||
let output = git_command()
|
||||
.args(["check-ref-format", "--allow-onelevel", &format!("refs/tags/{name}")])
|
||||
.args([
|
||||
"check-ref-format",
|
||||
"--allow-onelevel",
|
||||
&format!("refs/tags/{name}"),
|
||||
])
|
||||
.output()
|
||||
.map_err(|err| format!("Could not start Git. Is Git installed? {err}"))?;
|
||||
|
||||
@@ -778,7 +789,8 @@ fn validate_tag_ref_name(name: &str) -> Result<String, String> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn stage_files(path: String, files: Vec<String>) -> Result<GitStatus, String> {
|
||||
pub async fn stage_files(path: String, files: Vec<String>) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
validate_files(&files)?;
|
||||
|
||||
@@ -803,10 +815,14 @@ pub fn stage_files(path: String, files: Vec<String>) -> Result<GitStatus, String
|
||||
}
|
||||
|
||||
status_for_repo(&repo)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not stage files: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn unstage_files(path: String, files: Vec<String>) -> Result<GitStatus, String> {
|
||||
pub async fn unstage_files(path: String, files: Vec<String>) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
validate_files(&files)?;
|
||||
|
||||
@@ -816,10 +832,14 @@ pub fn unstage_files(path: String, files: Vec<String>) -> Result<GitStatus, Stri
|
||||
}
|
||||
|
||||
status_for_repo(&repo)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not unstage files: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn restore_files(path: String, files: Vec<String>, staged: bool) -> Result<GitStatus, String> {
|
||||
pub async fn restore_files(path: String, files: Vec<String>, staged: bool) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
validate_files(&files)?;
|
||||
|
||||
@@ -835,6 +855,9 @@ pub fn restore_files(path: String, files: Vec<String>, staged: bool) -> Result<G
|
||||
}
|
||||
|
||||
status_for_repo(&repo)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not restore files: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -1044,7 +1067,8 @@ pub fn apply_file_patch(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn commit(path: String, message: String) -> Result<GitStatus, String> {
|
||||
pub async fn commit(path: String, message: String) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
if message.trim().is_empty() {
|
||||
return Err("Commit message must not be empty.".to_string());
|
||||
@@ -1057,10 +1081,14 @@ pub fn commit(path: String, message: String) -> Result<GitStatus, String> {
|
||||
|
||||
run_git(&repo, ["commit", "-m", message.as_str()])?;
|
||||
status_for_repo(&repo)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not commit: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn amend_commit(path: String, message: Option<String>) -> Result<GitStatus, String> {
|
||||
pub async fn amend_commit(path: String, message: Option<String>) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
if verify_commit(&repo, "HEAD").is_err() {
|
||||
return Err("There is no commit to amend.".to_string());
|
||||
@@ -1085,6 +1113,9 @@ pub fn amend_commit(path: String, message: Option<String>) -> Result<GitStatus,
|
||||
}
|
||||
|
||||
status_for_repo(&repo)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not amend commit: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -1096,7 +1127,11 @@ pub fn last_commit_message(path: String) -> Result<Option<String>, String> {
|
||||
|
||||
let output = run_git(&repo, ["log", "-1", "--format=%B", "HEAD"])?;
|
||||
let message = String::from_utf8_lossy(&output).trim_end().to_string();
|
||||
Ok(if message.is_empty() { None } else { Some(message) })
|
||||
Ok(if message.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(message)
|
||||
})
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -1117,11 +1152,12 @@ pub fn undo_last_commit(path: String) -> Result<GitStatus, String> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn pull(
|
||||
pub async fn pull(
|
||||
path: String,
|
||||
username: Option<String>,
|
||||
password: Option<String>,
|
||||
) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
let pull_args = ["pull", "--no-rebase", "--ff", "--no-edit"];
|
||||
let output = match (username.as_deref(), password.as_deref()) {
|
||||
@@ -1150,6 +1186,9 @@ pub fn pull(
|
||||
return Err(format!("AUTH_FAILED:{details}"));
|
||||
}
|
||||
Err(format!("Git command failed: {details}"))
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not pull: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -1188,11 +1227,12 @@ pub async fn fetch(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn push(
|
||||
pub async fn push(
|
||||
path: String,
|
||||
username: Option<String>,
|
||||
password: Option<String>,
|
||||
) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
let push_args = push_args_for_repo(&repo)?;
|
||||
match (username.as_deref(), password.as_deref()) {
|
||||
@@ -1204,6 +1244,9 @@ pub fn push(
|
||||
}
|
||||
}
|
||||
status_for_repo(&repo)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not push: {err}"))?
|
||||
}
|
||||
|
||||
// ── Credential storage (OS keychain) ────────────────────────────────────────
|
||||
@@ -1373,7 +1416,8 @@ pub fn cred_delete(key: String) -> Result<(), String> {
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn merge_branch(path: String, branch: String) -> Result<GitStatus, String> {
|
||||
pub async fn merge_branch(path: String, branch: String) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
let branch = branch.trim();
|
||||
if branch.is_empty() {
|
||||
@@ -1410,10 +1454,14 @@ pub fn merge_branch(path: String, branch: String) -> Result<GitStatus, String> {
|
||||
};
|
||||
|
||||
Err(format!("Merge failed: {details}"))
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not merge: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn rebase_branch(path: String, branch: String) -> Result<GitStatus, String> {
|
||||
pub async fn rebase_branch(path: String, branch: String) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
let branch = branch.trim();
|
||||
if branch.is_empty() {
|
||||
@@ -1428,6 +1476,9 @@ pub fn rebase_branch(path: String, branch: String) -> Result<GitStatus, String>
|
||||
.map_err(|err| format!("Could not start Git. Is Git installed? {err}"))?;
|
||||
|
||||
rebase_status_or_error(&repo, output, "Rebase failed", true)
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not rebase: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -1479,7 +1530,8 @@ fn rebase_status_or_error(
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
pub fn cherry_pick_commit(path: String, commit: String) -> Result<GitStatus, String> {
|
||||
pub async fn cherry_pick_commit(path: String, commit: String) -> Result<GitStatus, String> {
|
||||
tauri::async_runtime::spawn_blocking(move || -> Result<GitStatus, String> {
|
||||
let repo = resolve_repo(&path)?;
|
||||
let commit_hash = verify_commit(&repo, &commit)?;
|
||||
|
||||
@@ -1492,6 +1544,9 @@ pub fn cherry_pick_commit(path: String, commit: String) -> Result<GitStatus, Str
|
||||
.map_err(|err| format!("Could not start Git. Is Git installed? {err}"))?;
|
||||
|
||||
cherry_pick_status_or_error(&repo, output, "Cherry-pick failed")
|
||||
})
|
||||
.await
|
||||
.map_err(|err| format!("Could not cherry-pick: {err}"))?
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
@@ -4826,12 +4881,12 @@ mod tests {
|
||||
}));
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[tokio::test]
|
||||
#[cfg_attr(
|
||||
windows,
|
||||
ignore = "Git for Windows can fail local pull tests with a sh signal pipe error"
|
||||
)]
|
||||
fn pull_merges_diverging_branch_instead_of_requiring_fast_forward() {
|
||||
async fn pull_merges_diverging_branch_instead_of_requiring_fast_forward() {
|
||||
let repo = init_temp_repo("pull_diverged");
|
||||
commit_initial_file(&repo.path);
|
||||
let base_branch = git_output_test(&repo.path, ["rev-parse", "--abbrev-ref", "HEAD"]);
|
||||
@@ -4861,7 +4916,9 @@ mod tests {
|
||||
],
|
||||
);
|
||||
|
||||
let status = pull(repo.path.to_string_lossy().to_string(), None, None).unwrap();
|
||||
let status = pull(repo.path.to_string_lossy().to_string(), None, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert!(status.clean, "{:?}", status.files);
|
||||
assert!(repo.path.join("remote.txt").exists());
|
||||
@@ -4910,12 +4967,12 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[tokio::test]
|
||||
#[cfg_attr(
|
||||
windows,
|
||||
ignore = "Git for Windows can fail local push tests with a sh signal pipe error"
|
||||
)]
|
||||
fn push_sets_upstream_for_branch_without_tracking_remote() {
|
||||
async fn push_sets_upstream_for_branch_without_tracking_remote() {
|
||||
let repo = init_temp_repo("push_sets_upstream_integration");
|
||||
let remote = init_bare_temp_repo("push_sets_upstream_integration_remote");
|
||||
commit_initial_file(&repo.path);
|
||||
@@ -4932,7 +4989,9 @@ mod tests {
|
||||
["remote", "add", "origin", remote.path.to_str().unwrap()],
|
||||
);
|
||||
|
||||
let status = push(repo.path.to_string_lossy().to_string(), None, None).unwrap();
|
||||
let status = push(repo.path.to_string_lossy().to_string(), None, None)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
status.upstream.as_deref(),
|
||||
@@ -5000,8 +5059,8 @@ mod tests {
|
||||
assert_eq!(contents.replace("\r\n", "\n"), "resolved\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn commit_rejects_unresolved_merge_conflicts() {
|
||||
#[tokio::test]
|
||||
async fn commit_rejects_unresolved_merge_conflicts() {
|
||||
let repo = init_temp_repo("commit_rejects_conflicts");
|
||||
fs::write(repo.path.join("file.txt"), "base\n").expect("base file should be written");
|
||||
run_git_test(&repo.path, ["add", "file.txt"]);
|
||||
@@ -5027,6 +5086,7 @@ mod tests {
|
||||
repo.path.to_string_lossy().to_string(),
|
||||
"should not commit".to_string(),
|
||||
)
|
||||
.await
|
||||
.unwrap_err();
|
||||
|
||||
assert!(err.contains("Merge conflicts"));
|
||||
@@ -5544,7 +5604,8 @@ mod tests {
|
||||
fn get_file_blame_attributes_lines_to_the_commits_that_introduced_them() {
|
||||
let repo = init_temp_repo("file_blame");
|
||||
commit_initial_file(&repo.path);
|
||||
fs::write(repo.path.join("old.txt"), "original\ntwo\n").expect("tracked file should change");
|
||||
fs::write(repo.path.join("old.txt"), "original\ntwo\n")
|
||||
.expect("tracked file should change");
|
||||
run_git_test(&repo.path, ["add", "old.txt"]);
|
||||
run_git_test(&repo.path, ["commit", "-q", "-m", "add second line"]);
|
||||
|
||||
|
||||
+14
-6
@@ -19,7 +19,7 @@ use git::{
|
||||
restore_to_commit, search_code_introductions, stage_files, stash_apply, stash_drop, stash_pop,
|
||||
stash_push, undo_last_commit, unstage_files,
|
||||
};
|
||||
use tauri::Manager;
|
||||
use tauri::{Manager, AppHandle};
|
||||
|
||||
#[tauri::command]
|
||||
fn close_splashscreen(app: tauri::AppHandle) -> Result<(), String> {
|
||||
@@ -43,13 +43,21 @@ fn close_splashscreen(app: tauri::AppHandle) -> Result<(), String> {
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_single_instance::init(|app, _, _| {
|
||||
#[cfg(desktop)]
|
||||
let _ = app.get_webview_window("main")
|
||||
.expect("no main window")
|
||||
.set_focus();
|
||||
}))
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
.plugin(tauri_plugin_aptabase::Builder::new("A-SH-1344793789").with_options(
|
||||
tauri_plugin_aptabase::InitOptions {
|
||||
.plugin(
|
||||
tauri_plugin_aptabase::Builder::new("A-SH-1344793789")
|
||||
.with_options(tauri_plugin_aptabase::InitOptions {
|
||||
host: Some("https://aptabase.cbsk-tech.de".to_string()),
|
||||
flush_interval:None
|
||||
}
|
||||
).build())
|
||||
flush_interval: None,
|
||||
})
|
||||
.build(),
|
||||
)
|
||||
.manage(SearchCancellationState::default())
|
||||
.manage(commit_ai::CommitAiEngine::new())
|
||||
.plugin(tauri_plugin_dialog::init())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Gitty",
|
||||
"version": "0.200.2",
|
||||
"version": "2026.7.16",
|
||||
"identifier": "com.gitty",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
+488
-30
@@ -165,13 +165,33 @@
|
||||
const AI_SETTINGS_KEY = "gitlite.aiSettings.v1";
|
||||
const ANALYTICS_SETTINGS_KEY = "gitlite.analyticsSettings.v1";
|
||||
const COMMIT_PANEL_HEIGHT_KEY = "gitlite.commitPanelHeight.v1";
|
||||
const LEFT_SIDEBAR_WIDTH_KEY = "gitlite.leftSidebarWidth.v1";
|
||||
const LEFT_BRANCH_PANEL_HEIGHT_KEY = "gitlite.leftBranchPanelHeight.v1";
|
||||
const LEFT_STASH_PANEL_HEIGHT_KEY = "gitlite.leftStashPanelHeight.v1";
|
||||
const BRANCH_PANEL_COLLAPSED_KEY = "gitlite.branchPanelCollapsed.v1";
|
||||
const STASH_PANEL_COLLAPSED_KEY = "gitlite.stashPanelCollapsed.v2";
|
||||
const EXPLORER_PANEL_COLLAPSED_KEY = "gitlite.explorerPanelCollapsed.v1";
|
||||
const HISTORY_ASIDE_WIDTH_KEY = "gitlite.historyAsideWidth.v1";
|
||||
const FILE_HISTORY_WIDTH_KEY = "gitlite.fileHistoryWidth.v1";
|
||||
const COMMIT_PANEL_DEFAULT_HEIGHT = 220;
|
||||
const COMMIT_PANEL_MIN_HEIGHT = COMMIT_PANEL_DEFAULT_HEIGHT;
|
||||
const COMMIT_PANEL_MAX_HEIGHT = 640;
|
||||
const LEFT_SIDEBAR_DEFAULT_WIDTH = 280;
|
||||
const LEFT_SIDEBAR_MIN_WIDTH = 220;
|
||||
const LEFT_SIDEBAR_MAX_WIDTH = 420;
|
||||
const LEFT_BRANCH_PANEL_DEFAULT_HEIGHT = 260;
|
||||
const LEFT_BRANCH_PANEL_MIN_HEIGHT = 180;
|
||||
const LEFT_BRANCH_PANEL_MAX_HEIGHT = 560;
|
||||
const LEFT_STASH_PANEL_DEFAULT_HEIGHT = 190;
|
||||
const LEFT_STASH_PANEL_MIN_HEIGHT = 150;
|
||||
const LEFT_STASH_PANEL_MAX_HEIGHT = 420;
|
||||
const LEFT_EXPLORER_PANEL_MIN_HEIGHT = 220;
|
||||
const HISTORY_ASIDE_DEFAULT_WIDTH = 620;
|
||||
const HISTORY_ASIDE_MIN_WIDTH = 560;
|
||||
const HISTORY_ASIDE_MAX_WIDTH = 920;
|
||||
const FILE_HISTORY_DEFAULT_WIDTH = 300;
|
||||
const FILE_HISTORY_MIN_WIDTH = 240;
|
||||
const FILE_HISTORY_MAX_WIDTH = 520;
|
||||
const ERROR_AUTO_HIDE_MS = 6000;
|
||||
|
||||
// ── State ──────────────────────────────────────────────────────────────────
|
||||
@@ -292,10 +312,30 @@
|
||||
let resizingCommitPanel = false;
|
||||
let resizeStartY = 0;
|
||||
let resizeStartHeight = 0;
|
||||
let leftSidebarWidth = loadLeftSidebarWidth();
|
||||
let resizingLeftSidebar = false;
|
||||
let leftSidebarResizeStartX = 0;
|
||||
let leftSidebarResizeStartWidth = 0;
|
||||
let leftBranchPanelHeight = loadLeftBranchPanelHeight();
|
||||
let resizingLeftBranchPanel = false;
|
||||
let leftBranchResizeStartY = 0;
|
||||
let leftBranchResizeStartHeight = 0;
|
||||
let leftStashPanelHeight = loadLeftStashPanelHeight();
|
||||
let resizingLeftStashPanel = false;
|
||||
let leftStashResizeStartY = 0;
|
||||
let leftStashResizeStartHeight = 0;
|
||||
let branchPanelCollapsed = loadStoredBoolean(BRANCH_PANEL_COLLAPSED_KEY, false);
|
||||
let stashPanelCollapsed = loadStoredBoolean(STASH_PANEL_COLLAPSED_KEY, false);
|
||||
let explorerPanelCollapsed = loadStoredBoolean(EXPLORER_PANEL_COLLAPSED_KEY, false);
|
||||
let historyAsideWidth = loadHistoryAsideWidth();
|
||||
let resizingHistoryAside = false;
|
||||
let historyResizeStartX = 0;
|
||||
let historyResizeStartWidth = 0;
|
||||
let fileHistoryWidth = loadFileHistoryWidth();
|
||||
let resizingFileHistory = false;
|
||||
let fileHistoryResizeStartX = 0;
|
||||
let fileHistoryResizeStartWidth = 0;
|
||||
let fileHistoryCollapsed = true;
|
||||
|
||||
// ── Derived ────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -337,14 +377,16 @@
|
||||
$: localBranchNames = localBranches.map((b) => b.name);
|
||||
$: remoteBranches = branches.filter((b) => b.remote);
|
||||
$: repoSearchTerm = repoSearch.trim().toLowerCase();
|
||||
$: openRepoRows = repoTabs.filter(repoMatchesSearch);
|
||||
$: openRepoRows = repoTabs.filter((repo) => repoMatchesSearch(repo, repoSearchTerm));
|
||||
$: recentRepoRows = recentRepoPaths
|
||||
.filter((path) => !repoTabs.some((tab) => sameRepoPath(tab.path, path)))
|
||||
.map(repoRowFromPath)
|
||||
.filter(repoMatchesSearch);
|
||||
.map((path) => repoRowFromPath(path, repoTabs, repoStatusCache))
|
||||
.filter((repo) => repoMatchesSearch(repo, repoSearchTerm));
|
||||
$: favoriteRepoRows = favoriteRepoPaths
|
||||
.map(repoRowFromPath)
|
||||
.filter(repoMatchesSearch);
|
||||
.map((path) => repoRowFromPath(path, repoTabs, repoStatusCache))
|
||||
.filter((repo) => repoMatchesSearch(repo, repoSearchTerm));
|
||||
$: leftSidebarRows = buildLeftSidebarRows(branchPanelCollapsed, stashPanelCollapsed, explorerPanelCollapsed);
|
||||
$: allLeftPanelsCollapsed = branchPanelCollapsed && stashPanelCollapsed && explorerPanelCollapsed;
|
||||
|
||||
// ── Lifecycle ──────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -497,6 +539,7 @@
|
||||
try {
|
||||
await fetchRemote(activeRepoPath);
|
||||
applyStatus(await getStatus(activeRepoPath));
|
||||
await refreshRefsAndCommitGraph(activeRepoPath);
|
||||
} catch {
|
||||
// ignore — see comment above
|
||||
} finally {
|
||||
@@ -514,8 +557,10 @@
|
||||
try {
|
||||
await fetchRemote(path);
|
||||
const nextStatus = await getStatus(path);
|
||||
if (sameRepoPath(path, activeRepoPath)) applyStatus(nextStatus);
|
||||
else updateRepoManagementStatus(path, nextStatus);
|
||||
if (sameRepoPath(path, activeRepoPath)) {
|
||||
applyStatus(nextStatus);
|
||||
await refreshRefsAndCommitGraph(path);
|
||||
} else updateRepoManagementStatus(path, nextStatus);
|
||||
} catch {
|
||||
// ignore; manual Fetch/Pull surfaces auth or network problems
|
||||
} finally {
|
||||
@@ -893,6 +938,10 @@
|
||||
return repoKey(left) === repoKey(right);
|
||||
}
|
||||
|
||||
function baseName(path: string): string {
|
||||
return path.split(/[\\/]/).filter(Boolean).pop() ?? path;
|
||||
}
|
||||
|
||||
function uniqueRepoPaths(paths: string[]): string[] {
|
||||
const seen = new Set<string>();
|
||||
const result: string[] = [];
|
||||
@@ -907,11 +956,11 @@
|
||||
return result;
|
||||
}
|
||||
|
||||
function repoRowFromPath(path: string): RepoTab {
|
||||
const openTab = repoTabs.find((tab) => sameRepoPath(tab.path, path));
|
||||
function repoRowFromPath(path: string, tabs = repoTabs, statusCache = repoStatusCache): RepoTab {
|
||||
const openTab = tabs.find((tab) => sameRepoPath(tab.path, path));
|
||||
if (openTab) return openTab;
|
||||
|
||||
const cached = repoStatusCache[repoKey(path)];
|
||||
const cached = statusCache[repoKey(path)];
|
||||
if (cached) return { ...cached, path, name: repoNameFromPath(path) };
|
||||
|
||||
return {
|
||||
@@ -925,11 +974,11 @@
|
||||
};
|
||||
}
|
||||
|
||||
function repoMatchesSearch(repo: RepoTab): boolean {
|
||||
if (!repoSearchTerm) return true;
|
||||
return repo.name.toLowerCase().includes(repoSearchTerm)
|
||||
|| repo.path.toLowerCase().includes(repoSearchTerm)
|
||||
|| (repo.branch ?? "").toLowerCase().includes(repoSearchTerm);
|
||||
function repoMatchesSearch(repo: RepoTab, searchTerm = repoSearchTerm): boolean {
|
||||
if (!searchTerm) return true;
|
||||
return repo.name.toLowerCase().includes(searchTerm)
|
||||
|| repo.path.toLowerCase().includes(searchTerm)
|
||||
|| (repo.branch ?? "").toLowerCase().includes(searchTerm);
|
||||
}
|
||||
|
||||
function loadRepoLists() {
|
||||
@@ -1024,6 +1073,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
function loadStoredBoolean(key: string, fallback: boolean): boolean {
|
||||
try {
|
||||
const stored = localStorage.getItem(key);
|
||||
if (stored === "true") return true;
|
||||
if (stored === "false") return false;
|
||||
} catch {
|
||||
// Local storage is best-effort only; panel defaults are enough.
|
||||
}
|
||||
return fallback;
|
||||
}
|
||||
|
||||
function persistStoredBoolean(key: string, value: boolean) {
|
||||
try {
|
||||
localStorage.setItem(key, String(value));
|
||||
} catch {
|
||||
// Local storage is best-effort only; toggles must keep working without it.
|
||||
}
|
||||
}
|
||||
|
||||
function clampCommitPanelHeight(value: number): number {
|
||||
return Math.min(COMMIT_PANEL_MAX_HEIGHT, Math.max(COMMIT_PANEL_MIN_HEIGHT, Math.round(value)));
|
||||
}
|
||||
@@ -1046,6 +1114,72 @@
|
||||
}
|
||||
}
|
||||
|
||||
function clampLeftSidebarWidth(value: number): number {
|
||||
return Math.min(LEFT_SIDEBAR_MAX_WIDTH, Math.max(LEFT_SIDEBAR_MIN_WIDTH, Math.round(value)));
|
||||
}
|
||||
|
||||
function loadLeftSidebarWidth(): number {
|
||||
try {
|
||||
const stored = Number(localStorage.getItem(LEFT_SIDEBAR_WIDTH_KEY));
|
||||
if (Number.isFinite(stored) && stored > 0) return clampLeftSidebarWidth(stored);
|
||||
} catch {
|
||||
// Fall through to the default below.
|
||||
}
|
||||
return LEFT_SIDEBAR_DEFAULT_WIDTH;
|
||||
}
|
||||
|
||||
function persistLeftSidebarWidth(value: number) {
|
||||
try {
|
||||
localStorage.setItem(LEFT_SIDEBAR_WIDTH_KEY, String(value));
|
||||
} catch {
|
||||
// Local storage is best-effort only; resizing must keep working without it.
|
||||
}
|
||||
}
|
||||
|
||||
function clampLeftBranchPanelHeight(value: number): number {
|
||||
return Math.min(LEFT_BRANCH_PANEL_MAX_HEIGHT, Math.max(LEFT_BRANCH_PANEL_MIN_HEIGHT, Math.round(value)));
|
||||
}
|
||||
|
||||
function loadLeftBranchPanelHeight(): number {
|
||||
try {
|
||||
const stored = Number(localStorage.getItem(LEFT_BRANCH_PANEL_HEIGHT_KEY));
|
||||
if (Number.isFinite(stored) && stored > 0) return clampLeftBranchPanelHeight(stored);
|
||||
} catch {
|
||||
// Fall through to the default below.
|
||||
}
|
||||
return LEFT_BRANCH_PANEL_DEFAULT_HEIGHT;
|
||||
}
|
||||
|
||||
function persistLeftBranchPanelHeight(value: number) {
|
||||
try {
|
||||
localStorage.setItem(LEFT_BRANCH_PANEL_HEIGHT_KEY, String(value));
|
||||
} catch {
|
||||
// Local storage is best-effort only; resizing must keep working without it.
|
||||
}
|
||||
}
|
||||
|
||||
function clampLeftStashPanelHeight(value: number): number {
|
||||
return Math.min(LEFT_STASH_PANEL_MAX_HEIGHT, Math.max(LEFT_STASH_PANEL_MIN_HEIGHT, Math.round(value)));
|
||||
}
|
||||
|
||||
function loadLeftStashPanelHeight(): number {
|
||||
try {
|
||||
const stored = Number(localStorage.getItem(LEFT_STASH_PANEL_HEIGHT_KEY));
|
||||
if (Number.isFinite(stored) && stored > 0) return clampLeftStashPanelHeight(stored);
|
||||
} catch {
|
||||
// Fall through to the default below.
|
||||
}
|
||||
return LEFT_STASH_PANEL_DEFAULT_HEIGHT;
|
||||
}
|
||||
|
||||
function persistLeftStashPanelHeight(value: number) {
|
||||
try {
|
||||
localStorage.setItem(LEFT_STASH_PANEL_HEIGHT_KEY, String(value));
|
||||
} catch {
|
||||
// Local storage is best-effort only; resizing must keep working without it.
|
||||
}
|
||||
}
|
||||
|
||||
function clampHistoryAsideWidth(value: number): number {
|
||||
return Math.min(HISTORY_ASIDE_MAX_WIDTH, Math.max(HISTORY_ASIDE_MIN_WIDTH, Math.round(value)));
|
||||
}
|
||||
@@ -1068,6 +1202,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
function clampFileHistoryWidth(value: number): number {
|
||||
return Math.min(FILE_HISTORY_MAX_WIDTH, Math.max(FILE_HISTORY_MIN_WIDTH, Math.round(value)));
|
||||
}
|
||||
|
||||
function loadFileHistoryWidth(): number {
|
||||
try {
|
||||
const stored = Number(localStorage.getItem(FILE_HISTORY_WIDTH_KEY));
|
||||
if (Number.isFinite(stored) && stored > 0) return clampFileHistoryWidth(stored);
|
||||
} catch {
|
||||
// Fall through to the default below.
|
||||
}
|
||||
return FILE_HISTORY_DEFAULT_WIDTH;
|
||||
}
|
||||
|
||||
function persistFileHistoryWidth(value: number) {
|
||||
try {
|
||||
localStorage.setItem(FILE_HISTORY_WIDTH_KEY, String(value));
|
||||
} catch {
|
||||
// Local storage is best-effort only; resizing must keep working without it.
|
||||
}
|
||||
}
|
||||
|
||||
function startCommitPanelResize(event: PointerEvent) {
|
||||
event.preventDefault();
|
||||
resizingCommitPanel = true;
|
||||
@@ -1096,6 +1252,131 @@
|
||||
persistCommitPanelHeight(commitPanelHeight);
|
||||
}
|
||||
|
||||
function startLeftSidebarResize(event: PointerEvent) {
|
||||
event.preventDefault();
|
||||
resizingLeftSidebar = true;
|
||||
leftSidebarResizeStartX = event.clientX;
|
||||
leftSidebarResizeStartWidth = leftSidebarWidth;
|
||||
(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onLeftSidebarResizeMove(event: PointerEvent) {
|
||||
if (!resizingLeftSidebar) return;
|
||||
leftSidebarWidth = clampLeftSidebarWidth(leftSidebarResizeStartWidth + (event.clientX - leftSidebarResizeStartX));
|
||||
}
|
||||
|
||||
function endLeftSidebarResize(event: PointerEvent) {
|
||||
if (!resizingLeftSidebar) return;
|
||||
resizingLeftSidebar = false;
|
||||
persistLeftSidebarWidth(leftSidebarWidth);
|
||||
const target = event.currentTarget as HTMLElement;
|
||||
if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onLeftSidebarResizeKeydown(event: KeyboardEvent) {
|
||||
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
||||
event.preventDefault();
|
||||
leftSidebarWidth = clampLeftSidebarWidth(leftSidebarWidth + (event.key === "ArrowRight" ? 20 : -20));
|
||||
persistLeftSidebarWidth(leftSidebarWidth);
|
||||
}
|
||||
|
||||
function buildLeftSidebarRows(branchCollapsed: boolean, stashCollapsed: boolean, explorerCollapsed: boolean): string {
|
||||
const branchRow = branchCollapsed
|
||||
? "auto"
|
||||
: `minmax(${LEFT_BRANCH_PANEL_MIN_HEIGHT}px, var(--branch-panel-height, ${LEFT_BRANCH_PANEL_DEFAULT_HEIGHT}px))`;
|
||||
const branchHandleRow = branchCollapsed ? "0" : "14px";
|
||||
const stashRow = stashCollapsed
|
||||
? "auto"
|
||||
: `minmax(${LEFT_STASH_PANEL_MIN_HEIGHT}px, var(--stash-panel-height, ${LEFT_STASH_PANEL_DEFAULT_HEIGHT}px))`;
|
||||
const stashHandleRow = explorerCollapsed || (stashCollapsed && branchCollapsed) ? "0" : "14px";
|
||||
const explorerRow = explorerCollapsed ? "auto" : `minmax(${LEFT_EXPLORER_PANEL_MIN_HEIGHT}px, 1fr)`;
|
||||
|
||||
return `${branchRow} ${branchHandleRow} ${stashRow} ${stashHandleRow} ${explorerRow}`;
|
||||
}
|
||||
|
||||
function startLeftBranchPanelResize(event: PointerEvent) {
|
||||
if (branchPanelCollapsed) return;
|
||||
event.preventDefault();
|
||||
resizingLeftBranchPanel = true;
|
||||
leftBranchResizeStartY = event.clientY;
|
||||
leftBranchResizeStartHeight = leftBranchPanelHeight;
|
||||
(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onLeftBranchPanelResizeMove(event: PointerEvent) {
|
||||
if (!resizingLeftBranchPanel) return;
|
||||
leftBranchPanelHeight = clampLeftBranchPanelHeight(leftBranchResizeStartHeight + (event.clientY - leftBranchResizeStartY));
|
||||
}
|
||||
|
||||
function endLeftBranchPanelResize(event: PointerEvent) {
|
||||
if (!resizingLeftBranchPanel) return;
|
||||
resizingLeftBranchPanel = false;
|
||||
persistLeftBranchPanelHeight(leftBranchPanelHeight);
|
||||
const target = event.currentTarget as HTMLElement;
|
||||
if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onLeftBranchPanelResizeKeydown(event: KeyboardEvent) {
|
||||
if (branchPanelCollapsed || (event.key !== "ArrowUp" && event.key !== "ArrowDown")) return;
|
||||
event.preventDefault();
|
||||
leftBranchPanelHeight = clampLeftBranchPanelHeight(leftBranchPanelHeight + (event.key === "ArrowDown" ? 20 : -20));
|
||||
persistLeftBranchPanelHeight(leftBranchPanelHeight);
|
||||
}
|
||||
|
||||
function startLeftStashPanelResize(event: PointerEvent) {
|
||||
if (stashPanelCollapsed && branchPanelCollapsed) return;
|
||||
event.preventDefault();
|
||||
resizingLeftStashPanel = true;
|
||||
leftStashResizeStartY = event.clientY;
|
||||
leftStashResizeStartHeight = stashPanelCollapsed ? leftBranchPanelHeight : leftStashPanelHeight;
|
||||
(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onLeftStashPanelResizeMove(event: PointerEvent) {
|
||||
if (!resizingLeftStashPanel) return;
|
||||
if (stashPanelCollapsed) {
|
||||
leftBranchPanelHeight = clampLeftBranchPanelHeight(leftStashResizeStartHeight + (event.clientY - leftStashResizeStartY));
|
||||
} else {
|
||||
leftStashPanelHeight = clampLeftStashPanelHeight(leftStashResizeStartHeight + (event.clientY - leftStashResizeStartY));
|
||||
}
|
||||
}
|
||||
|
||||
function endLeftStashPanelResize(event: PointerEvent) {
|
||||
if (!resizingLeftStashPanel) return;
|
||||
resizingLeftStashPanel = false;
|
||||
if (stashPanelCollapsed) persistLeftBranchPanelHeight(leftBranchPanelHeight);
|
||||
else persistLeftStashPanelHeight(leftStashPanelHeight);
|
||||
const target = event.currentTarget as HTMLElement;
|
||||
if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onLeftStashPanelResizeKeydown(event: KeyboardEvent) {
|
||||
if ((stashPanelCollapsed && branchPanelCollapsed) || (event.key !== "ArrowUp" && event.key !== "ArrowDown")) return;
|
||||
event.preventDefault();
|
||||
if (stashPanelCollapsed) {
|
||||
leftBranchPanelHeight = clampLeftBranchPanelHeight(leftBranchPanelHeight + (event.key === "ArrowDown" ? 20 : -20));
|
||||
persistLeftBranchPanelHeight(leftBranchPanelHeight);
|
||||
} else {
|
||||
leftStashPanelHeight = clampLeftStashPanelHeight(leftStashPanelHeight + (event.key === "ArrowDown" ? 20 : -20));
|
||||
persistLeftStashPanelHeight(leftStashPanelHeight);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleBranchPanelCollapsed() {
|
||||
branchPanelCollapsed = !branchPanelCollapsed;
|
||||
persistStoredBoolean(BRANCH_PANEL_COLLAPSED_KEY, branchPanelCollapsed);
|
||||
}
|
||||
|
||||
function toggleStashPanelCollapsed() {
|
||||
stashPanelCollapsed = !stashPanelCollapsed;
|
||||
persistStoredBoolean(STASH_PANEL_COLLAPSED_KEY, stashPanelCollapsed);
|
||||
}
|
||||
|
||||
function toggleExplorerPanelCollapsed() {
|
||||
explorerPanelCollapsed = !explorerPanelCollapsed;
|
||||
persistStoredBoolean(EXPLORER_PANEL_COLLAPSED_KEY, explorerPanelCollapsed);
|
||||
}
|
||||
|
||||
function startHistoryAsideResize(event: PointerEvent) {
|
||||
event.preventDefault();
|
||||
resizingHistoryAside = true;
|
||||
@@ -1124,6 +1405,43 @@
|
||||
persistHistoryAsideWidth(historyAsideWidth);
|
||||
}
|
||||
|
||||
function startFileHistoryResize(event: PointerEvent) {
|
||||
if (fileHistoryCollapsed) return;
|
||||
event.preventDefault();
|
||||
resizingFileHistory = true;
|
||||
fileHistoryResizeStartX = event.clientX;
|
||||
fileHistoryResizeStartWidth = fileHistoryWidth;
|
||||
(event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onFileHistoryResizeMove(event: PointerEvent) {
|
||||
if (!resizingFileHistory) return;
|
||||
fileHistoryWidth = clampFileHistoryWidth(fileHistoryResizeStartWidth + (fileHistoryResizeStartX - event.clientX));
|
||||
}
|
||||
|
||||
function endFileHistoryResize(event: PointerEvent) {
|
||||
if (!resizingFileHistory) return;
|
||||
resizingFileHistory = false;
|
||||
persistFileHistoryWidth(fileHistoryWidth);
|
||||
const target = event.currentTarget as HTMLElement;
|
||||
if (target.hasPointerCapture(event.pointerId)) target.releasePointerCapture(event.pointerId);
|
||||
}
|
||||
|
||||
function onFileHistoryResizeKeydown(event: KeyboardEvent) {
|
||||
if (fileHistoryCollapsed || (event.key !== "ArrowLeft" && event.key !== "ArrowRight")) return;
|
||||
event.preventDefault();
|
||||
fileHistoryWidth = clampFileHistoryWidth(fileHistoryWidth + (event.key === "ArrowLeft" ? 20 : -20));
|
||||
persistFileHistoryWidth(fileHistoryWidth);
|
||||
}
|
||||
|
||||
function toggleFileHistoryCollapsed() {
|
||||
fileHistoryCollapsed = !fileHistoryCollapsed;
|
||||
}
|
||||
|
||||
function revealFileHistory() {
|
||||
fileHistoryCollapsed = false;
|
||||
}
|
||||
|
||||
function rememberRecentRepo(path: string) {
|
||||
recentRepoPaths = uniqueRepoPaths([path, ...recentRepoPaths]).slice(0, 40);
|
||||
persistRepoLists();
|
||||
@@ -1318,6 +1636,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshRefsAndCommitGraph(path = activeRepoPath) {
|
||||
const previousHeadHash = lastFileHistoryHeadHash;
|
||||
await refreshBranchList(path);
|
||||
await refreshTags(path);
|
||||
await refreshCommitHistory(path);
|
||||
if (lastFileHistoryHeadHash !== previousHeadHash) {
|
||||
await refreshFileHistory(path);
|
||||
}
|
||||
}
|
||||
|
||||
function isCancellationMessage(message: string): boolean {
|
||||
return message.toLowerCase().includes("cancelled");
|
||||
}
|
||||
@@ -1615,6 +1943,21 @@
|
||||
if (!activeStillOpen) await openRepo(path);
|
||||
}
|
||||
|
||||
async function removeRepoFromRecent(path: string, event?: MouseEvent) {
|
||||
event?.stopPropagation();
|
||||
if (isBusy) return;
|
||||
recentRepoPaths = recentRepoPaths.filter((recentPath) => !sameRepoPath(recentPath, path));
|
||||
persistRepoLists();
|
||||
trackEvent("repository_removed_from_recent", {
|
||||
recent_repositories: recentRepoPaths.length,
|
||||
});
|
||||
if (!repoTabs.some((tab) => sameRepoPath(tab.path, path)) && !isFavoriteRepo(path) && repoStatusCache[repoKey(path)]) {
|
||||
const { [repoKey(path)]: _removed, ...rest } = repoStatusCache;
|
||||
repoStatusCache = rest;
|
||||
persistRepoStatusCache();
|
||||
}
|
||||
}
|
||||
|
||||
async function removeRepoFromManagement(path: string, event?: MouseEvent) {
|
||||
event?.stopPropagation();
|
||||
if (isBusy) return;
|
||||
@@ -2018,6 +2361,7 @@
|
||||
errorMessage = "";
|
||||
await runOperation("Fetching", async () => {
|
||||
applyStatus(await fetchRemote(activeRepoPath, username, password));
|
||||
await refreshRefsAndCommitGraph(activeRepoPath);
|
||||
trackEvent("repository_fetched", {
|
||||
from_stored_credential: fromStore ? 1 : 0,
|
||||
ahead: status?.ahead ?? 0,
|
||||
@@ -2210,22 +2554,30 @@
|
||||
|
||||
// ── File staging / restore ─────────────────────────────────────────────────
|
||||
|
||||
async function stageFile(file: GitFileStatus) {
|
||||
await runOperation(`Staging ${file.path}`, async () => {
|
||||
applyStatus(await stageFiles(activeRepoPath, [file.path]));
|
||||
async function stageFile(files: GitFileStatus[]) {
|
||||
const targets = files.filter((file) => file.unstaged !== null);
|
||||
if (targets.length === 0) return;
|
||||
const paths = targets.map((file) => file.path);
|
||||
await runOperation(targets.length === 1 ? `Staging ${baseName(targets[0].path)}` : `Staging ${targets.length} files`, async () => {
|
||||
applyStatus(await stageFiles(activeRepoPath, paths));
|
||||
await refreshExplorerFiles(activeRepoPath);
|
||||
trackEvent("file_staged", {
|
||||
status: file.unstaged ?? file.staged ?? "unknown",
|
||||
files: targets.length,
|
||||
status: targets.length === 1 ? (targets[0].unstaged ?? targets[0].staged ?? "unknown") : "multiple",
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function unstageFile(file: GitFileStatus) {
|
||||
await runOperation(`Unstaging ${file.path}`, async () => {
|
||||
applyStatus(await unstageFiles(activeRepoPath, [file.path]));
|
||||
async function unstageFile(files: GitFileStatus[]) {
|
||||
const targets = files.filter((file) => file.staged !== null);
|
||||
if (targets.length === 0) return;
|
||||
const paths = targets.map((file) => file.path);
|
||||
await runOperation(targets.length === 1 ? `Unstaging ${baseName(targets[0].path)}` : `Unstaging ${targets.length} files`, async () => {
|
||||
applyStatus(await unstageFiles(activeRepoPath, paths));
|
||||
await refreshExplorerFiles(activeRepoPath);
|
||||
trackEvent("file_unstaged", {
|
||||
status: file.staged ?? file.unstaged ?? "unknown",
|
||||
files: targets.length,
|
||||
status: targets.length === 1 ? (targets[0].staged ?? targets[0].unstaged ?? "unknown") : "multiple",
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -2608,6 +2960,7 @@
|
||||
if (!activeRepoPath || (selectedExplorerPath === node.path && selectedExplorerKind === node.kind)) return;
|
||||
selectedExplorerPath = node.path;
|
||||
selectedExplorerKind = node.kind;
|
||||
revealFileHistory();
|
||||
void loadSelectedFileHistory(node.path);
|
||||
trackEvent("explorer_node_selected", {
|
||||
kind: node.kind,
|
||||
@@ -2620,6 +2973,7 @@
|
||||
selectedExplorerPath = file.path;
|
||||
selectedExplorerKind = "file";
|
||||
expandedExplorerPaths = new Set([...expandedExplorerPaths, ...explorerParentFolders(file.path)]);
|
||||
revealFileHistory();
|
||||
|
||||
void loadSelectedFileHistory(file.path);
|
||||
trackEvent("explorer_file_selected", {
|
||||
@@ -2633,6 +2987,7 @@
|
||||
selectedExplorerPath = file.path;
|
||||
selectedExplorerKind = "file";
|
||||
expandedExplorerPaths = new Set([...expandedExplorerPaths, ...explorerParentFolders(file.path)]);
|
||||
revealFileHistory();
|
||||
|
||||
void loadSelectedFileHistory(file.path);
|
||||
trackEvent("explorer_file_selected", {
|
||||
@@ -2645,6 +3000,7 @@
|
||||
if (!activeRepoPath || node.kind !== "file") return;
|
||||
selectedExplorerPath = node.path;
|
||||
selectedExplorerKind = "file";
|
||||
revealFileHistory();
|
||||
void loadSelectedFileHistory(node.path);
|
||||
|
||||
try {
|
||||
@@ -3020,7 +3376,7 @@
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
{#if operation && operation !== "Opening repository"}
|
||||
{#if operation && operation !== "Opening repository" && !hasRepository}
|
||||
<section class="notice busy" aria-live="polite">
|
||||
<LoaderCircle class="spin" size={17} aria-hidden="true" />
|
||||
<span>{operation}</span>
|
||||
@@ -3179,7 +3535,7 @@
|
||||
>
|
||||
<Star size={14} aria-hidden="true" />
|
||||
</button>
|
||||
<button class="repo-row-icon" type="button" onclick={(event) => removeRepoFromManagement(repo.path, event)} disabled={isBusy} title="Remove from recent" aria-label={`Remove ${repo.name}`}>
|
||||
<button class="repo-row-icon" type="button" onclick={(event) => removeRepoFromRecent(repo.path, event)} disabled={isBusy} title="Remove from recent" aria-label={`Remove ${repo.name}`}>
|
||||
<X size={14} aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
@@ -3231,10 +3587,22 @@
|
||||
</section>
|
||||
{:else}
|
||||
<!-- Workspace -->
|
||||
<section class="workspace" aria-label="Git workspace" style="--history-aside-width: {historyAsideWidth}px;">
|
||||
<section
|
||||
class="workspace"
|
||||
aria-label="Git workspace"
|
||||
style="--left-sidebar-width: {leftSidebarWidth}px; --history-aside-width: {historyAsideWidth}px; --file-history-width: {fileHistoryWidth}px;"
|
||||
>
|
||||
|
||||
<!-- Left sidebar: branches + explorer -->
|
||||
<aside class="left-sidebar" aria-label="Repository navigation">
|
||||
<aside
|
||||
class="left-sidebar"
|
||||
class:branch-collapsed={branchPanelCollapsed}
|
||||
class:stash-collapsed={stashPanelCollapsed}
|
||||
class:explorer-collapsed={explorerPanelCollapsed}
|
||||
class:all-collapsed={allLeftPanelsCollapsed}
|
||||
aria-label="Repository navigation"
|
||||
style="--branch-panel-height: {leftBranchPanelHeight}px; --stash-panel-height: {leftStashPanelHeight}px; grid-template-rows: {leftSidebarRows};"
|
||||
>
|
||||
<BranchPanel
|
||||
{branches}
|
||||
{localBranches}
|
||||
@@ -3251,7 +3619,31 @@
|
||||
onCreateTag={createNewTag}
|
||||
onDeleteTag={deleteLocalTag}
|
||||
onPushTag={pushLocalTag}
|
||||
collapsed={branchPanelCollapsed}
|
||||
onToggleCollapsed={toggleBranchPanelCollapsed}
|
||||
/>
|
||||
{#if !branchPanelCollapsed}
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<div
|
||||
class="panel-resize-handle left-panel-resize-handle branch-panel-resize-handle"
|
||||
class:resizing={resizingLeftBranchPanel}
|
||||
role="separator"
|
||||
aria-orientation="horizontal"
|
||||
aria-label="Resize branches panel height"
|
||||
aria-valuenow={leftBranchPanelHeight}
|
||||
aria-valuemin={LEFT_BRANCH_PANEL_MIN_HEIGHT}
|
||||
aria-valuemax={LEFT_BRANCH_PANEL_MAX_HEIGHT}
|
||||
tabindex="0"
|
||||
onpointerdown={startLeftBranchPanelResize}
|
||||
onpointermove={onLeftBranchPanelResizeMove}
|
||||
onpointerup={endLeftBranchPanelResize}
|
||||
onpointercancel={endLeftBranchPanelResize}
|
||||
onkeydown={onLeftBranchPanelResizeKeydown}
|
||||
></div>
|
||||
{:else}
|
||||
<span class="left-panel-resize-placeholder" aria-hidden="true"></span>
|
||||
{/if}
|
||||
<StashPanel
|
||||
{stashes}
|
||||
changedCount={changedFiles.length}
|
||||
@@ -3261,7 +3653,31 @@
|
||||
onApply={applyStashEntry}
|
||||
onPop={popStashEntry}
|
||||
onDrop={dropStashEntry}
|
||||
collapsed={stashPanelCollapsed}
|
||||
onToggleCollapsed={toggleStashPanelCollapsed}
|
||||
/>
|
||||
{#if !explorerPanelCollapsed && (!stashPanelCollapsed || !branchPanelCollapsed)}
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<div
|
||||
class="panel-resize-handle left-panel-resize-handle stash-panel-resize-handle"
|
||||
class:resizing={resizingLeftStashPanel}
|
||||
role="separator"
|
||||
aria-orientation="horizontal"
|
||||
aria-label={stashPanelCollapsed ? "Resize files panel space" : "Resize stash and explorer panels"}
|
||||
aria-valuenow={stashPanelCollapsed ? leftBranchPanelHeight : leftStashPanelHeight}
|
||||
aria-valuemin={stashPanelCollapsed ? LEFT_BRANCH_PANEL_MIN_HEIGHT : LEFT_STASH_PANEL_MIN_HEIGHT}
|
||||
aria-valuemax={stashPanelCollapsed ? LEFT_BRANCH_PANEL_MAX_HEIGHT : LEFT_STASH_PANEL_MAX_HEIGHT}
|
||||
tabindex="0"
|
||||
onpointerdown={startLeftStashPanelResize}
|
||||
onpointermove={onLeftStashPanelResizeMove}
|
||||
onpointerup={endLeftStashPanelResize}
|
||||
onpointercancel={endLeftStashPanelResize}
|
||||
onkeydown={onLeftStashPanelResizeKeydown}
|
||||
></div>
|
||||
{:else}
|
||||
<span class="left-panel-resize-placeholder" aria-hidden="true"></span>
|
||||
{/if}
|
||||
<ExplorerPanel
|
||||
{repoFiles}
|
||||
{expandedExplorerPaths}
|
||||
@@ -3275,8 +3691,28 @@
|
||||
onSelectNode={selectExplorerNode}
|
||||
onOpenFile={openFileFromExplorer}
|
||||
onBlame={openBlame}
|
||||
collapsed={explorerPanelCollapsed}
|
||||
onToggleCollapsed={toggleExplorerPanelCollapsed}
|
||||
/>
|
||||
</aside>
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<div
|
||||
class="left-sidebar-resize-handle"
|
||||
class:resizing={resizingLeftSidebar}
|
||||
role="separator"
|
||||
aria-orientation="vertical"
|
||||
aria-label="Resize navigation sidebar width"
|
||||
aria-valuenow={leftSidebarWidth}
|
||||
aria-valuemin={LEFT_SIDEBAR_MIN_WIDTH}
|
||||
aria-valuemax={LEFT_SIDEBAR_MAX_WIDTH}
|
||||
tabindex="0"
|
||||
onpointerdown={startLeftSidebarResize}
|
||||
onpointermove={onLeftSidebarResizeMove}
|
||||
onpointerup={endLeftSidebarResize}
|
||||
onpointercancel={endLeftSidebarResize}
|
||||
onkeydown={onLeftSidebarResizeKeydown}
|
||||
></div>
|
||||
|
||||
<!-- Center: summary + status + commit -->
|
||||
<section class="main-panel" aria-label="Repository status">
|
||||
@@ -3302,6 +3738,7 @@
|
||||
{unstagedCount}
|
||||
{hasRepository}
|
||||
{isBusy}
|
||||
{operation}
|
||||
{status}
|
||||
selectedFilePath={selectedExplorerPath}
|
||||
onSelectFile={selectFileFromStatus}
|
||||
@@ -3353,8 +3790,6 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Right sidebar: commit graph + file history -->
|
||||
<aside class="history-aside" aria-label="Commit history">
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<div
|
||||
@@ -3362,7 +3797,7 @@
|
||||
class:resizing={resizingHistoryAside}
|
||||
role="separator"
|
||||
aria-orientation="vertical"
|
||||
aria-label="Resize history panel width"
|
||||
aria-label="Resize commit history width"
|
||||
aria-valuenow={historyAsideWidth}
|
||||
aria-valuemin={HISTORY_ASIDE_MIN_WIDTH}
|
||||
aria-valuemax={HISTORY_ASIDE_MAX_WIDTH}
|
||||
@@ -3373,6 +3808,9 @@
|
||||
onpointercancel={endHistoryAsideResize}
|
||||
onkeydown={onHistoryAsideResizeKeydown}
|
||||
></div>
|
||||
|
||||
<!-- Right sidebar: commit graph + file history -->
|
||||
<aside class="history-aside" class:file-history-collapsed={fileHistoryCollapsed} aria-label="Commit history">
|
||||
<HistoryPanel
|
||||
{commits}
|
||||
{localBranchNames}
|
||||
@@ -3392,6 +3830,24 @@
|
||||
expandedCommitHashes = next;
|
||||
}}
|
||||
/>
|
||||
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
||||
<!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
|
||||
<div
|
||||
class="file-history-resize-handle"
|
||||
class:resizing={resizingFileHistory}
|
||||
role="separator"
|
||||
aria-orientation="vertical"
|
||||
aria-label="Resize file history width"
|
||||
aria-valuenow={fileHistoryWidth}
|
||||
aria-valuemin={FILE_HISTORY_MIN_WIDTH}
|
||||
aria-valuemax={FILE_HISTORY_MAX_WIDTH}
|
||||
tabindex={fileHistoryCollapsed ? -1 : 0}
|
||||
onpointerdown={startFileHistoryResize}
|
||||
onpointermove={onFileHistoryResizeMove}
|
||||
onpointerup={endFileHistoryResize}
|
||||
onpointercancel={endFileHistoryResize}
|
||||
onkeydown={onFileHistoryResizeKeydown}
|
||||
></div>
|
||||
<FileHistoryPanel
|
||||
{fileHistory}
|
||||
{selectedExplorerPath}
|
||||
@@ -3401,6 +3857,8 @@
|
||||
isLoading={fileHistoryLoading}
|
||||
onDiff={diffSelectedFileFromCommit}
|
||||
onRestore={restoreSelectedFileFromCommit}
|
||||
collapsed={fileHistoryCollapsed}
|
||||
onToggleCollapsed={toggleFileHistoryCollapsed}
|
||||
/>
|
||||
</aside>
|
||||
</section>
|
||||
|
||||
+225
-36
@@ -1096,63 +1096,120 @@
|
||||
|
||||
.workspace {
|
||||
display: grid;
|
||||
grid-template-columns: clamp(220px, 18vw, 280px) minmax(0, 1fr) minmax(560px, var(--history-aside-width, 620px));
|
||||
grid-template-columns: minmax(220px, var(--left-sidebar-width, 280px)) 8px minmax(0, 1fr) 8px minmax(560px, var(--history-aside-width, 620px));
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
gap: 8px;
|
||||
column-gap: 0;
|
||||
row-gap: 8px;
|
||||
}
|
||||
|
||||
.history-aside {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 300px;
|
||||
grid-template-columns: minmax(0, 1fr) 8px minmax(240px, var(--file-history-width, 300px));
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
gap: 8px;
|
||||
column-gap: 0;
|
||||
row-gap: 8px;
|
||||
}
|
||||
|
||||
.history-resize-handle {
|
||||
position: absolute;
|
||||
z-index: 20;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: -7px;
|
||||
width: 12px;
|
||||
.history-aside.file-history-collapsed {
|
||||
grid-template-columns: minmax(0, 1fr) 0 42px;
|
||||
}
|
||||
|
||||
.left-sidebar-resize-handle,
|
||||
.history-resize-handle,
|
||||
.file-history-resize-handle {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 8px;
|
||||
cursor: col-resize;
|
||||
touch-action: none;
|
||||
}
|
||||
.history-resize-handle::before {
|
||||
.left-sidebar-resize-handle::before,
|
||||
.history-resize-handle::before,
|
||||
.file-history-resize-handle::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
bottom: 12px;
|
||||
left: 5px;
|
||||
width: 2px;
|
||||
width: 3px;
|
||||
height: 40px;
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
transition: background 120ms ease, box-shadow 120ms ease;
|
||||
background: var(--color-border);
|
||||
transition: background-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
.left-sidebar-resize-handle:hover::before,
|
||||
.left-sidebar-resize-handle.resizing::before,
|
||||
.history-resize-handle:hover::before,
|
||||
.history-resize-handle.resizing::before {
|
||||
background: rgba(65,209,255,0.62);
|
||||
.history-resize-handle.resizing::before,
|
||||
.file-history-resize-handle:hover::before,
|
||||
.file-history-resize-handle.resizing::before {
|
||||
background: var(--color-accent);
|
||||
box-shadow: 0 0 14px rgba(65,209,255,0.3);
|
||||
}
|
||||
.history-resize-handle:focus-visible {
|
||||
.left-sidebar-resize-handle:focus-visible,
|
||||
.history-resize-handle:focus-visible,
|
||||
.file-history-resize-handle:focus-visible {
|
||||
outline: 2px solid var(--color-primary);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.history-aside.file-history-collapsed .file-history-resize-handle {
|
||||
pointer-events: none;
|
||||
}
|
||||
.history-aside.file-history-collapsed .file-history-resize-handle::before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.left-sidebar {
|
||||
display: grid;
|
||||
grid-template-rows: minmax(170px, 0.75fr) minmax(150px, 0.55fr) minmax(220px, 1fr);
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 260px)) 14px minmax(150px, var(--stash-panel-height, 190px)) 14px minmax(220px, 1fr);
|
||||
align-content: start;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
gap: 8px;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.left-panel-resize-handle {
|
||||
min-height: 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.left-panel-resize-placeholder {
|
||||
display: block;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.left-sidebar.branch-collapsed {
|
||||
grid-template-rows: auto 0 minmax(150px, var(--stash-panel-height, 190px)) 14px minmax(220px, 1fr);
|
||||
}
|
||||
|
||||
.left-sidebar.explorer-collapsed {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 260px)) 14px minmax(150px, var(--stash-panel-height, 190px)) 0 auto;
|
||||
}
|
||||
|
||||
.left-sidebar.branch-collapsed.explorer-collapsed {
|
||||
grid-template-rows: auto 0 minmax(150px, var(--stash-panel-height, 190px)) 0 auto;
|
||||
}
|
||||
|
||||
.left-sidebar:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: minmax(170px, 0.85fr) auto minmax(220px, 1.15fr);
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 260px)) 14px auto 0 minmax(220px, 1fr);
|
||||
}
|
||||
|
||||
.left-sidebar.branch-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: auto 0 auto 0 minmax(220px, 1fr);
|
||||
}
|
||||
|
||||
.left-sidebar.explorer-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 260px)) 14px auto 0 auto;
|
||||
}
|
||||
|
||||
.left-sidebar.branch-collapsed.explorer-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: auto 0 auto 0 auto;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
/* --- Main panel --- */
|
||||
@@ -1263,6 +1320,7 @@
|
||||
.file-row { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--color-border-subtle); border-radius: 8px; background: var(--color-surface-raised); }
|
||||
.file-row + .file-row { margin-top: 6px; }
|
||||
.file-row.selected { border-color: rgba(90,140,248,0.36); background: rgba(90,140,248,0.1); }
|
||||
.file-row.active { box-shadow: inset 3px 0 0 rgba(65,209,255,0.7); }
|
||||
|
||||
.file-title-button {
|
||||
justify-content: flex-start;
|
||||
@@ -1313,6 +1371,13 @@
|
||||
border-bottom: 1px solid var(--color-border-subtle);
|
||||
background: var(--color-surface-dim);
|
||||
}
|
||||
.status-selection-count {
|
||||
padding: 0 7px;
|
||||
color: var(--color-ink-dim);
|
||||
font-size: 11.5px;
|
||||
font-weight: 800;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* --- Stash panel --- */
|
||||
|
||||
@@ -1474,6 +1539,9 @@
|
||||
gap: 6px;
|
||||
}
|
||||
.branch-panel { position: relative; }
|
||||
.branch-panel.collapsed {
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
|
||||
.branch-create-toggle {
|
||||
width: 26px;
|
||||
@@ -1747,6 +1815,9 @@
|
||||
/* --- Explorer --- */
|
||||
|
||||
.explorer-panel { position: relative; }
|
||||
.explorer-panel.collapsed {
|
||||
grid-template-rows: auto;
|
||||
}
|
||||
|
||||
.explorer-head-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
|
||||
.explorer-bulk-button {
|
||||
@@ -2127,8 +2198,75 @@
|
||||
background: rgba(65,209,255,0.08);
|
||||
color: var(--color-ink);
|
||||
}
|
||||
.file-history-panel.collapsed {
|
||||
display: grid;
|
||||
grid-template-rows: 1fr;
|
||||
overflow: hidden;
|
||||
}
|
||||
.file-history-rail-toggle {
|
||||
display: grid;
|
||||
grid-template-rows: auto minmax(0, 1fr) auto;
|
||||
justify-items: center;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
padding: 12px 0;
|
||||
border: 0;
|
||||
border-radius: 0;
|
||||
color: var(--color-ink-dim);
|
||||
background: linear-gradient(180deg, rgba(100,108,255,0.12), rgba(65,209,255,0.04));
|
||||
}
|
||||
.file-history-rail-toggle:hover:not(:disabled) {
|
||||
color: var(--color-ink);
|
||||
background: linear-gradient(180deg, rgba(100,108,255,0.18), rgba(65,209,255,0.08));
|
||||
}
|
||||
.file-history-rail-toggle span {
|
||||
writing-mode: vertical-rl;
|
||||
text-orientation: mixed;
|
||||
overflow: hidden;
|
||||
color: currentColor;
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.file-history-rail-toggle small {
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
min-width: 22px;
|
||||
min-height: 22px;
|
||||
border-radius: 999px;
|
||||
color: var(--color-ink);
|
||||
background: rgba(94,110,156,0.18);
|
||||
font-size: 11px;
|
||||
font-weight: 800;
|
||||
}
|
||||
.file-history-head { align-items: flex-start; }
|
||||
.file-history-heading { min-width: 0; flex: 1 1 auto; overflow: hidden; }
|
||||
.file-history-head-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 0 0 auto;
|
||||
gap: 6px;
|
||||
}
|
||||
.file-history-toggle {
|
||||
width: 26px;
|
||||
min-width: 26px;
|
||||
min-height: 26px;
|
||||
padding: 0;
|
||||
border-color: rgba(65,209,255,0.2);
|
||||
border-radius: 7px;
|
||||
color: var(--color-ink-dim);
|
||||
background: rgba(65,209,255,0.06);
|
||||
}
|
||||
.file-history-toggle:hover:not(:disabled) {
|
||||
border-color: rgba(65,209,255,0.45);
|
||||
color: #ffffff;
|
||||
background: rgba(65,209,255,0.13);
|
||||
}
|
||||
.section-head .file-history-name {
|
||||
display: -webkit-box;
|
||||
max-height: 2.4em;
|
||||
@@ -4261,27 +4399,52 @@
|
||||
/* --- Responsive breakpoints --- */
|
||||
|
||||
@media (min-width: 1800px) {
|
||||
.workspace { grid-template-columns: 320px minmax(0, 1fr) minmax(560px, var(--history-aside-width, 680px)); }
|
||||
.workspace { grid-template-columns: minmax(220px, var(--left-sidebar-width, 320px)) 8px minmax(0, 1fr) 8px minmax(560px, var(--history-aside-width, 680px)); }
|
||||
}
|
||||
|
||||
@media (max-width: 1400px) {
|
||||
.workspace { grid-template-columns: clamp(200px, 17vw, 265px) minmax(0, 1fr) minmax(540px, var(--history-aside-width, 580px)); }
|
||||
.workspace { grid-template-columns: minmax(200px, var(--left-sidebar-width, 265px)) 8px minmax(0, 1fr) 8px minmax(540px, var(--history-aside-width, 580px)); }
|
||||
}
|
||||
|
||||
/* Stack CommitPanel below StatusPanel; history panels stay side by side */
|
||||
@media (max-width: 1100px) {
|
||||
.workspace { grid-template-columns: clamp(185px, 16vw, 220px) minmax(0, 1fr) minmax(500px, var(--history-aside-width, 560px)); }
|
||||
.workspace { grid-template-columns: minmax(185px, var(--left-sidebar-width, 220px)) 8px minmax(0, 1fr) 8px minmax(500px, var(--history-aside-width, 560px)); }
|
||||
.top-section { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 14px var(--commit-panel-height, 190px); }
|
||||
}
|
||||
|
||||
/* Compact: stack history panels vertically, narrow sidebars */
|
||||
@media (max-width: 960px) {
|
||||
.workspace { grid-template-columns: 180px minmax(0, 1fr) 300px; gap: 6px; }
|
||||
.history-aside { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.3fr) minmax(0, 0.7fr); }
|
||||
.history-resize-handle { display: none; }
|
||||
.workspace { grid-template-columns: 180px 8px minmax(0, 1fr) 0 300px; row-gap: 6px; }
|
||||
.history-aside { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.3fr) minmax(0, 0.7fr); row-gap: 6px; }
|
||||
.history-aside.file-history-collapsed { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 42px; }
|
||||
.history-resize-handle,
|
||||
.file-history-resize-handle { display: none; }
|
||||
.shell-body { gap: 6px; }
|
||||
.left-sidebar { gap: 6px; grid-template-rows: minmax(150px, 0.7fr) minmax(145px, 0.55fr) minmax(190px, 1fr); }
|
||||
.left-sidebar:has(.stash-panel.collapsed) { grid-template-rows: minmax(150px, 0.8fr) auto minmax(190px, 1.1fr); }
|
||||
.left-sidebar {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 230px)) 14px minmax(150px, var(--stash-panel-height, 170px)) 14px minmax(220px, 1fr);
|
||||
}
|
||||
.left-sidebar:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 230px)) 14px auto 0 minmax(220px, 1fr);
|
||||
}
|
||||
.left-sidebar.branch-collapsed {
|
||||
grid-template-rows: auto 0 minmax(150px, var(--stash-panel-height, 170px)) 14px minmax(220px, 1fr);
|
||||
}
|
||||
.left-sidebar.explorer-collapsed {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 230px)) 14px minmax(150px, var(--stash-panel-height, 170px)) 0 auto;
|
||||
}
|
||||
.left-sidebar.branch-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: auto 0 auto 0 minmax(220px, 1fr);
|
||||
}
|
||||
.left-sidebar.explorer-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 230px)) 14px auto 0 auto;
|
||||
}
|
||||
.left-sidebar.branch-collapsed.explorer-collapsed {
|
||||
grid-template-rows: auto 0 minmax(150px, var(--stash-panel-height, 170px)) 0 auto;
|
||||
}
|
||||
.left-sidebar.branch-collapsed.explorer-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: auto 0 auto 0 auto;
|
||||
align-content: start;
|
||||
}
|
||||
.section-head { min-height: 40px; padding: 6px 10px; }
|
||||
.repo-summary { height: 40px; padding: 0 10px; }
|
||||
.repo-branch { max-width: 160px; }
|
||||
@@ -4297,9 +4460,35 @@
|
||||
body { overflow: auto; }
|
||||
.shell-body { min-height: 100%; gap: 6px; }
|
||||
.workspace { grid-template-columns: 1fr; gap: 6px; }
|
||||
.left-sidebar-resize-handle { display: none; }
|
||||
.history-aside { grid-template-columns: 1fr; grid-template-rows: minmax(200px, 1fr) minmax(150px, 0.5fr); min-height: 380px; }
|
||||
.left-sidebar { grid-template-rows: minmax(180px, 0.9fr) minmax(150px, 0.55fr) minmax(220px, 1fr); min-height: 560px; }
|
||||
.left-sidebar:has(.stash-panel.collapsed) { grid-template-rows: minmax(180px, 1fr) auto minmax(220px, 1.1fr); }
|
||||
.history-aside.file-history-collapsed { grid-template-rows: minmax(200px, 1fr) 42px; }
|
||||
.left-sidebar {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 240px)) 14px minmax(150px, var(--stash-panel-height, 180px)) 14px minmax(220px, 1fr);
|
||||
min-height: 560px;
|
||||
}
|
||||
.left-sidebar:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: minmax(180px, var(--branch-panel-height, 240px)) 14px auto 0 minmax(220px, 1fr);
|
||||
}
|
||||
.left-sidebar.branch-collapsed {
|
||||
grid-template-rows: auto 0 minmax(150px, var(--stash-panel-height, 180px)) 14px minmax(220px, 1fr);
|
||||
}
|
||||
.left-sidebar.explorer-collapsed {
|
||||
grid-template-rows: minmax(120px, var(--branch-panel-height, 240px)) 14px minmax(150px, var(--stash-panel-height, 180px)) 0 auto;
|
||||
}
|
||||
.left-sidebar.branch-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: auto 0 auto 0 minmax(0, 1fr);
|
||||
}
|
||||
.left-sidebar.explorer-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: minmax(120px, var(--branch-panel-height, 240px)) 14px auto 0 auto;
|
||||
}
|
||||
.left-sidebar.branch-collapsed.explorer-collapsed {
|
||||
grid-template-rows: auto 0 minmax(150px, var(--stash-panel-height, 180px)) 0 auto;
|
||||
}
|
||||
.left-sidebar.branch-collapsed.explorer-collapsed:has(.stash-panel.collapsed) {
|
||||
grid-template-rows: auto 0 auto 0 auto;
|
||||
align-content: start;
|
||||
}
|
||||
.top-section { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 14px var(--commit-panel-height, 190px); }
|
||||
.repo-form { grid-template-columns: 1fr; }
|
||||
.repo-tabbar { grid-template-columns: minmax(0, 1fr) auto; }
|
||||
@@ -4322,7 +4511,7 @@
|
||||
.dialog-body { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 0.4fr) minmax(0, 1fr); }
|
||||
.compare-dialog .dialog-body { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 0.4fr) minmax(0, 1fr); }
|
||||
.global-search-options { grid-template-columns: 1fr; }
|
||||
.file-search-split { grid-template-columns: 1fr; grid-template-rows: minmax(150px, 0.9fr) minmax(220px, 1fr); }
|
||||
.file-search-split { grid-template-columns: 1fr; grid-template-rows: minmax(150px, 0.9fr) minmax(0, 1fr); }
|
||||
.file-search-column { border-right: none; border-bottom: 1px solid var(--color-border-subtle); }
|
||||
.file-search-hit { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
|
||||
.file-search-hit .status-badge,
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
onCreateTag: (name: string, message: string) => void | Promise<void>;
|
||||
onDeleteTag: (tag: GitTag) => void | Promise<void>;
|
||||
onPushTag: (tag: GitTag) => void | Promise<void>;
|
||||
collapsed?: boolean;
|
||||
onToggleCollapsed?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -75,6 +77,8 @@
|
||||
onCreateTag = () => {},
|
||||
onDeleteTag = () => {},
|
||||
onPushTag = () => {},
|
||||
collapsed = false,
|
||||
onToggleCollapsed = () => {},
|
||||
}: Props = $props();
|
||||
|
||||
let localOpen = $state(true);
|
||||
@@ -355,7 +359,7 @@
|
||||
|
||||
<svelte:window on:click={closeAllContextMenus} on:keydown={handleWindowKeydown} on:contextmenu|capture={closeAllContextMenus} />
|
||||
|
||||
<section bind:this={panelElement} class="panel branch-panel grid grid-rows-[auto_1fr] overflow-hidden" aria-label="Branches">
|
||||
<section bind:this={panelElement} class="panel branch-panel grid grid-rows-[auto_1fr] overflow-hidden" class:collapsed aria-label="Branches">
|
||||
<div class="section-head">
|
||||
<div>
|
||||
<span class="eyebrow">Branches</span>
|
||||
@@ -373,10 +377,26 @@
|
||||
<Plus size={14} aria-hidden="true" />
|
||||
</button>
|
||||
<span class="pill pill-count">{branches.length}</span>
|
||||
<button
|
||||
class="branch-create-toggle panel-collapse-toggle"
|
||||
type="button"
|
||||
onclick={onToggleCollapsed}
|
||||
aria-expanded={!collapsed}
|
||||
title={collapsed ? "Expand branches" : "Collapse branches"}
|
||||
aria-label={collapsed ? "Expand branches panel" : "Collapse branches panel"}
|
||||
>
|
||||
{#if collapsed}
|
||||
<ChevronRight size={14} aria-hidden="true" />
|
||||
{:else}
|
||||
<ChevronDown size={14} aria-hidden="true" />
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if !hasRepository}
|
||||
{#if collapsed}
|
||||
<!-- collapsed -->
|
||||
{:else if !hasRepository}
|
||||
<p class="blank-state">Open a repository to list branches.</p>
|
||||
{:else if branches.length === 0 && tags.length === 0}
|
||||
<p class="blank-state">No branches returned.</p>
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
onSelectNode: (node: ExplorerNode) => void;
|
||||
onOpenFile: (node: ExplorerNode) => void;
|
||||
onBlame: (node: ExplorerNode) => void;
|
||||
collapsed?: boolean;
|
||||
onToggleCollapsed?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -53,6 +55,8 @@
|
||||
onSelectNode = () => {},
|
||||
onOpenFile = () => {},
|
||||
onBlame = () => {},
|
||||
collapsed = false,
|
||||
onToggleCollapsed = () => {},
|
||||
}: Props = $props();
|
||||
|
||||
let contextNode = $state<ExplorerNode | null>(null);
|
||||
@@ -203,7 +207,7 @@
|
||||
|
||||
<svelte:window on:click={closeFileContextMenu} on:keydown={handleWindowKeydown} on:contextmenu|capture={closeFileContextMenu} />
|
||||
|
||||
<section class="panel explorer-panel grid grid-rows-[auto_1fr] overflow-hidden" aria-label="File explorer">
|
||||
<section class="panel explorer-panel grid grid-rows-[auto_1fr] overflow-hidden" class:collapsed aria-label="File explorer">
|
||||
<div class="section-head">
|
||||
<div>
|
||||
<span class="eyebrow">Explorer</span>
|
||||
@@ -231,10 +235,26 @@
|
||||
<Folder size={14} aria-hidden="true" />
|
||||
</button>
|
||||
<span class="pill pill-count">{repoFiles.length}</span>
|
||||
<button
|
||||
class="explorer-bulk-button panel-collapse-toggle"
|
||||
type="button"
|
||||
onclick={onToggleCollapsed}
|
||||
aria-expanded={!collapsed}
|
||||
title={collapsed ? "Expand file explorer" : "Collapse file explorer"}
|
||||
aria-label={collapsed ? "Expand file explorer panel" : "Collapse file explorer panel"}
|
||||
>
|
||||
{#if collapsed}
|
||||
<ChevronRight size={14} aria-hidden="true" />
|
||||
{:else}
|
||||
<ChevronDown size={14} aria-hidden="true" />
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if !hasRepository}
|
||||
{#if collapsed}
|
||||
<!-- collapsed -->
|
||||
{:else if !hasRepository}
|
||||
<p class="blank-state">Open a repository to browse files.</p>
|
||||
{:else if repoFiles.length === 0}
|
||||
<p class="blank-state">No files returned.</p>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { GitCompare, History, RotateCcw } from "@lucide/svelte";
|
||||
import { ChevronLeft, ChevronRight, GitCompare, History, RotateCcw } from "@lucide/svelte";
|
||||
import iconUrl from "../../../src-tauri/icons/icon.png";
|
||||
import type { GitCommit } from "../types";
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
isLoading?: boolean;
|
||||
onDiff: (commit: GitCommit) => void;
|
||||
onRestore: (commit: GitCommit) => void;
|
||||
collapsed?: boolean;
|
||||
onToggleCollapsed?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -23,6 +25,8 @@
|
||||
isLoading = false,
|
||||
onDiff = () => {},
|
||||
onRestore = () => {},
|
||||
collapsed = false,
|
||||
onToggleCollapsed = () => {},
|
||||
}: Props = $props();
|
||||
|
||||
function formatCommitDate(value: string): string {
|
||||
@@ -76,7 +80,23 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<section class="panel grid grid-rows-[auto_1fr] overflow-hidden" aria-label="Selected file history">
|
||||
<section class="panel file-history-panel grid grid-rows-[auto_1fr] overflow-hidden" class:collapsed aria-label="Selected file history">
|
||||
{#if collapsed}
|
||||
<button
|
||||
class="file-history-rail-toggle"
|
||||
type="button"
|
||||
onclick={onToggleCollapsed}
|
||||
aria-expanded={!collapsed}
|
||||
title="Expand file history"
|
||||
aria-label="Expand file history panel"
|
||||
>
|
||||
<ChevronLeft size={16} aria-hidden="true" />
|
||||
<span>File history</span>
|
||||
{#if selectedExplorerPath}
|
||||
<small>{fileHistory.length}</small>
|
||||
{/if}
|
||||
</button>
|
||||
{:else}
|
||||
<div class="section-head file-history-head">
|
||||
<div class="file-history-heading">
|
||||
<span class="eyebrow">{selectedExplorerLabel}</span>
|
||||
@@ -85,7 +105,19 @@
|
||||
use:pathTooltip={selectedExplorerPath}
|
||||
>{selectedExplorerPath ? fileName(selectedExplorerPath) : "No file"}</h2>
|
||||
</div>
|
||||
<div class="file-history-head-actions">
|
||||
<span class="pill pill-count file-history-count">{fileHistory.length}</span>
|
||||
<button
|
||||
class="file-history-toggle panel-collapse-toggle"
|
||||
type="button"
|
||||
onclick={onToggleCollapsed}
|
||||
aria-expanded={!collapsed}
|
||||
title="Collapse file history"
|
||||
aria-label="Collapse file history panel"
|
||||
>
|
||||
<ChevronRight size={14} aria-hidden="true" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if !hasRepository}
|
||||
@@ -136,4 +168,5 @@
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
onApply: (stash: GitStash) => void;
|
||||
onPop: (stash: GitStash) => void;
|
||||
onDrop: (stash: GitStash) => void;
|
||||
collapsed?: boolean;
|
||||
onToggleCollapsed?: () => void;
|
||||
}
|
||||
|
||||
let {
|
||||
@@ -22,11 +24,12 @@
|
||||
onApply = () => {},
|
||||
onPop = () => {},
|
||||
onDrop = () => {},
|
||||
collapsed = false,
|
||||
onToggleCollapsed = () => {},
|
||||
}: Props = $props();
|
||||
|
||||
let message = $state("");
|
||||
let includeUntracked = $state(true);
|
||||
let open = $state(false);
|
||||
|
||||
function submitPush() {
|
||||
onPush(message, includeUntracked);
|
||||
@@ -38,31 +41,32 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<section class="panel stash-panel overflow-hidden" class:collapsed={!open} aria-label="Git stash">
|
||||
<section class="panel stash-panel overflow-hidden" class:collapsed aria-label="Git stash">
|
||||
<div class="section-head">
|
||||
<div>
|
||||
<span class="eyebrow">Stash</span>
|
||||
<h2 class="mt-0.5 text-ink text-base font-bold leading-tight">Shelved changes</h2>
|
||||
</div>
|
||||
<div class="stash-head-actions">
|
||||
<span class="pill pill-count">{stashes.length}</span>
|
||||
<button
|
||||
class="stash-toggle"
|
||||
class="stash-toggle panel-collapse-toggle"
|
||||
type="button"
|
||||
onclick={() => { open = !open; }}
|
||||
aria-expanded={open}
|
||||
title={open ? "Collapse stash panel" : "Expand stash panel"}
|
||||
onclick={onToggleCollapsed}
|
||||
aria-expanded={!collapsed}
|
||||
title={collapsed ? "Expand stash panel" : "Collapse stash panel"}
|
||||
aria-label={collapsed ? "Expand stash panel" : "Collapse stash panel"}
|
||||
>
|
||||
{#if open}
|
||||
<ChevronDown size={14} aria-hidden="true" />
|
||||
{:else}
|
||||
{#if collapsed}
|
||||
<ChevronRight size={14} aria-hidden="true" />
|
||||
{:else}
|
||||
<ChevronDown size={14} aria-hidden="true" />
|
||||
{/if}
|
||||
</button>
|
||||
<span class="pill pill-count">{stashes.length}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{#if !open}
|
||||
{#if collapsed}
|
||||
<!-- collapsed -->
|
||||
{:else if !hasRepository}
|
||||
<div class="blank-state">No repository loaded.</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { Check, FileDiff, RotateCcw, Undo2 } from "@lucide/svelte";
|
||||
import iconUrl from "../../../src-tauri/icons/icon.png";
|
||||
import type { FileStatusKind, GitFileStatus, GitStatus } from "../types";
|
||||
|
||||
interface Props {
|
||||
@@ -8,11 +9,12 @@
|
||||
unstagedCount: number;
|
||||
hasRepository: boolean;
|
||||
isBusy: boolean;
|
||||
operation: string;
|
||||
status: GitStatus | null;
|
||||
selectedFilePath: string;
|
||||
onSelectFile: (file: GitFileStatus) => void;
|
||||
onStage: (file: GitFileStatus) => void;
|
||||
onUnstage: (file: GitFileStatus) => void;
|
||||
onStage: (files: GitFileStatus[]) => void;
|
||||
onUnstage: (files: GitFileStatus[]) => void;
|
||||
onDiscard: (file: GitFileStatus, staged: boolean) => void;
|
||||
onPatch: (file: GitFileStatus, staged: boolean) => void;
|
||||
onStageAll: () => void;
|
||||
@@ -25,6 +27,7 @@
|
||||
unstagedCount = 0,
|
||||
hasRepository = false,
|
||||
isBusy = false,
|
||||
operation = "",
|
||||
status = null,
|
||||
selectedFilePath = "",
|
||||
onSelectFile = () => {},
|
||||
@@ -56,11 +59,87 @@
|
||||
return kind === "modified";
|
||||
}
|
||||
|
||||
function fileKey(file: GitFileStatus): string {
|
||||
return `${file.old_path ?? ""}:${file.path}`;
|
||||
}
|
||||
|
||||
let selectedStatusPaths = $state<Set<string>>(new Set());
|
||||
let selectionAnchorKey = $state("");
|
||||
|
||||
function isStatusSelected(file: GitFileStatus): boolean {
|
||||
return selectedStatusPaths.has(fileKey(file));
|
||||
}
|
||||
|
||||
function selectedFiles(): GitFileStatus[] {
|
||||
return changedFiles.filter((file) => selectedStatusPaths.has(fileKey(file)));
|
||||
}
|
||||
|
||||
function selectedStageTargets(file: GitFileStatus): GitFileStatus[] {
|
||||
const files = isStatusSelected(file) ? selectedFiles() : [file];
|
||||
return files.filter((item) => item.unstaged !== null);
|
||||
}
|
||||
|
||||
function selectedUnstageTargets(file: GitFileStatus): GitFileStatus[] {
|
||||
const files = isStatusSelected(file) ? selectedFiles() : [file];
|
||||
return files.filter((item) => item.staged !== null);
|
||||
}
|
||||
|
||||
function handleFileSelect(event: MouseEvent, file: GitFileStatus) {
|
||||
const key = fileKey(file);
|
||||
const allKeys = changedFiles.map(fileKey);
|
||||
const next = new Set(selectedStatusPaths);
|
||||
|
||||
if (event.shiftKey && selectionAnchorKey) {
|
||||
const anchorIndex = allKeys.indexOf(selectionAnchorKey);
|
||||
const currentIndex = allKeys.indexOf(key);
|
||||
if (anchorIndex >= 0 && currentIndex >= 0) {
|
||||
const start = Math.min(anchorIndex, currentIndex);
|
||||
const end = Math.max(anchorIndex, currentIndex);
|
||||
for (const itemKey of allKeys.slice(start, end + 1)) next.add(itemKey);
|
||||
} else {
|
||||
next.add(key);
|
||||
}
|
||||
} else if (event.ctrlKey || event.metaKey) {
|
||||
if (next.has(key)) next.delete(key);
|
||||
else next.add(key);
|
||||
selectionAnchorKey = key;
|
||||
} else {
|
||||
next.clear();
|
||||
next.add(key);
|
||||
selectionAnchorKey = key;
|
||||
}
|
||||
|
||||
selectedStatusPaths = next;
|
||||
onSelectFile(file);
|
||||
}
|
||||
|
||||
function stageFromFile(file: GitFileStatus) {
|
||||
const targets = selectedStageTargets(file);
|
||||
if (targets.length === 0) return;
|
||||
onStage(targets);
|
||||
}
|
||||
|
||||
function unstageFromFile(file: GitFileStatus) {
|
||||
const targets = selectedUnstageTargets(file);
|
||||
if (targets.length === 0) return;
|
||||
onUnstage(targets);
|
||||
}
|
||||
|
||||
let hasUnstaged = $derived(changedFiles.some((f) => f.unstaged !== null));
|
||||
let hasStaged = $derived(changedFiles.some((f) => f.staged !== null));
|
||||
let selectedCount = $derived(changedFiles.filter((f) => selectedStatusPaths.has(fileKey(f))).length);
|
||||
let selectedUnstagedCount = $derived(changedFiles.filter((f) => selectedStatusPaths.has(fileKey(f)) && f.unstaged !== null).length);
|
||||
let selectedStagedCount = $derived(changedFiles.filter((f) => selectedStatusPaths.has(fileKey(f)) && f.staged !== null).length);
|
||||
|
||||
$effect(() => {
|
||||
const validKeys = new Set(changedFiles.map(fileKey));
|
||||
const next = new Set([...selectedStatusPaths].filter((key) => validKeys.has(key)));
|
||||
if (next.size !== selectedStatusPaths.size) selectedStatusPaths = next;
|
||||
if (selectionAnchorKey && !validKeys.has(selectionAnchorKey)) selectionAnchorKey = "";
|
||||
});
|
||||
</script>
|
||||
|
||||
<section class="panel grid grid-rows-[auto_auto_1fr] overflow-hidden" aria-label="Working tree status">
|
||||
<section class="panel relative grid grid-rows-[auto_auto_1fr] overflow-hidden" aria-label="Working tree status">
|
||||
<div class="section-head">
|
||||
<div>
|
||||
<span class="eyebrow">Working tree</span>
|
||||
@@ -94,6 +173,29 @@
|
||||
<Undo2 size={14} aria-hidden="true" />
|
||||
Unstage all
|
||||
</button>
|
||||
{#if selectedCount > 1}
|
||||
<span class="status-selection-count">{selectedCount} selected</span>
|
||||
<button
|
||||
class="btn-sm"
|
||||
type="button"
|
||||
onclick={() => onStage(changedFiles.filter((file) => selectedStatusPaths.has(fileKey(file)) && file.unstaged !== null))}
|
||||
disabled={isBusy || selectedUnstagedCount === 0}
|
||||
title="Stage selected unstaged files"
|
||||
>
|
||||
<Check size={14} aria-hidden="true" />
|
||||
Stage selected
|
||||
</button>
|
||||
<button
|
||||
class="btn-sm"
|
||||
type="button"
|
||||
onclick={() => onUnstage(changedFiles.filter((file) => selectedStatusPaths.has(fileKey(file)) && file.staged !== null))}
|
||||
disabled={isBusy || selectedStagedCount === 0}
|
||||
title="Unstage selected staged files"
|
||||
>
|
||||
<Undo2 size={14} aria-hidden="true" />
|
||||
Unstage selected
|
||||
</button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -108,13 +210,14 @@
|
||||
{#each changedFiles as file (`${file.old_path ?? ""}:${file.path}`)}
|
||||
<article
|
||||
class="file-row"
|
||||
class:selected={selectedFilePath === file.path}
|
||||
class:selected={isStatusSelected(file)}
|
||||
class:active={selectedFilePath === file.path}
|
||||
>
|
||||
<div class="file-title">
|
||||
<button
|
||||
class="file-title-button"
|
||||
type="button"
|
||||
onclick={() => onSelectFile(file)}
|
||||
onclick={(event) => handleFileSelect(event, file)}
|
||||
title={`Select ${displayPath(file)} in Explorer`}
|
||||
>
|
||||
<strong>{fileName(file)}</strong>
|
||||
@@ -129,9 +232,10 @@
|
||||
</div>
|
||||
<div class="lane-actions">
|
||||
{#if file.staged}
|
||||
<button class="btn-sm" type="button" onclick={() => onUnstage(file)} disabled={isBusy} title="Unstage file">
|
||||
{@const unstageTargets = selectedUnstageTargets(file)}
|
||||
<button class="btn-sm" type="button" onclick={() => unstageFromFile(file)} disabled={isBusy || unstageTargets.length === 0} title={unstageTargets.length > 1 ? `Unstage ${unstageTargets.length} selected files` : "Unstage file"}>
|
||||
<Undo2 size={14} aria-hidden="true" />
|
||||
Unstage
|
||||
{unstageTargets.length > 1 ? `Unstage ${unstageTargets.length}` : "Unstage"}
|
||||
</button>
|
||||
<button class="btn-sm" type="button" onclick={() => onPatch(file, true)} disabled={isBusy || !canPatch(file.staged)} title="Stage, unstage, or discard selected lines">
|
||||
<FileDiff size={14} aria-hidden="true" />
|
||||
@@ -154,9 +258,10 @@
|
||||
</div>
|
||||
<div class="lane-actions">
|
||||
{#if file.unstaged}
|
||||
<button class="btn-sm" type="button" onclick={() => onStage(file)} disabled={isBusy} title="Stage file">
|
||||
{@const stageTargets = selectedStageTargets(file)}
|
||||
<button class="btn-sm" type="button" onclick={() => stageFromFile(file)} disabled={isBusy || stageTargets.length === 0} title={stageTargets.length > 1 ? `Stage ${stageTargets.length} selected files` : "Stage file"}>
|
||||
<Check size={14} aria-hidden="true" />
|
||||
Stage
|
||||
{stageTargets.length > 1 ? `Stage ${stageTargets.length}` : "Stage"}
|
||||
</button>
|
||||
<button class="btn-sm" type="button" onclick={() => onPatch(file, false)} disabled={isBusy || !canPatch(file.unstaged)} title="Stage or discard selected lines">
|
||||
<FileDiff size={14} aria-hidden="true" />
|
||||
@@ -176,4 +281,177 @@
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if isBusy && hasRepository}
|
||||
<div class="status-panel-overlay" role="status" aria-live="polite">
|
||||
<div class="status-panel-overlay-card">
|
||||
<div class="status-panel-overlay-mark">
|
||||
<span class="status-panel-overlay-halo halo-one"></span>
|
||||
<span class="status-panel-overlay-halo halo-two"></span>
|
||||
<svg class="status-panel-overlay-traces" viewBox="0 0 220 220" aria-hidden="true">
|
||||
<path class="trace trace-main" d="M28 154 C72 114, 88 108, 110 110 S156 116, 192 68" />
|
||||
<path class="trace trace-branch" d="M62 74 C100 88, 126 124, 158 166" />
|
||||
<path class="trace trace-cut" d="M46 180 L174 180" />
|
||||
</svg>
|
||||
<img src={iconUrl} alt="" class="status-panel-overlay-icon" />
|
||||
</div>
|
||||
<span class="status-panel-overlay-label">{operation || "Working"}…</span>
|
||||
<div class="status-panel-overlay-bar"><span></span></div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<style>
|
||||
.status-panel-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
z-index: 20;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
background:
|
||||
radial-gradient(circle at 50% 38%, rgba(137, 92, 255, 0.16), transparent 55%),
|
||||
rgba(8, 9, 16, 0.58);
|
||||
backdrop-filter: blur(4px);
|
||||
animation: status-panel-overlay-in 120ms ease;
|
||||
}
|
||||
|
||||
.status-panel-overlay-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
width: min(300px, calc(100% - 32px));
|
||||
padding: 26px 28px 26px;
|
||||
border: 1px solid rgba(160, 124, 255, 0.24);
|
||||
border-radius: 16px;
|
||||
background:
|
||||
linear-gradient(180deg, rgba(23, 26, 43, 0.9), rgba(12, 15, 27, 0.92)),
|
||||
var(--color-surface-raised);
|
||||
color: var(--color-ink);
|
||||
box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.status-panel-overlay-mark {
|
||||
position: relative;
|
||||
width: 104px;
|
||||
height: 104px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
.status-panel-overlay-halo {
|
||||
position: absolute;
|
||||
inset: 6px;
|
||||
border: 1px solid rgba(151, 118, 255, 0.24);
|
||||
border-radius: 22px;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
.status-panel-overlay-halo.halo-one {
|
||||
animation: status-panel-overlay-halo-breathe 2.4s ease-in-out infinite;
|
||||
}
|
||||
.status-panel-overlay-halo.halo-two {
|
||||
inset: 16px;
|
||||
border-color: rgba(255, 109, 38, 0.26);
|
||||
animation: status-panel-overlay-halo-breathe 2.4s ease-in-out infinite reverse;
|
||||
}
|
||||
|
||||
.status-panel-overlay-traces {
|
||||
position: absolute;
|
||||
inset: -12px;
|
||||
width: 128px;
|
||||
height: 128px;
|
||||
overflow: visible;
|
||||
z-index: 0;
|
||||
}
|
||||
.status-panel-overlay-traces .trace {
|
||||
fill: none;
|
||||
stroke-width: 3;
|
||||
stroke-linecap: round;
|
||||
stroke-dasharray: 165;
|
||||
stroke-dashoffset: 165;
|
||||
filter: drop-shadow(0 0 6px rgba(151, 118, 255, 0.55));
|
||||
animation: status-panel-overlay-trace-draw 2.6s ease-in-out infinite;
|
||||
}
|
||||
.status-panel-overlay-traces .trace-main { stroke: #9b70ff; }
|
||||
.status-panel-overlay-traces .trace-branch {
|
||||
stroke: #ff6d26;
|
||||
animation-delay: 0.28s;
|
||||
}
|
||||
.status-panel-overlay-traces .trace-cut {
|
||||
stroke: rgba(255, 255, 255, 0.42);
|
||||
stroke-dasharray: 128;
|
||||
stroke-dashoffset: 128;
|
||||
animation-delay: 0.55s;
|
||||
}
|
||||
|
||||
.status-panel-overlay-icon {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
object-fit: contain;
|
||||
filter:
|
||||
drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5))
|
||||
drop-shadow(0 0 10px rgba(151, 118, 255, 0.28));
|
||||
animation: status-panel-overlay-icon-float 2.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.status-panel-overlay-label {
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
color: var(--color-ink);
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.status-panel-overlay-bar {
|
||||
position: relative;
|
||||
width: min(190px, 100%);
|
||||
height: 4px;
|
||||
overflow: hidden;
|
||||
border-radius: 999px;
|
||||
background: rgba(151, 118, 255, 0.14);
|
||||
}
|
||||
.status-panel-overlay-bar span {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 46%;
|
||||
border-radius: inherit;
|
||||
background: linear-gradient(90deg, transparent, #9b70ff 40%, #ff6d26 74%, transparent);
|
||||
box-shadow: 0 0 12px rgba(255, 109, 38, 0.32);
|
||||
animation: status-panel-overlay-bar-slide 1.35s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes status-panel-overlay-in { from { opacity: 0; } to { opacity: 1; } }
|
||||
@keyframes status-panel-overlay-icon-float {
|
||||
0%, 100% { transform: translateY(0) scale(1); }
|
||||
50% { transform: translateY(-3px) scale(1.015); }
|
||||
}
|
||||
@keyframes status-panel-overlay-halo-breathe {
|
||||
0%, 100% { opacity: 0.35; transform: rotate(45deg) scale(0.95); }
|
||||
50% { opacity: 0.8; transform: rotate(45deg) scale(1.04); }
|
||||
}
|
||||
@keyframes status-panel-overlay-bar-slide {
|
||||
0% { transform: translateX(-120%); }
|
||||
100% { transform: translateX(320%); }
|
||||
}
|
||||
@keyframes status-panel-overlay-trace-draw {
|
||||
0% { stroke-dashoffset: 165; opacity: 0; }
|
||||
36% { opacity: 1; }
|
||||
64%, 100% { stroke-dashoffset: 0; opacity: 0.72; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.status-panel-overlay,
|
||||
.status-panel-overlay-halo,
|
||||
.status-panel-overlay-traces .trace,
|
||||
.status-panel-overlay-icon,
|
||||
.status-panel-overlay-bar span { animation: none; }
|
||||
.status-panel-overlay-traces .trace { stroke-dashoffset: 0; opacity: 0.72; }
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user