perf: speed up desktop startup and unify theme-aware branding (#596)

* fix: unify startup logo and loading theme behavior

Show desktop window immediately with animated splash logo
Align splash/logo colors with selected app theme and default themes
Keep auth loading state on full-screen logo without size jump
Make project SVG icons follow active app theme
Use the active theme foreground color for project icons discovered from favicons
Apply server-side SVG color overrides for currentColor icons via icon request params
Keep non-SVG project icons unchanged while preserving existing fallback behavior

* perf: speed up desktop startup and unify loading logo visuals

Desktop startup now shows UI sooner while backend boot continues in background
Startup host probing uses a faster local path with safer remote fallback retries
OpenChamber logo cube highlights now match splash screens consistently

* fix: keep macOS traffic-light buttons in the correct position on load

Stop native window title updates on macOS during app initialization
Prevent title bar relayout that reset custom traffic-light positioning

* fix: recover missing providers and agents after fast startup

Retries provider/agent loading when connection is up but core config is still empty
Prevents cold-start state where models/agents appear only after manual project switch
Keeps startup responsive with throttled background recovery in app bootstrap
This commit is contained in:
Bohdan Triapitsyn
2026-03-04 19:16:45 +02:00
committed by GitHub
parent 037a70f114
commit d1a41000ca
22 changed files with 763 additions and 190 deletions
+47
View File
@@ -95,6 +95,10 @@ const readEmbeddedSessionChatConfig = (): EmbeddedSessionChatConfig | null => {
function App({ apis }: AppProps) {
const { initializeApp, isInitialized, isConnected } = useConfigStore();
const providersCount = useConfigStore((state) => state.providers.length);
const agentsCount = useConfigStore((state) => state.agents.length);
const loadProviders = useConfigStore((state) => state.loadProviders);
const loadAgents = useConfigStore((state) => state.loadAgents);
const { error, clearError, loadSessions } = useSessionStore();
const currentSessionId = useSessionStore((state) => state.currentSessionId);
const setCurrentSession = useSessionStore((state) => state.setCurrentSession);
@@ -194,6 +198,49 @@ function App({ apis }: AppProps) {
init();
}, [initializeApp, isVSCodeRuntime]);
const startupRecoveryInProgressRef = React.useRef(false);
const startupRecoveryLastAttemptRef = React.useRef(0);
React.useEffect(() => {
if (isVSCodeRuntime) {
return;
}
if (!isConnected) {
return;
}
if (providersCount > 0 && agentsCount > 0) {
return;
}
if (startupRecoveryInProgressRef.current) {
return;
}
const now = Date.now();
if (now - startupRecoveryLastAttemptRef.current < 750) {
return;
}
startupRecoveryLastAttemptRef.current = now;
startupRecoveryInProgressRef.current = true;
const repair = async () => {
try {
if (providersCount === 0) {
await loadProviders();
}
if (agentsCount === 0) {
await loadAgents();
}
} catch {
// Keep UI responsive; we'll retry on next cycle.
} finally {
startupRecoveryInProgressRef.current = false;
}
};
void repair();
}, [agentsCount, isConnected, isVSCodeRuntime, loadAgents, loadProviders, providersCount]);
React.useEffect(() => {
if (isSwitchingDirectory) {
return;