Skip to content

feat(desktop): Add recently opened workspaces service - #26

Open
dang-hai wants to merge 1 commit into
mainfrom
feat/recent-workspaces
Open

feat(desktop): Add recently opened workspaces service#26
dang-hai wants to merge 1 commit into
mainfrom
feat/recent-workspaces

Conversation

@dang-hai

Copy link
Copy Markdown
Contributor

Summary

  • Add a service to track recently opened workspaces, helping users quickly reopen previously used workspaces
  • WorkspaceSelectionModal now displays recent workspaces at the top for quick access
  • Implements clean separation of concerns: modal is pure presentation, container handles business logic

Changes

  • Database layer: Add recent_workspaces SQLite table with LRU eviction (max 20)
  • IPC bridge: Expose recentWorkspaceAPI for main ↔ renderer communication
  • Hook: Create useRecentWorkspaces for data fetching and state management
  • View: Update WorkspaceSelectionModal as pure presentation (receives data via props)
  • Container: AgentNode coordinates business logic and passes data to modal
  • Styling: VS Code-style recent workspaces list with git branch display

Architecture

AgentNode (container)
    ↓ uses useRecentWorkspaces hook
    ↓ passes recentWorkspaces + callbacks as props
WorkspaceSelectionModal (view)
    ↓ user selects workspace
    ↓ calls onSelect(path)
AgentNode.handleWorkspaceSelect
    ↓ calls trackWorkspace (from hook)
    ↓ updates node attachments

Test plan

  • Open desktop app with npm run dev:desktop
  • Create an AgentNode and select a workspace
  • Close and reopen the workspace selection modal - verify recent workspace appears
  • Select multiple workspaces - verify LRU ordering (most recent first)
  • Verify git branch is displayed for git repositories

🤖 Generated with Claude Code

Track recently opened workspaces to help users quickly reopen
previously used workspaces in the WorkspaceSelectionModal.

- Add SQLite table with LRU eviction (max 20 workspaces)
- Add IPC bridge for main ↔ renderer communication
- Create useRecentWorkspaces hook for state management
- Update WorkspaceSelectionModal as pure presentation layer
- Container (AgentNode) handles business logic and data flow
- Display git branch info when available

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant