From 254c59291367f9860d45b3da0678a2fd44bd35c8 Mon Sep 17 00:00:00 2001 From: Danyal Ahmed <58849388+danyalahmed1995@users.noreply.github.com> Date: Sat, 13 Jun 2026 04:10:02 +0500 Subject: [PATCH] Fixed workspace/file-list header wrapping for names with spaces. --- src-tauri/src/lib.rs | 14 +++++++------- src/components/file-list/FileList.css | 7 +++++++ src/components/file-list/FileList.tsx | 2 +- src/components/sidebar/Sidebar.css | 2 ++ src/components/sidebar/Sidebar.tsx | 4 ++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 8c9603c..0d888a0 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -1295,11 +1295,7 @@ pub struct GitStatus { #[tauri::command] fn fetch_git_status(file_path: String) -> Option { let path = Path::new(&file_path); - let current_dir = if path.is_file() { - path.parent()? - } else { - path - }; + let current_dir = if path.is_file() { path.parent()? } else { path }; let mut repo_root = None; for curr in current_dir.ancestors() { @@ -1323,7 +1319,9 @@ fn fetch_git_status(file_path: String) -> Option { return None; } - let mut branch_name = String::from_utf8_lossy(&branch_output.stdout).trim().to_string(); + let mut branch_name = String::from_utf8_lossy(&branch_output.stdout) + .trim() + .to_string(); if branch_name == "HEAD" { // detached HEAD, get short hash @@ -1335,7 +1333,9 @@ fn fetch_git_status(file_path: String) -> Option { .output() .ok()?; if hash_output.status.success() { - let short_hash = String::from_utf8_lossy(&hash_output.stdout).trim().to_string(); + let short_hash = String::from_utf8_lossy(&hash_output.stdout) + .trim() + .to_string(); branch_name = format!("detached: {}", short_hash); } } diff --git a/src/components/file-list/FileList.css b/src/components/file-list/FileList.css index ca55141..bc5592e 100644 --- a/src/components/file-list/FileList.css +++ b/src/components/file-list/FileList.css @@ -32,12 +32,17 @@ display: flex; align-items: center; gap: var(--space-sm); + min-width: 0; } .file-list-title { font-size: var(--font-size-md); font-weight: var(--font-weight-semibold); color: var(--color-text-primary); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; } .file-list-count { @@ -46,6 +51,7 @@ background: var(--color-surface-elevated); padding: 2px 8px; border-radius: var(--radius-pill); + flex-shrink: 0; } .file-list-sort { @@ -61,6 +67,7 @@ background: none; border: none; font-family: var(--font-ui); + flex-shrink: 0; } .file-list-sort:hover { diff --git a/src/components/file-list/FileList.tsx b/src/components/file-list/FileList.tsx index 76362a5..a064704 100644 --- a/src/components/file-list/FileList.tsx +++ b/src/components/file-list/FileList.tsx @@ -299,7 +299,7 @@ export const FileList: React.FC = React.memo(({ {/* Header */}
- {title} + {title} {files.length}
diff --git a/src/components/sidebar/Sidebar.css b/src/components/sidebar/Sidebar.css index 348189d..3360128 100644 --- a/src/components/sidebar/Sidebar.css +++ b/src/components/sidebar/Sidebar.css @@ -194,6 +194,7 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; + min-width: 0; } .sidebar-item-count { @@ -283,6 +284,7 @@ overflow: hidden; text-overflow: ellipsis; font-weight: var(--font-weight-medium); + min-width: 0; } .workspace-item-chevron { diff --git a/src/components/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx index 0d7a31c..c69b97a 100644 --- a/src/components/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -125,7 +125,7 @@ const SmartViewItem: React.FC = ({ onClick={onClick} > {icon} - {label} + {label} {count}
); @@ -179,7 +179,7 @@ const WorkspaceItem: React.FC = ({ {getWorkspaceIcon(detectedIcon)} - {name} + {name}