Skip to content

feat: add archive functionality for chats, projects, and areas#325

Merged
rjroy merged 2 commits intomainfrom
feat/archive-chats
Jan 17, 2026
Merged

feat: add archive functionality for chats, projects, and areas#325
rjroy merged 2 commits intomainfrom
feat/archive-chats

Conversation

@rjroy
Copy link
Copy Markdown
Owner

@rjroy rjroy commented Jan 17, 2026

Summary

Closes #323

  • Add Archive button to FileTree context menu for archivable directories
  • Archive chats directory to 07_Archive/YYYY-MM/chats/
  • Archive project/area directories to 07_Archive/YYYY-MM/
  • Date calculation based on newest file modification date within the directory
  • Confirmation dialog before archiving

Test plan

  • Unit tests for archiveFile() function (15 tests covering happy path, error cases, edge cases)
  • Typecheck passes
  • Lint passes
  • Manual testing: right-click on chats folder, verify Archive button appears
  • Manual testing: archive a project directory, verify it moves to archive with correct date

🤖 Generated with Claude Code

Add context menu option to archive directories to a dated archive folder.
Archivable items include the chats directory (under inbox), project
directories, and area directories. Archives are organized by YYYY-MM
based on the newest file modification date within the directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 95.91837% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/components/BrowseMode.tsx 84.21% 3 Missing ⚠️
frontend/src/components/FileTree.tsx 98.52% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Add comprehensive test coverage for archive functionality:

FileTree.test.tsx:
- Archive button visibility for archivable directories (chats, projects, areas)
- Archive button hidden for non-archivable directories (inbox, archive, root)
- Confirmation dialog flow (display, confirm, cancel)
- Callback invocation on confirmation

BrowseMode.test.tsx:
- file_archived message triggers parent directory refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjroy rjroy merged commit 49bce8e into main Jan 17, 2026
2 checks passed
@rjroy rjroy deleted the feat/archive-chats branch January 17, 2026 04:54
rjroy added a commit that referenced this pull request Jan 17, 2026
* feat: add archive functionality for chats, projects, and areas (#323)

Add context menu option to archive directories to a dated archive folder.
Archivable items include the chats directory (under inbox), project
directories, and area directories. Archives are organized by YYYY-MM
based on the newest file modification date within the directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add frontend tests for archive functionality

Add comprehensive test coverage for archive functionality:

FileTree.test.tsx:
- Archive button visibility for archivable directories (chats, projects, areas)
- Archive button hidden for non-archivable directories (inbox, archive, root)
- Confirmation dialog flow (display, confirm, cancel)
- Callback invocation on confirmation

BrowseMode.test.tsx:
- file_archived message triggers parent directory refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
rjroy added a commit that referenced this pull request Jan 17, 2026
* feat: add archive functionality for chats, projects, and areas (#323)

Add context menu option to archive directories to a dated archive folder.
Archivable items include the chats directory (under inbox), project
directories, and area directories. Archives are organized by YYYY-MM
based on the newest file modification date within the directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add frontend tests for archive functionality

Add comprehensive test coverage for archive functionality:

FileTree.test.tsx:
- Archive button visibility for archivable directories (chats, projects, areas)
- Archive button hidden for non-archivable directories (inbox, archive, root)
- Confirmation dialog flow (display, confirm, cancel)
- Callback invocation on confirmation

BrowseMode.test.tsx:
- file_archived message triggers parent directory refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
rjroy added a commit that referenced this pull request Jan 17, 2026
* refactor: replace mock.module() with dependency injection for test isolation

Replace mock.module() calls with dependency injection pattern across
backend test files to improve test isolation and enable future
simplification of test scripts.

Changes:
- Add DI to SyncPipelineManager for connector and normalizer injection
- Add DI to session manager functions for query function
- Add DI to FileWatcher for chokidar watch and fs readFile
- Add WebSocketHandlerDependencies interface to WebSocketHandler
- Create createTestHandler() wrapper for consistent mock injection
- Update chokidar types for v5.0.0 (WatchOptions → ChokidarOptions)
- Add re-exports to session-manager.ts for SessionMetadata, ConversationMessage

Reduces mock.module() calls in websocket-handler.test.ts from 11 to 8.
Remaining mock.module() calls are for modules imported by extracted
handlers (note-capture, file-browser, inspiration-manager, task-manager,
session-manager, vault-config, search-index, widgets).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: remove lcov dependency from test:coverage script

GitHub Actions doesn't have lcov installed. The coverage files are
generated separately and uploaded to codecov individually.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: complete DI for handler modules, simplify test scripts

Replace remaining mock.module() calls with dependency injection:

- Add HandlerDependencies interface to handlers/types.ts
- Handler functions now receive deps via ctx.deps instead of
  direct imports
- Add isFileBrowserError() helper to avoid instanceof checks
  on mocked classes
- Add createSearchIndex factory to WebSocketHandlerDependencies
- Update handlers: home-handlers, browser-handlers, widget-handlers
- Update sync-handlers.test.ts to provide stub deps

With mock.module() eliminated, all 2667 backend tests now run
together in a single process without contamination.

Simplify backend/package.json test scripts:
- "test": Single command runs all tests
- "test:coverage": Single command with --coverage flag
- Remove all test:batch* commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add archive functionality for chats, projects, and areas (#325)

* feat: add archive functionality for chats, projects, and areas (#323)

Add context menu option to archive directories to a dated archive folder.
Archivable items include the chats directory (under inbox), project
directories, and area directories. Archives are organized by YYYY-MM
based on the newest file modification date within the directory.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add frontend tests for archive functionality

Add comprehensive test coverage for archive functionality:

FileTree.test.tsx:
- Archive button visibility for archivable directories (chats, projects, areas)
- Archive button hidden for non-archivable directories (inbox, archive, root)
- Confirmation dialog flow (display, confirm, cancel)
- Callback invocation on confirmation

BrowseMode.test.tsx:
- file_archived message triggers parent directory refresh

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: complete DI for handler modules, simplify test scripts

Replace remaining mock.module() calls with dependency injection:

- Add HandlerDependencies interface to handlers/types.ts
- Handler functions now receive deps via ctx.deps instead of
  direct imports
- Add isFileBrowserError() helper to avoid instanceof checks
  on mocked classes
- Add createSearchIndex factory to WebSocketHandlerDependencies
- Update handlers: home-handlers, browser-handlers, widget-handlers
- Update sync-handlers.test.ts to provide stub deps

With mock.module() eliminated, all 2667 backend tests now run
together in a single process without contamination.

Simplify backend/package.json test scripts:
- "test": Single command runs all tests
- "test:coverage": Single command with --coverage flag
- Remove all test:batch* commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

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.

Easy archive

1 participant