feat: add cmd+n keyboard shortcut to create new session with current project#372
feat: add cmd+n keyboard shortcut to create new session with current project#372axin7 wants to merge 0 commit into
Conversation
|
@claude review this |
|
Claude finished @123vivekr's task —— View job Claude Code is reviewing the PR... Review Tasks:
Code ReviewOverall AssessmentThis PR implements an intelligent session creation feature with cmd+n keyboard shortcut. The implementation is mostly solid but has some areas that need attention. Strengths
Issues and Suggestions1. Backend Implementation (commands/claude.rs)The backend changes look minimal and focused on dependency updates. No issues found. 2. App.tsx Implementation
Suggested fix - Add this to the keyboard handler in App.tsx: case 'n':
if (!e.shiftKey) { // Ensure it's not cmd+shift+n
e.preventDefault();
window.dispatchEvent(new CustomEvent('create-new-session'));
}
break;3. useTabState.ts Implementation✅ Good implementation of Issue: The PR claims to add Suggested fix - Add to useTabState.ts: const getCurrentProjectPath = useCallback((): string | undefined => {
if (!activeTab) return undefined;
// For chat tabs, use initialProjectPath or sessionData.project_path
if (activeTab.type === 'chat') {
return activeTab.initialProjectPath || activeTab.sessionData?.project_path;
}
// For other tabs that might have project context
if ('projectPath' in activeTab) {
return activeTab.projectPath;
}
return undefined;
}, [activeTab]);
// Add to return object:
return {
// ... existing returns
getCurrentProjectPath,
};4. Missing createNewSessionWithCurrentProject ImplementationThe PR description mentions this function but I don't see it implemented anywhere. Suggested implementation: const createNewSessionWithCurrentProject = useCallback((): string => {
const currentProjectPath = getCurrentProjectPath();
const projectName = currentProjectPath?.split('/').pop() || 'New Session';
return createChatTab(
undefined, // No session ID for new session
projectName,
currentProjectPath
);
}, [getCurrentProjectPath, createChatTab]);5. TabContent.tsx & TabManager.tsx✅ The tab management components look good and properly handle project context passing. 6. FloatingPromptInput.tsxSecurity Considerations
Performance Considerations
Missing TestsThe PR lacks tests for the new functionality. Consider adding tests for:
Recommendations
The core concept is good, but the implementation appears incomplete based on the PR description. Please address the missing components before merging. |
|
hi @axin7 can you take a look at the suggestions and also fix the merge conflicts? |

Summary
Added intelligent session creation functionality with keyboard shortcut that automatically detects the current project context and creates a new chat session.
Features
Technical Changes
getCurrentProjectPath()in useTabState hook to detect current project contextcreateNewSessionWithCurrentProject()helper function for intelligent session creation