From f07a7b55a22a3f0668d6b15929a5a158401428ce Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 22 Apr 2026 23:26:35 +0200 Subject: [PATCH] auto-open project from cwd and show Claude as primary On desktop boot, main.dart calls project.open(cwd) to resolve the git root. If a project opens successfully, the workspace activates claude.primary instead of welcome. The _WorkspaceSlot now listens to ProjectManager: when isOpen, Claude is always the visible primary surface; when no project, welcome shows. This closes the gap where the app loaded the project root but still displayed the welcome screen as if no choice had been made. Co-Authored-By: Claude Opus 4.6 (1M context) --- app/lib/app.dart | 15 ++++++++++++--- app/lib/main.dart | 7 +++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/app/lib/app.dart b/app/lib/app.dart index fce561d0..408af565 100644 --- a/app/lib/app.dart +++ b/app/lib/app.dart @@ -323,18 +323,27 @@ class _WorkspaceSlot extends StatelessWidget { final TabContribution active; static const _editorTabId = 'editor.active'; + static const _claudeTabId = 'claude.primary'; + static const _welcomeTabId = 'welcome.view'; @override Widget build(BuildContext context) { final kernel = ClideKernel.of(context); final tokens = ClideTheme.of(context).surface; return ListenableBuilder( - listenable: kernel.arrangement, + listenable: Listenable.merge([kernel.arrangement, kernel.project]), builder: (ctx, _) { final editorOpen = kernel.arrangement.editorOpen; final editorTab = tabs.where((t) => t.id == _editorTabId).firstOrNull; - final primaryTabs = tabs.where((t) => t.id != _editorTabId).toList(); - final primary = primaryTabs.contains(active) ? active : (primaryTabs.isNotEmpty ? primaryTabs.first : active); + + final TabContribution primary; + if (kernel.project.isOpen) { + final claude = tabs.where((t) => t.id == _claudeTabId).firstOrNull; + primary = claude ?? active; + } else { + final welcome = tabs.where((t) => t.id == _welcomeTabId).firstOrNull; + primary = welcome ?? active; + } if (!editorOpen || editorTab == null) { return Container(color: tokens.panelBackground, child: primary.build(ctx)); diff --git a/app/lib/main.dart b/app/lib/main.dart index b49102fa..737dbb93 100644 --- a/app/lib/main.dart +++ b/app/lib/main.dart @@ -82,6 +82,13 @@ Future main() async { await services.extensions.activateAll(); + if (!kIsWeb) { + final opened = await services.project.open(Directory.current.path); + if (opened) { + services.panels.activateTab(Slots.workspace, 'claude.primary'); + } + } + runApp(ClideApp(services: services)); }