Major UI refresh: sidebar redesign, theme expansion, and chat performance optimizations (#706)

## Summary
Complete sidebar redesign and comprehensive UI polish pass with performance optimizations, theme system refinements, and desktop integration improvements.

## Key Changes

**Sidebar & Navigation Redesign**
- Redesigned sessions sidebar layout with unified button primitives
- Added activity sections with project grouping and improved session organization
- Refined sidebar corners, spacing, and visual hierarchy
- Removed NavRail component in favor of streamlined sidebar
- Stabilized sessions bar toggle position in fullscreen mode

**Performance Optimizations**
- Reduced chat streaming CPU usage and storage churn
- Optimized task tool polling and live timers with debouncing
- Prevented chat state races and reduced background request load
- Debounced draft writes and coalesced session reloads
- Optimized message store updates and turn tracking

**Theme & Visual System**
- Added theme-aware window corners (desktop) and border radius tokens
- Introduced glassmorphism effects on desktop sidebar
- Added backdrop blur to UI elements

**Chat Experience**
- Added session-based permission auto-accept toggle in chat input
- Polished permission shield UX with improved icon sizing and spacing
- Fixed chat scroll-to-bottom behavior and timeline tracking
- Enhanced tool output display with better path label detection
- Removed duplicate draft context details in chat header
- Added text selection menu to chat messages

**Git Improvements**
- Refreshed git history visual design with cleaner dividers
- Added remote removal action in sync selector
- Stabilized git polling to prevent excessive requests
- Improved tool output rendering for git operations

**Settings & Panels**
- Fixed mobile scrolling on settings pages
- Made outside-click settings close instantly
- Reduced settings load churn and CPU spikes
- Improved services dropdown layout and spacing
- Softened panel resize handles

**Desktop Integration**
- Synced macOS window theme with app theme
- Restored window dragging in sidebar header zones
- Fixed system window corners on macOS
- Improved header session metadata and action controls

**Button & Component Standardization**
- Unified button primitives across all components
- Standardized destructive action patterns
- Removed unused button variants (button-large, button-small)
- Aligned context tab close hit areas

---------

Co-authored-by: Iuliia Ivashko <yulia.ivashko@gmail.com>
This commit is contained in:
Bohdan Triapitsyn
2026-03-20 01:01:03 +02:00
committed by GitHub
co-authored by Iuliia Ivashko
parent 359879153a
commit 321cc7252a
222 changed files with 8575 additions and 5456 deletions
+83
View File
@@ -24,6 +24,10 @@ use std::{
};
use tauri::utils::config::BackgroundThrottlingPolicy;
use tauri::{Emitter, Manager, WebviewUrl, WebviewWindowBuilder};
#[cfg(target_os = "macos")]
use window_vibrancy::{
apply_vibrancy, clear_vibrancy, NSVisualEffectMaterial,
};
/// Global counter for generating unique window labels.
static WINDOW_COUNTER: AtomicU64 = AtomicU64::new(1);
@@ -2358,6 +2362,78 @@ fn build_init_script(local_origin: &str) -> String {
init_script
}
fn parse_theme_override(theme_mode: Option<&str>, theme_variant: Option<&str>) -> Option<tauri::Theme> {
match theme_mode.map(str::trim) {
Some("system") => None,
Some("dark") => Some(tauri::Theme::Dark),
Some("light") => Some(tauri::Theme::Light),
_ => match theme_variant.map(str::trim) {
Some("dark") => Some(tauri::Theme::Dark),
Some("light") => Some(tauri::Theme::Light),
_ => None,
},
}
}
fn read_desktop_theme_override() -> Option<tauri::Theme> {
let settings = fs::read_to_string(settings_file_path())
.ok()
.and_then(|raw| serde_json::from_str::<serde_json::Value>(&raw).ok());
let use_system_theme = settings
.as_ref()
.and_then(|value| value.get("useSystemTheme"))
.and_then(|value| value.as_bool());
if matches!(use_system_theme, Some(true)) {
return None;
}
let theme_mode = settings
.as_ref()
.and_then(|value| value.get("themeMode"))
.and_then(|value| value.as_str());
let theme_variant = settings
.as_ref()
.and_then(|value| value.get("themeVariant"))
.and_then(|value| value.as_str());
parse_theme_override(theme_mode, theme_variant)
}
#[cfg(target_os = "macos")]
fn apply_macos_window_vibrancy(window: &tauri::WebviewWindow) {
let _ = clear_vibrancy(window);
if let Err(error) = apply_vibrancy(
window,
NSVisualEffectMaterial::Sidebar,
None,
None,
) {
log::warn!("[desktop:vibrancy] Failed to apply macOS vibrancy: {error}");
}
}
#[cfg(not(target_os = "macos"))]
fn apply_macos_window_vibrancy(_window: &tauri::WebviewWindow) {}
#[tauri::command]
fn desktop_set_window_theme(
window: tauri::WebviewWindow,
theme_mode: Option<String>,
theme_variant: Option<String>,
) -> Result<(), String> {
let override_theme = parse_theme_override(theme_mode.as_deref(), theme_variant.as_deref());
window
.set_theme(override_theme)
.map_err(|error| format!("failed to set window theme: {error}"))?;
Ok(())
}
fn is_window_state_visible(app: &tauri::AppHandle, state: &DesktopWindowState) -> bool {
if state.width == 0 || state.height == 0 {
return false;
@@ -2523,6 +2599,7 @@ fn create_window(
#[cfg(target_os = "macos")]
{
builder = builder
.transparent(true)
.hidden_title(true)
.title_bar_style(tauri::TitleBarStyle::Overlay)
.traffic_light_position(tauri::Position::Logical(tauri::LogicalPosition {
@@ -2532,6 +2609,8 @@ fn create_window(
}
let window = builder.build()?;
let _ = window.set_theme(read_desktop_theme_override());
apply_macos_window_vibrancy(&window);
if let Some(state) = restored_state.as_ref().filter(|_| apply_restored_state) {
if state.maximized || state.fullscreen {
@@ -2583,6 +2662,7 @@ fn create_startup_window(app: &tauri::AppHandle, restore_geometry: bool) -> Resu
#[cfg(target_os = "macos")]
{
builder = builder
.transparent(true)
.hidden_title(true)
.title_bar_style(tauri::TitleBarStyle::Overlay)
.traffic_light_position(tauri::Position::Logical(tauri::LogicalPosition {
@@ -2592,6 +2672,8 @@ fn create_startup_window(app: &tauri::AppHandle, restore_geometry: bool) -> Resu
}
let window = builder.build()?;
let _ = window.set_theme(read_desktop_theme_override());
apply_macos_window_vibrancy(&window);
if let Some(state) = restored_state.as_ref().filter(|_| apply_restored_state) {
if state.maximized || state.fullscreen {
@@ -3025,6 +3107,7 @@ fn main() {
desktop_hosts_get,
desktop_hosts_set,
desktop_host_probe,
desktop_set_window_theme,
remote_ssh::desktop_ssh_instances_get,
remote_ssh::desktop_ssh_instances_set,
remote_ssh::desktop_ssh_import_hosts,