Skip to content

fix: Complete Settings Dialog wiring for Memory Extraction#364

Merged
rjroy merged 7 commits intomainfrom
fix/memory-extraction
Jan 19, 2026
Merged

fix: Complete Settings Dialog wiring for Memory Extraction#364
rjroy merged 7 commits intomainfrom
fix/memory-extraction

Conversation

@rjroy
Copy link
Copy Markdown
Owner

@rjroy rjroy commented Jan 19, 2026

Summary

  • Add settings button (gear icon) to VaultSelect header for accessing Memory Settings
  • Wire SettingsDialog to render MemoryEditor and ExtractionPromptEditor components
  • Update progress tracking to reflect 100% completion of Memory Extraction feature

Context

The Memory Extraction feature was mostly implemented but the Settings Dialog wasn't accessible from the UI. This PR completes the wiring by:

  1. Adding a gear button to the VaultSelect header that opens the Settings Dialog
  2. Passing the existing MemoryEditor component as memoryEditorContent prop
  3. Passing the existing ExtractionPromptEditor component as promptEditorContent prop

Test plan

  • All frontend tests pass (40 VaultSelect tests, 17 MemoryEditor tests, 21 ExtractionPromptEditor tests, 23 SettingsDialog tests)
  • Pre-commit checks pass (typecheck, lint, unit tests)
  • Manual: Click gear icon in VaultSelect header → Settings Dialog opens
  • Manual: Memory tab shows memory.md content with size indicator
  • Manual: Extraction Prompt tab shows prompt with override indicator

🤖 Generated with Claude Code

rjroy and others added 4 commits January 19, 2026 06:47
Complete Phase 3 (Settings UI) of Memory Extraction feature:
- Add settings button to VaultSelect header (gear icon)
- Wire SettingsDialog to open from header button
- Integrate MemoryEditor as memoryEditorContent prop
- Integrate ExtractionPromptEditor as promptEditorContent prop
- Update progress tracking (12/14 tasks complete)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
All 14 tasks across 4 phases are now complete:
- Phase 1 (Foundation): State model, extraction prompt, protocol messages
- Phase 2 (Pipeline): Transcript reader, fact extractor, memory writer, scheduler
- Phase 3 (Settings UI): WebSocket handlers, Settings dialog, Memory/Prompt editors
- Phase 4 (Integration): Pipeline startup, E2E acceptance tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove hardcoded "America/New_York" timezone from cron job.
Now uses EXTRACTION_TIMEZONE env var, defaulting to server local time
when not set.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 8 new tests covering:
- Settings button visibility and styling in header
- Opening SettingsDialog on button click
- Memory and Extraction Prompt tabs rendering
- Dialog close behavior
- MemoryEditor and ExtractionPromptEditor content wiring
- Keyboard accessibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjroy rjroy force-pushed the fix/memory-extraction branch 2 times, most recently from c4bcec7 to 5c26ceb Compare January 19, 2026 15:18
The user-customizable prompt now focuses solely on WHAT to extract
(categories, format, merge behavior, security), while the server code
handles HOW to operate (tools, paths, process steps).

Changes:
- Rename extraction-prompt.md to durable-facts.md
- Move operational instructions to buildExtractionPrompt()
- Update user override path to ~/.config/memory-loop/durable-facts.md
- Update tests and frontend path display

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjroy rjroy force-pushed the fix/memory-extraction branch from 5c26ceb to cb15dc8 Compare January 19, 2026 15:21
Repository owner deleted a comment from codecov Bot Jan 19, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 86.84211% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/components/VaultSelect.tsx 66.66% 13 Missing ⚠️
backend/src/extraction/memory-writer.ts 90.90% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

- Add "Run Extraction" button to ExtractionPromptEditor for manual extraction
- Handle extraction_status server messages with running/complete/error states
- Show status feedback with auto-clearing success messages
- Fix test isolation: tests no longer write to real ~/.claude/rules/memory.md
  - Add getMemoryFilePath() that respects MEMORY_FILE_PATH_OVERRIDE env var
  - Add beforeAll/afterAll hooks in tests to use temp directories
- Fix settings button visibility in VaultSelect

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

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes the Memory Extraction feature by wiring up the Settings Dialog to the VaultSelect UI, enabling users to access memory management and extraction prompt editing capabilities.

Changes:

  • Added a gear icon button to VaultSelect header that opens the Settings Dialog
  • Wired SettingsDialog component to render MemoryEditor and ExtractionPromptEditor as tab content
  • Renamed extraction prompt file from extraction-prompt.md to durable-facts.md to better reflect its purpose
  • Refactored prompt structure to separate user-customizable categories from operational instructions
  • Added extraction trigger UI with status display and run button
  • Improved test isolation by using MEMORY_FILE_PATH_OVERRIDE environment variable
  • Added configurable timezone support for extraction scheduling
  • Updated comprehensive test suites for all new functionality

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/components/VaultSelect.tsx Added settings button to header and wired SettingsDialog with MemoryEditor and ExtractionPromptEditor components
frontend/src/components/VaultSelect.css Added styles for settings button with proper sizing (44x44px), positioning, hover states, and accessibility focus indicators
frontend/src/components/ExtractionPromptEditor.tsx Added extraction trigger functionality with status tracking, run button, and status message display; updated file path reference to durable-facts.md
frontend/src/components/ExtractionPromptEditor.css Added styles for extraction section including button, status indicators (running/complete/error), and responsive mobile layout
frontend/src/components/tests/VaultSelect.test.tsx Added 8 comprehensive tests for settings dialog integration covering button display, dialog opening/closing, tab switching, content rendering, and accessibility
frontend/src/components/tests/ExtractionPromptEditor.test.tsx Added 7 tests for extraction trigger including button states, status messages, error handling, and proper disabling during operations; updated file path assertion
backend/src/prompts/extraction-prompt.md Removed old extraction prompt file (renamed to durable-facts.md)
backend/src/prompts/durable-facts.md Added new concise prompt file containing only the user-customizable category definitions
backend/src/extraction/fact-extractor.ts Updated to use durable-facts.md filename; refactored buildExtractionPrompt to combine user categories with operational instructions programmatically
backend/src/extraction/memory-writer.ts Added getMemoryFilePath() function that respects MEMORY_FILE_PATH_OVERRIDE for testability; updated all functions to use the new path getter
backend/src/extraction/extraction-manager.ts Added configurable timezone support via ENV_EXTRACTION_TIMEZONE for flexible scheduling across time zones
backend/src/handlers/tests/memory-handlers.test.ts Added global test isolation setup using MEMORY_FILE_PATH_OVERRIDE to prevent tests from modifying real user files
backend/src/extraction/tests/memory-writer.test.ts Added global test isolation and updated tests to verify memory file operations using the override path
backend/src/extraction/tests/fact-extractor.test.ts Updated test assertions to match new durable-facts.md filename and new prompt structure with absolute paths
.sdd/progress/2026-01-18-memory-extraction-progress.md Updated progress tracking to reflect 100% completion of all 14 tasks across all 4 phases

Comment on lines 46 to 51
export const USER_PROMPT_PATH = join(
homedir(),
".config",
"memory-loop",
"extraction-prompt.md"
"durable-facts.md"
);
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extraction prompt filename has been renamed from extraction-prompt.md to durable-facts.md, but this creates a breaking change for users who have already customized their extraction prompt at ~/.config/memory-loop/extraction-prompt.md. When the system starts up, it will no longer recognize their custom prompt and will use the default instead. Consider adding migration logic to copy/rename the old file to the new location, or add a fallback check to load from the old path if the new one doesn't exist.

Copilot uses AI. Check for mistakes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@rjroy rjroy merged commit feff705 into main Jan 19, 2026
2 checks passed
@rjroy rjroy deleted the fix/memory-extraction branch January 19, 2026 15:53
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.

2 participants