From df2c7c36a4c1f7ca9c3a2e87f0bd9608c4ece0fc Mon Sep 17 00:00:00 2001 From: Cody Seibert Date: Tue, 9 Dec 2025 12:29:35 -0500 Subject: [PATCH] Remove 5-project limit from project dropdown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove .slice(0, 5) to show all projects in dropdown - Extend keyboard shortcuts to support 1-9 (was 1-5) - Only show hotkey indicators for first 9 projects - Update tests to reflect new behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .automaker/feature_list.json | 24 ++++++- app/src/components/layout/sidebar.tsx | 84 +++++++++++++++++++---- app/tests/project-picker-keyboard.spec.ts | 24 ++++--- 3 files changed, 106 insertions(+), 26 deletions(-) diff --git a/.automaker/feature_list.json b/.automaker/feature_list.json index 41bb6d81..0a45027f 100644 --- a/.automaker/feature_list.json +++ b/.automaker/feature_list.json @@ -11,7 +11,27 @@ "category": "Core", "description": "I want the ability to press P which will automatically select my projects drop down and show all my projects. And then for each one, put a hotkey in the left that says 12345 and selecting one of those with my keyboard should automatically select that project.\n", "steps": [], - "status": "in_progress", - "startedAt": "2025-12-09T17:11:14.402Z" + "status": "in_progress" + }, + { + "id": "feature-1765301095506-cpy06q9u0", + "category": "Core", + "description": "It seems like there's only a limit of five of how many things show up in the project select drop down. I need to show everything.", + "steps": [], + "status": "verified" + }, + { + "id": "feature-1765301127030-a4nnqp0ja", + "category": "Kanban", + "description": "In creating new cards in Kanban, I need the ability to drag and drop images into the description section, which will attach the image as context in store in the temp directory, so that later on when the agent runs, it can know where to fetch that image from.", + "steps": [], + "status": "in_progress" + }, + { + "id": "feature-1765301184184-ttvhd8kkt", + "category": "Core", + "description": "-o should actually open the select folder prompt. Right now when you click o it goes to like the overview page. That's not the correct experience I'm looking for. Also just clicking on the top left open folder icon should do the same thing of opening the system prompt so they can select a project.", + "steps": [], + "status": "in_progress" } ] \ No newline at end of file diff --git a/app/src/components/layout/sidebar.tsx b/app/src/components/layout/sidebar.tsx index 95549d17..81cab1ba 100644 --- a/app/src/components/layout/sidebar.tsx +++ b/app/src/components/layout/sidebar.tsx @@ -37,6 +37,9 @@ import { ACTION_SHORTCUTS, KeyboardShortcut, } from "@/hooks/use-keyboard-shortcuts"; +import { getElectronAPI } from "@/lib/electron"; +import { initializeProject } from "@/lib/project-init"; +import { toast } from "sonner"; interface NavSection { label?: string; @@ -56,6 +59,7 @@ export function Sidebar() { currentProject, currentView, sidebarOpen, + addProject, setCurrentProject, setCurrentView, toggleSidebar, @@ -65,6 +69,56 @@ export function Sidebar() { // State for project picker dropdown const [isProjectPickerOpen, setIsProjectPickerOpen] = useState(false); + /** + * Opens the system folder selection dialog and initializes the selected project. + * Used by both the 'O' keyboard shortcut and the folder icon button. + */ + const handleOpenFolder = useCallback(async () => { + const api = getElectronAPI(); + const result = await api.openDirectory(); + + if (!result.canceled && result.filePaths[0]) { + const path = result.filePaths[0]; + const name = path.split("/").pop() || "Untitled Project"; + + try { + // Initialize the .automaker directory structure + const initResult = await initializeProject(path); + + if (!initResult.success) { + toast.error("Failed to initialize project", { + description: initResult.error || "Unknown error occurred", + }); + return; + } + + const project = { + id: `project-${Date.now()}`, + name, + path, + lastOpened: new Date().toISOString(), + }; + + addProject(project); + setCurrentProject(project); + + if (initResult.createdFiles && initResult.createdFiles.length > 0) { + toast.success(initResult.isNewProject ? "Project initialized" : "Project updated", { + description: `Set up ${initResult.createdFiles.length} file(s) in .automaker`, + }); + } else { + toast.success("Project opened", { + description: `Opened ${name}`, + }); + } + } catch (error) { + console.error("[Sidebar] Failed to open project:", error); + toast.error("Failed to open project", { + description: error instanceof Error ? error.message : "Unknown error", + }); + } + } + }, [addProject, setCurrentProject]); const navSections: NavSection[] = [ { @@ -99,7 +153,7 @@ export function Sidebar() { const handleKeyDown = (event: KeyboardEvent) => { const num = parseInt(event.key, 10); - if (num >= 1 && num <= 5) { + if (num >= 1 && num <= 9) { event.preventDefault(); selectProjectByNumber(num); } else if (event.key === "Escape") { @@ -122,11 +176,11 @@ export function Sidebar() { description: "Toggle sidebar", }); - // Open project shortcut - always available + // Open project shortcut - opens the folder selection dialog directly shortcuts.push({ key: ACTION_SHORTCUTS.openProject, - action: () => setCurrentView("welcome"), - description: "Open project (navigate to welcome view)", + action: () => handleOpenFolder(), + description: "Open folder selection dialog", }); // Project picker shortcut - only when we have projects @@ -161,7 +215,7 @@ export function Sidebar() { } return shortcuts; - }, [currentProject, setCurrentView, toggleSidebar, projects.length]); + }, [currentProject, setCurrentView, toggleSidebar, projects.length, handleOpenFolder]); // Register keyboard shortcuts useKeyboardShortcuts(navigationShortcuts); @@ -241,9 +295,9 @@ export function Sidebar() {