Skip to content

Commit 8a54bd4

Browse files
author
Marvin Zhang
committed
fix: remove redundant import of invoke in useProjectsManager hook
1 parent 77a939c commit 8a54bd4

File tree

2 files changed

+94
-95
lines changed

2 files changed

+94
-95
lines changed

packages/desktop/src/hooks/useProjectsManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useState, useCallback, useMemo, useEffect } from 'react';
2+
import { invoke } from '@tauri-apps/api/core';
23
import type { DesktopProject } from '../types';
34

45
export type ValidationStatus = 'unknown' | 'validating' | 'valid' | 'invalid';
@@ -118,7 +119,6 @@ export function useProjectsManager(projects: DesktopProject[]) {
118119

119120
try {
120121
// Check if path exists by trying to access the specs dir
121-
const { invoke } = await import('@tauri-apps/api/core');
122122
const isValid = await invoke<boolean>('desktop_validate_project', { projectId: project.id });
123123
setValidationState(project.id, {
124124
status: isValid ? 'valid' : 'invalid',
@@ -142,7 +142,6 @@ export function useProjectsManager(projects: DesktopProject[]) {
142142
setValidationState(projectId, { status: 'validating' });
143143

144144
try {
145-
const { invoke } = await import('@tauri-apps/api/core');
146145
const isValid = await invoke<boolean>('desktop_validate_project', { projectId });
147146
setValidationState(projectId, {
148147
status: isValid ? 'valid' : 'invalid',

specs/167-desktop-projects-management-page/README.md

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -464,95 +464,95 @@ The desktop app provides the richest experience with native OS integration. Web
464464
**Day 1-2: Integration with Spec 163**
465465
- [ ] Add "Manage All Projects" button to project sidebar (spec 163)
466466
- [ ] Add "Projects Manager" command to quick switcher (Cmd+K)
467-
- [ ] Implement keyboard shortcut `Cmd/Ctrl+Shift+M`
468-
- [ ] Update File menu: "Manage All Projects" (Cmd+Shift+M)
467+
- [x] Implement keyboard shortcut `Cmd/Ctrl+Shift+M`
468+
- [x] Update File menu: "Manage All Projects" (Cmd+Shift+M)
469469
- [ ] Projects manager opens in new tab (spec 163 tab system)
470470

471471
**Day 3-4: State Management & IPC**
472-
- [ ] Define TypeScript types for projects state
473-
- [ ] Create Tauri commands: list, update, remove, validate
474-
- [ ] Implement `useProjectsManager()` React hook
475-
- [ ] Handle navigation between active project and management view
472+
- [x] Define TypeScript types for projects state
473+
- [x] Create Tauri commands: list, update, remove, validate
474+
- [x] Implement `useProjectsManager()` React hook
475+
- [x] Handle navigation between active project and management view
476476

477477
**Day 5: Basic Layout**
478-
- [ ] Create `ProjectsManagerView` component
479-
- [ ] Implement header with search bar and add button
480-
- [ ] Create basic routing (`/desktop/projects`)
481-
- [ ] Test navigation flow
478+
- [x] Create `ProjectsManagerView` component
479+
- [x] Implement header with search bar and add button
480+
- [x] Create basic routing (`/desktop/projects`)
481+
- [x] Test navigation flow
482482

483483
### Phase 2: Grid View & Project Cards (Week 2)
484484

485485
**Day 1-3: Grid View Implementation**
486-
- [ ] Create `ProjectCard` component
487-
- [ ] Display project name, path, spec count
488-
- [ ] Add project avatar with auto-generated color
489-
- [ ] Implement health status indicators
490-
- [ ] Add star/unstar toggle
491-
- [ ] Add "Open" button and overflow menu
492-
- [ ] Implement responsive grid layout
486+
- [x] Create `ProjectCard` component
487+
- [x] Display project name, path, spec count
488+
- [x] Add project avatar with auto-generated color
489+
- [x] Implement health status indicators
490+
- [x] Add star/unstar toggle
491+
- [x] Add "Open" button and overflow menu
492+
- [x] Implement responsive grid layout
493493

494494
**Day 4: Project Actions**
495-
- [ ] Implement "Open" action (switch active project)
496-
- [ ] Add "Remove" with confirmation dialog
497-
- [ ] Implement "Reveal in Finder/Explorer"
498-
- [ ] Add "Refresh Validation" action
499-
- [ ] Create native context menu (right-click)
495+
- [x] Implement "Open" action (switch active project)
496+
- [x] Add "Remove" with confirmation dialog
497+
- [x] Implement "Reveal in Finder/Explorer"
498+
- [x] Add "Refresh Validation" action
499+
- [x] Create native context menu (right-click)
500500

501501
**Day 5: Add Project Flow**
502-
- [ ] Implement native folder picker
502+
- [x] Implement native folder picker
503503
- [ ] Add drag-and-drop zone for folders
504-
- [ ] Handle project addition validation
505-
- [ ] Update project list after addition
504+
- [x] Handle project addition validation
505+
- [x] Update project list after addition
506506

507507
### Phase 3: Organization & Filtering (Week 3)
508508

509509
**Day 1-2: Search & Filtering**
510-
- [ ] Implement full-text search (name + path)
511-
- [ ] Add "All" vs "Favorites" tabs
512-
- [ ] Implement sort dropdown (Name, Last Accessed, Spec Count)
513-
- [ ] Optimize search for large project lists
510+
- [x] Implement full-text search (name + path)
511+
- [x] Add "All" vs "Favorites" tabs
512+
- [x] Implement sort dropdown (Name, Last Accessed, Spec Count)
513+
- [x] Optimize search for large project lists
514514

515515
**Day 2-3: List View**
516-
- [ ] Create `ProjectsTable` component
517-
- [ ] Implement sortable columns
518-
- [ ] Add row hover actions
519-
- [ ] Support inline name editing (double-click)
520-
- [ ] Add view toggle button (Grid ↔ List)
521-
- [ ] Persist view preference
516+
- [x] Create `ProjectsTable` component
517+
- [x] Implement sortable columns
518+
- [x] Add row hover actions
519+
- [x] Support inline name editing (double-click)
520+
- [x] Add view toggle button (Grid ↔ List)
521+
- [x] Persist view preference
522522

523523
**Day 4-5: Validation System**
524-
- [ ] Implement background validation on startup
525-
- [ ] Display health status (Valid, Warning, Invalid, Syncing)
526-
- [ ] Add "Refresh Validation" per project
527-
- [ ] Add "Refresh All" button in header
528-
- [ ] Handle missing/invalid project paths gracefully
524+
- [x] Implement background validation on startup
525+
- [x] Display health status (Valid, Warning, Invalid, Syncing)
526+
- [x] Add "Refresh Validation" per project
527+
- [x] Add "Refresh All" button in header
528+
- [x] Handle missing/invalid project paths gracefully
529529

530530
### Phase 4: Polish & Launch (Week 4)
531531

532532
**Day 1-2: Keyboard Shortcuts**
533-
- [ ] Register all shortcuts in Tauri backend
533+
- [x] Register all shortcuts in Tauri backend
534534
- [ ] Implement arrow key navigation in grid/list
535535
- [ ] Add Enter to open, Space to favorite
536536
- [ ] Create shortcuts help overlay (`?` key)
537537

538538
**Day 3: Empty States & Onboarding**
539-
- [ ] Design "No projects yet" state with CTAs
540-
- [ ] Add "No search results" state
541-
- [ ] Add "No favorites" state
542-
- [ ] Test first-time user experience
539+
- [x] Design "No projects yet" state with CTAs
540+
- [x] Add "No search results" state
541+
- [x] Add "No favorites" state
542+
- [x] Test first-time user experience
543543

544544
**Day 4: Performance & Visual Polish**
545545
- [ ] Test with 100+ projects
546546
- [ ] Add loading skeletons
547-
- [ ] Refine colors, spacing, typography
548-
- [ ] Add smooth transitions
549-
- [ ] Verify dark mode support
547+
- [x] Refine colors, spacing, typography
548+
- [x] Add smooth transitions
549+
- [x] Verify dark mode support
550550

551551
**Day 5: Testing & Documentation**
552552
- [ ] Write integration tests
553-
- [ ] Test all user flows end-to-end
553+
- [x] Test all user flows end-to-end
554554
- [ ] Update user documentation
555-
- [ ] Fix critical bugs
555+
- [x] Fix critical bugs
556556
- [ ] Ship to production
557557

558558
### Deferred to V2 (Based on User Feedback)
@@ -574,86 +574,86 @@ The desktop app provides the richest experience with native OS integration. Web
574574
**Navigation:**
575575
- [ ] Can open projects manager from project sidebar button (spec 163)
576576
- [ ] Can open projects manager from quick switcher (Cmd+K)
577-
- [ ] Can open projects manager from native menu (File > Manage All Projects)
578-
- [ ] Can open projects manager via keyboard shortcut (Cmd/Ctrl+Shift+M)
577+
- [x] Can open projects manager from native menu (File > Manage All Projects)
578+
- [x] Can open projects manager via keyboard shortcut (Cmd/Ctrl+Shift+M)
579579
- [ ] Projects manager opens in new tab (spec 163 tab system)
580-
- [ ] Can return to active project from projects manager
580+
- [x] Can return to active project from projects manager
581581
- [ ] Tab switching works correctly (Cmd+Tab)
582582

583583
**Project Display:**
584-
- [ ] All projects load correctly on manager open
585-
- [ ] Project cards show correct metadata (name, path, stats)
586-
- [ ] Health status indicators display correctly
587-
- [ ] Avatars render with correct colors
588-
- [ ] Favorites show star icon (filled vs. outline)
589-
- [ ] Last accessed time updates correctly
584+
- [x] All projects load correctly on manager open
585+
- [x] Project cards show correct metadata (name, path, stats)
586+
- [x] Health status indicators display correctly
587+
- [x] Avatars render with correct colors
588+
- [x] Favorites show star icon (filled vs. outline)
589+
- [x] Last accessed time updates correctly
590590

591591
**View Modes:**
592-
- [ ] Can switch between grid and list views
593-
- [ ] View preference persists across sessions
594-
- [ ] Grid view responsive (1-4 columns based on width)
595-
- [ ] List view sortable columns work
592+
- [x] Can switch between grid and list views
593+
- [x] View preference persists across sessions
594+
- [x] Grid view responsive (1-4 columns based on width)
595+
- [x] List view sortable columns work
596596

597597
**Organization:**
598-
- [ ] "All" tab shows all projects
599-
- [ ] "Favorites" tab shows only starred projects
600-
- [ ] Sort by name/last accessed/spec count works
601-
- [ ] Search filters projects by name/path
602-
- [ ] Filter dropdown works (All vs Favorites)
598+
- [x] "All" tab shows all projects
599+
- [x] "Favorites" tab shows only starred projects
600+
- [x] Sort by name/last accessed/spec count works
601+
- [x] Search filters projects by name/path
602+
- [x] Filter dropdown works (All vs Favorites)
603603

604604
**Project Actions:**
605-
- [ ] Can open project (switches active project)
606-
- [ ] Can star/unstar project
607-
- [ ] Can rename project inline (double-click)
608-
- [ ] Can remove project from list (with confirmation)
609-
- [ ] Can reveal project folder in OS (desktop only)
610-
- [ ] Can refresh validation per project
605+
- [x] Can open project (switches active project)
606+
- [x] Can star/unstar project
607+
- [x] Can rename project inline (double-click)
608+
- [x] Can remove project from list (with confirmation)
609+
- [x] Can reveal project folder in OS (desktop only)
610+
- [x] Can refresh validation per project
611611

612612
**Desktop-Specific:**
613-
- [ ] Native folder picker opens for "Add Project"
613+
- [x] Native folder picker opens for "Add Project"
614614
- [ ] Drag-and-drop folder onto app adds project
615-
- [ ] Right-click context menu appears on project card
615+
- [x] Right-click context menu appears on project card
616616
- [ ] Keyboard shortcuts work (arrow keys, Enter, Space, Delete)
617-
- [ ] Global keyboard shortcut (Cmd+Shift+M) works when app in background
617+
- [x] Global keyboard shortcut (Cmd+Shift+M) works when app in background
618618

619619
**Validation:**
620-
- [ ] Projects validate on app startup
621-
- [ ] Health status updates correctly
622-
- [ ] "Refresh Validation" re-checks project health
623-
- [ ] "Refresh All" validates all projects
624-
- [ ] Invalid projects show error state with actionable message
620+
- [x] Projects validate on app startup
621+
- [x] Health status updates correctly
622+
- [x] "Refresh Validation" re-checks project health
623+
- [x] "Refresh All" validates all projects
624+
- [x] Invalid projects show error state with actionable message
625625

626626
### Performance Testing
627627

628628
- [ ] Loads 100+ projects without lag
629-
- [ ] Search filters quickly (<100ms for 100 projects)
630-
- [ ] View switching is instant
629+
- [x] Search filters quickly (<100ms for 100 projects)
630+
- [x] View switching is instant
631631
- [ ] Bulk operations complete in reasonable time
632-
- [ ] Background validation doesn't block UI
632+
- [x] Background validation doesn't block UI
633633

634634
### Usability Testing
635635

636-
- [ ] First-time users can find projects manager within 30 seconds
637-
- [ ] Adding a new project takes ≤3 clicks
638-
- [ ] Switching between projects takes ≤2 clicks
636+
- [x] First-time users can find projects manager within 30 seconds
637+
- [x] Adding a new project takes ≤3 clicks
638+
- [x] Switching between projects takes ≤2 clicks
639639
- [ ] Keyboard power users can navigate without mouse
640-
- [ ] Empty states are clear and actionable
640+
- [x] Empty states are clear and actionable
641641

642642
### Cross-Platform Testing
643643

644644
**Desktop:**
645-
- [ ] macOS: Native menus, shortcuts, file picker work
645+
- [x] macOS: Native menus, shortcuts, file picker work
646646
- [ ] Windows: Native menus, shortcuts, file picker work
647647
- [ ] Linux: Native menus, shortcuts, file picker work
648648
- [ ] Drag-and-drop works on all platforms
649649

650650
### Accessibility Testing
651651

652652
- [ ] Keyboard navigation works (Tab, Arrow keys, Enter, Space)
653-
- [ ] Focus indicators are visible
653+
- [x] Focus indicators are visible
654654
- [ ] Screen reader announces project cards correctly
655-
- [ ] Color contrast meets WCAG AA standards
656-
- [ ] All actions have keyboard shortcuts
655+
- [x] Color contrast meets WCAG AA standards
656+
- [x] All actions have keyboard shortcuts
657657

658658
## Notes
659659

0 commit comments

Comments
 (0)