- RTL: force dir=rtl on LabelFilter, NotesViewToggle, LabelManagementDialog
- i18n: add missing keys (notifications, privacy, edit/preview, AI translate/undo)
- Settings pages: convert to Server Components (general, appearance) + loading skeleton
- AI menu: add Translate option (10 languages) + Undo AI button in toolbar
- Fix: saveInline uses REST API instead of Server Action → eliminates all implicit refreshes in list mode
- Fix: NotesTabsView notes sync effect preserves selected note on content changes
- Fix: auto-tag suggestions now filter already-assigned labels
- Fix: color change in card view uses local state (no refresh)
- Fix: nav links use <Link> for prefetching (Settings, Admin)
- Fix: suppress duplicate label suggestions already on note
- Route: add /api/ai/translate endpoint
- Add reminders page with navigation support
- Upgrade BMad builder module to skills-based architecture
- Refactor MCP server: extract tools and auth into separate modules
- Add connections cache, custom AI provider support
- Update prisma schema and generated client
- Various UI/UX improvements and i18n updates
- Add service worker for PWA support
Made-with: Cursor
- Skip getNoteAllUsers server action for for own notes (majority of notes), Only fetch collaborators for shared notes.
- Merge loadSettings and loadNotes into single useEffect to prevent double loadNotes trigger when showRecentNotes state changes.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Disable Muuri drag on mobile devices to prevent scroll conflicts
- Replace all remaining window.location.reload() with router.refresh() in settings/data, settings/general, and note-editor
- Replace duplicate X icons with semantic icons (Trash2 for fused badge, LogOut for leave share)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix LanguageProvider: add RTL support (ar/fa), translation caching,
prevent blank flash during load, browser language detection
- Fix detect-user-language: extend whitelist from 5 to all 15 languages
- Remove hardcoded initialLanguage="fr" from auth layout
- Complete fr.json translation (all sections translated from English)
- Add missing admin.ai keys to all 13 non-English locales
- Translate ai.autoLabels, ai.batchOrganization, memoryEcho sections
for all locales
- Remove duplicate top-level autoLabels/batchOrganization from en.json
- Fix notebook creation: replace window.location.reload() with
createNotebookOptimistic + router.refresh()
- Fix notebook name truncation in sidebar with min-w-0
- Remove redundant router.refresh() after note creation in page.tsx
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add pt-6 to CardFooter for proper visual separation between the last
content section and the action buttons.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Using form action in Next.js triggers automatic router cache revalidation,
causing the server component to re-render and remount the client component,
which resets all useState values. Switching to onSubmit with e.preventDefault()
prevents this behavior while preserving full functionality.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
revalidatePath was causing the server component to re-render and
potentially remount the client component, resetting all useState values.
Since the client component already updates its local state optimistically
after save, revalidatePath is unnecessary here. Also uninstalls agentation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Ollama model useEffect hooks were triggering on every config prop
change (including after revalidatePath), causing a model list refetch
that reset the combobox selection. Limited dependencies to provider
state only so fetch only runs on mount and provider switch.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Three bugs fixed:
- Removed the useEffect that synced state from config prop on every
re-render, which caused a race condition resetting model state after
revalidatePath triggered a server re-render.
- Reset selected model to a sensible default when switching providers,
preventing stale model names from one provider appearing in another
provider's model list (which made the select show the first option).
- Model select FormData names already fixed in previous commit to match
provider-specific field names (AI_MODEL_TAGS_OLLAMA etc).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The model select fields used provider-specific names (AI_MODEL_TAGS_OLLAMA,
AI_MODEL_TAGS_OPENAI, etc.) but handleSaveAI read from non-existent
formData keys (AI_MODEL_TAGS, AI_MODEL_EMBEDDING). This caused model
values to be silently dropped on save, making the provider appear to
revert. Now reads from the correct provider-specific field names.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Unified localStorage key to 'theme-preference' across all components
- Fixed header.tsx using wrong localStorage key ('theme' instead of 'theme-preference')
- Added localStorage hybrid persistence for instant theme changes
- Removed router.refresh() which was causing stale data revert
- Replaced Blue theme with Sepia
- Consolidated auth() calls to prevent race conditions
- Updated UserSettingsData types to include all themes
Enhanced toast styling to ensure ALL elements in the toaster container
don't block page interaction, while keeping toast buttons clickable.
Added:
- pointer-events: none on all toaster children
- pointer-events: none on ::before and ::after pseudo-elements
- Only actual toast elements have pointer-events: auto
This should fix the issue where users had to refresh (F5) after any
toast notification to click buttons again.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
CRITICAL FIX: Toast notifications were blocking all UI interaction,
requiring a page refresh (F5) to click buttons again.
Root cause: The [data-sonner-toaster] container was capturing all
pointer events, preventing clicks on the page underneath.
Solution:
- Added CSS: pointer-events: none on [data-sonner-toaster]
- Added CSS: pointer-events: auto on [data-sonner-toast]
- This allows the toast itself to be interactive (buttons, close)
- But lets clicks pass through to the page underneath
After this fix, users can continue working immediately after
a toast appears without refreshing the page.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
URGENT FIX: Admin form was not properly saving AI provider configuration,
causing 'AI_PROVIDER_TAGS is not configured' error even after setting OpenAI.
Changes:
- admin-settings-form.tsx: Added validation and error handling
- admin-settings.ts: Filter empty values before saving to DB
- setup-openai.ts: Script to initialize OpenAI as default provider
This fixes the critical bug where users couldn't use the app after
configuring OpenAI in the admin interface.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ROOT CAUSE: The factory was defaulting to 'ollama' when no provider
was configured, and docker-compose.yml was always setting OLLAMA_BASE_URL
even when using OpenAI. This caused the app to try connecting to Ollama
even when OpenAI was configured in the admin.
CRITICAL CHANGES:
1. lib/ai/factory.ts - Removed 'ollama' default fallback
- getTagsProvider() now throws error if AI_PROVIDER_TAGS not set
- getEmbeddingsProvider() now throws error if AI_PROVIDER_EMBEDDING not set
- Forces explicit configuration instead of silent fallback to Ollama
2. docker-compose.yml - Removed default OLLAMA_BASE_URL
- Changed: OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://ollama:11434}
- To: OLLAMA_BASE_URL=${OLLAMA_BASE_URL}
- Only set if explicitly defined in .env.docker
3. Application name: Mento → Memento (correct spelling)
- Updated in: sidebar, README, deploy.sh, DOCKER_DEPLOYMENT.md
4. app/api/ai/config/route.ts - Return 'not set' instead of 'ollama'
- Makes it clear when provider is not configured
IMPACT: The app will now properly use OpenAI when configured in the
admin interface, instead of silently falling back to Ollama.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add comprehensive tests to verify AI provider configuration and ensure
OpenAI is being used correctly instead of hardcoded Ollama.
Changes:
- Add ai-provider.spec.ts: Playwright tests for AI provider validation
- Add /api/debug/config endpoint: Exposes AI configuration for testing
- Tests verify: OpenAI config, connectivity, no OLLAMA errors
All 4 tests pass locally:
✓ AI provider configuration check
✓ OpenAI connectivity test
✓ Embeddings provider verification
✓ No OLLAMA errors validation
Usage on Docker:
TEST_URL=http://192.168.1.190:3000 npx playwright test ai-provider.spec.ts
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Critical fix for Docker deployment where AI features were trying to connect
to localhost:11434 instead of using configured provider (Ollama Docker service
or OpenAI).
Problems fixed:
1. Reformulation (clarify/shorten/improve) failing with ECONNREFUSED 127.0.0.1:11434
2. Auto-labels failing with same error
3. Notebook summaries failing
4. Could not switch from Ollama to OpenAI in admin
Root cause:
- Code had hardcoded fallback to 'http://localhost:11434' in multiple places
- .env.docker file not created on server (gitignore'd)
- No validation that required environment variables were set
Changes:
1. lib/ai/factory.ts:
- Remove hardcoded 'http://localhost:11434' fallback
- Only use localhost for local development (NODE_ENV !== 'production')
- Throw error if OLLAMA_BASE_URL not set in production
2. lib/ai/providers/ollama.ts:
- Remove default parameter 'http://localhost:11434' from constructor
- Require baseUrl to be explicitly passed
- Throw error if baseUrl is missing
3. lib/ai/services/paragraph-refactor.service.ts:
- Remove 'http://localhost:11434' fallback (2 locations)
- Require OLLAMA_BASE_URL to be set
- Throw clear error if not configured
4. app/(main)/admin/settings/admin-settings-form.tsx:
- Add debug info showing current provider state
- Display database config value for transparency
- Help troubleshoot provider selection issues
5. DOCKER-SETUP.md:
- Complete guide for Docker configuration
- Instructions for .env.docker setup
- Examples for Ollama Docker, OpenAI, and external Ollama
- Troubleshooting common issues
Usage:
On server, create .env.docker with proper provider configuration:
- Ollama in Docker: OLLAMA_BASE_URL="http://ollama:11434"
- OpenAI: OPENAI_API_KEY="sk-..."
- External Ollama: OLLAMA_BASE_URL="http://SERVER_IP:11434"
Then in admin interface, users can independently configure:
- Tags Provider (for auto-labels, AI features)
- Embeddings Provider (for semantic search)
Result:
✓ Clear errors if Ollama not configured
✓ Can switch to OpenAI freely in admin
✓ No more hardcoded localhost in production
✓ Proper separation between local dev and Docker production
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add AI Provider Testing page (/admin/ai-test) with Tags and Embeddings tests
- Add new AI providers: CustomOpenAI, DeepSeek, OpenRouter
- Add API routes for AI config, models listing, and testing endpoints
- Add UX Design Specification document for Phase 1 MVP AI
- Add PRD Phase 1 MVP AI planning document
- Update admin settings and sidebar navigation
- Fix AI factory for multi-provider support
## Bug Fixes
### Note Card Actions
- Fix broken size change functionality (missing state declaration)
- Implement React 19 useOptimistic for instant UI feedback
- Add startTransition for non-blocking updates
- Ensure smooth animations without page refresh
- All note actions now work: pin, archive, color, size, checklist
### Markdown LaTeX Rendering
- Add remark-math and rehype-katex plugins
- Support inline equations with dollar sign syntax
- Support block equations with double dollar sign syntax
- Import KaTeX CSS for proper styling
- Equations now render correctly instead of showing raw LaTeX
## Technical Details
- Replace undefined currentNote references with optimistic state
- Add optimistic updates before server actions for instant feedback
- Use router.refresh() in transitions for smart cache invalidation
- Install remark-math, rehype-katex, and katex packages
## Testing
- Build passes successfully with no TypeScript errors
- Dev server hot-reloads changes correctly
- Added multi-provider AI infrastructure (OpenAI/Ollama)
- Implemented real-time tag suggestions with debounced analysis
- Created AI diagnostics and database maintenance tools in Settings
- Added automated garbage collection for orphan labels
- Refined UX with deterministic color hashing and interactive ghost tags
- Remove buggy Undo/Redo that saved character-by-character
- Simplify state to plain useState like Google Keep
- Create toast component with success/error/warning/info types
- Toast notifications auto-dismiss after 3s with smooth animations
- Add ToastProvider in layout
- Remove all JavaScript alert() calls
- Production-ready notification system
- Add debounced state updates for title and content (500ms delay)
- Immediate UI updates with delayed history saving
- Prevent one-letter-per-undo issue
- Add cleanup for debounce timers on unmount