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) <noreply@anthropic.com>
This commit is contained in:
2026-04-22 23:26:35 +02:00
co-authored by Claude Opus 4.6
parent 257bb0cd94
commit f07a7b55a2
2 changed files with 19 additions and 3 deletions
+12 -3
View File
@@ -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));
+7
View File
@@ -82,6 +82,13 @@ Future<void> 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));
}