Skip to content

feat: add vault creation from VaultSelect screen#340

Merged
rjroy merged 4 commits intomainfrom
feat/335-add-vault
Jan 17, 2026
Merged

feat: add vault creation from VaultSelect screen#340
rjroy merged 4 commits intomainfrom
feat/335-add-vault

Conversation

@rjroy
Copy link
Copy Markdown
Owner

@rjroy rjroy commented Jan 17, 2026

Summary

  • Adds "Add Vault" card at the end of the vault list with italic styling and dashed border
  • Opens dialog for entering vault title when clicked
  • Converts title to safe directory name (lowercase, alphanumeric, hyphens for spaces)
  • Ensures uniqueness with numeric suffix if directory already exists
  • Creates directory and CLAUDE.md with title as H1 heading
  • Runs vault setup automatically after creation
  • Refreshes vault list on completion

Closes #335

Test plan

  • Click "Add Vault" card, verify dialog opens
  • Enter title with special characters, verify safe filename is created
  • Create vault with existing name, verify numeric suffix added
  • Verify vault appears in list after creation
  • Verify vault setup runs (check for .memory-loop/setup-complete marker)

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 93.26241% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/components/VaultSelect.tsx 81.69% 13 Missing ⚠️
backend/src/vault-manager.ts 90.76% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rjroy rjroy force-pushed the feat/335-add-vault branch from 24e62df to ff29a45 Compare January 17, 2026 17:23
rjroy and others added 4 commits January 17, 2026 14:17
Adds an "Add Vault" card at the end of the vault list that opens a dialog
for creating new vaults. The vault title is converted to a safe directory
name (lowercase, alphanumeric, hyphens) with automatic uniqueness via
numeric suffix. Creates the directory and CLAUDE.md, then runs vault setup.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add AddVaultDialog component tests (33 tests)
- Add create_vault handler tests in websocket-handler (7 tests)
- Add Add Vault integration tests in VaultSelect (11 tests)

Addresses coverage requirements:
- AddVaultDialog.tsx: comprehensive dialog behavior coverage
- websocket-handler.ts: create_vault handler error paths
- VaultSelect.tsx: Add Vault card and dialog integration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The tests were failing intermittently because simulateMessage triggers
React state updates outside of React's test control. Fixed by:

1. Wait for "Creating..." state before simulating server response
   - Ensures addVaultCreating flag is set before vault_created check
2. Wrap simulateMessage calls in act() to flush React updates
   - Ensures all state updates are processed before assertions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjroy rjroy force-pushed the feat/335-add-vault branch from 615bc3f to ec28ee8 Compare January 17, 2026 22:17
@rjroy rjroy merged commit 36dd519 into main Jan 17, 2026
2 checks passed
@rjroy rjroy deleted the feat/335-add-vault branch January 17, 2026 22:19
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.

Vault select tab needs an Add Vault button

1 participant