Implement project picker keyboard shortcut and enhance feature management

- Added a new keyboard shortcut 'P' to open the project picker dropdown.
- Implemented functionality to select projects using number keys, allowing users to quickly switch between projects.
- Updated the feature list to include a new feature for project selection via keyboard shortcuts.
- Removed obsolete coding_prompt.md and added initializer_prompt.md for better session management.
- Introduced context management for features, enabling reading, writing, and deleting context files.
- Updated package dependencies to include @radix-ui/react-checkbox for enhanced UI components.

This commit enhances user experience by streamlining project selection and improves the overall feature management process.

🤖 Generated with Claude Code
This commit is contained in:
Cody Seibert
2025-12-09 12:20:07 -05:00
parent 95355f53f4
commit 9bae205312
39 changed files with 1551 additions and 4168 deletions

View File

@@ -104,6 +104,10 @@ export function BoardView() {
};
}, [currentProject]);
// Track previous project to detect switches
const prevProjectPathRef = useRef<string | null>(null);
const isSwitchingProjectRef = useRef<boolean>(false);
// Auto mode hook
const autoMode = useAutoMode();
@@ -196,6 +200,20 @@ export function BoardView() {
const loadFeatures = useCallback(async () => {
if (!currentProject) return;
const currentPath = currentProject.path;
const previousPath = prevProjectPathRef.current;
// If project switched, clear features first to prevent cross-contamination
if (previousPath !== null && currentPath !== previousPath) {
console.log(`[BoardView] Project switch detected: ${previousPath} -> ${currentPath}, clearing features`);
isSwitchingProjectRef.current = true;
setFeatures([]);
setPersistedCategories([]); // Also clear categories
}
// Update the ref to track current project
prevProjectPathRef.current = currentPath;
setIsLoading(true);
try {
const api = getElectronAPI();
@@ -219,6 +237,7 @@ export function BoardView() {
console.error("Failed to load features:", error);
} finally {
setIsLoading(false);
isSwitchingProjectRef.current = false;
}
}, [currentProject, setFeatures]);
@@ -237,10 +256,14 @@ export function BoardView() {
if (Array.isArray(parsed)) {
setPersistedCategories(parsed);
}
} else {
// File doesn't exist, ensure categories are cleared
setPersistedCategories([]);
}
} catch (error) {
console.error("Failed to load categories:", error);
// If file doesn't exist, that's fine - start with empty array
// If file doesn't exist, ensure categories are cleared
setPersistedCategories([]);
}
}, [currentProject]);
@@ -384,7 +407,7 @@ export function BoardView() {
// Save when features change (after initial load is complete)
useEffect(() => {
if (!isLoading) {
if (!isLoading && !isSwitchingProjectRef.current) {
saveFeatures();
}
}, [features, saveFeatures, isLoading]);

View File

@@ -11,6 +11,7 @@ interface KanbanColumnProps {
count: number;
children: ReactNode;
isDoubleWidth?: boolean;
headerAction?: ReactNode;
}
export function KanbanColumn({
@@ -20,6 +21,7 @@ export function KanbanColumn({
count,
children,
isDoubleWidth = false,
headerAction,
}: KanbanColumnProps) {
const { setNodeRef, isOver } = useDroppable({ id });
@@ -37,6 +39,7 @@ export function KanbanColumn({
<div className="flex items-center gap-2 p-3 border-b border-white/5">
<div className={cn("w-3 h-3 rounded-full", color)} />
<h3 className="font-medium text-sm flex-1">{title}</h3>
{headerAction}
<span className="text-xs text-muted-foreground bg-background px-2 py-0.5 rounded-full">
{count}
</span>

View File

@@ -97,16 +97,6 @@ export function SpecView() {
</div>
</div>
<div className="flex gap-2">
<Button
variant="outline"
size="sm"
onClick={loadSpec}
disabled={isLoading}
data-testid="reload-spec"
>
<RefreshCw className="w-4 h-4 mr-2" />
Reload
</Button>
<Button
size="sm"
onClick={saveSpec}