Commit Graph

27 Commits

Author SHA1 Message Date
Antigravity
feaeb075ce fix: repair pgvector migration to actually convert embedding column from text to vector(1536)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 4s
The original migration used a fragile add-copy-drop-rename pattern with
_jsonb casts that silently failed, leaving the embedding column as text.
Replace with a direct ALTER COLUMN TYPE ... USING embedding::vector(1536)
that is fully idempotent and handles all partial states from previous
failed attempts.
2026-05-12 08:00:37 +00:00
Antigravity
dc4244f2ad fix: pgvector deployment — idempotent migration, pgvector image, schema sync
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m21s
- docker-compose.yml: switch postgres:16-alpine to pgvector/pgvector:pg16
- migration: rewrite with IF NOT EXISTS guards, DO block for safe
  text→vector(1536) conversion, handles partial/re-run states
- schema.prisma (both): add @default(now()) on NoteEmbedding.updatedAt,
  sync mcp-server embedding type to Unsupported("vector(1536)")
- deploy.yaml: add docker compose pull postgres before build
2026-05-12 07:28:03 +00:00
Antigravity
03e6a62b80 feat: migrate semantic search to pgvector + full-text search
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m12s
Replace JSON-string embeddings with native pgvector(1536) storage and
add PostgreSQL full-text search (tsvector/GIN) with Reciprocal Rank Fusion
for hybrid keyword + semantic ranking.

Changes:
- NoteEmbedding.embedding: String → vector(1536) via pgvector
- NoteEmbedding: added updatedAt for reindex tracking
- Note: added tsv (tsvector) with auto-update trigger for FTS
- semantic-search.service: hybrid FTS + vector search with RRF fusion
- embedding.service: toVectorString() for pgvector SQL literals
- Removed JS-side cosine similarity loops (now DB-side via <=>)
- Added HNSW index on NoteEmbedding.embedding (cosine distance)
- Added GIN index on Note.tsv for FTS queries

Schema migration in: prisma/migrations/20260512120000_pgvector_and_fts_search/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-12 07:03:56 +00:00
Antigravity
f6880bd0e1 feat: consolidate to single Architectural Grid view and remove all notesViewMode logic
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m6s
2026-05-10 14:05:12 +00:00
Antigravity
d85851c979 chore(prisma): add missing migration for notebook hierarchy and trash
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 4s
2026-05-10 12:30:18 +00:00
Antigravity
916fb78dfb feat: hierarchical notebook system - trash, selectors, breadcrumb, sidebar tree
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m9s
- Schema: soft delete with trashedAt on Notebook model
- API: PATCH/GET notebooks support trashedAt filtering with cascade
- Sidebar: recursive tree rendering with collapse/expand, visual guides, hover actions
- HierarchicalNotebookSelector: portal-based dropdown with search, breadcrumbs, dropUp support
- AI chat: context selector with Toutes mes notes + notebook selector
- Agent detail: flat selects replaced with HierarchicalNotebookSelector
- Breadcrumb: notebook path display on home page
- Trash view: card grid with countdown, restore/permanent delete
- CSS: design tokens (ink, paper, blueprint, concrete, etc.)
- Types: parentId, trashedAt added to Notebook interface
2026-05-10 10:52:26 +00:00
Antigravity
d90b29b34f feat: hierarchical notebooks (tree), remove all list view code, delete 22 unused files
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m3s
- Add parentId to Notebook model (tree structure)
- Update sidebar to render parent/child notebooks with expand/collapse
- Add sub-notebook creation from parent notebook
- Remove 'list' from NotesViewMode type everywhere
- Delete 22 unused components, hooks, and UI files
- Wrap revalidatePath in try-catch to prevent save 500
- Update notebook API to support parentId in creation
2026-05-09 21:02:23 +00:00
Antigravity
5030204987 fix(db): add missing Label.type and UserAISettings.autoSave columns
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
These columns exist in schema.prisma but were never added via migration,
causing PrismaClientKnownRequestError on notebook/label queries in production.
Uses idempotent DO 4109514 IF NOT EXISTS 4109514 blocks to be safe on any DB state.
2026-05-09 15:46:21 +00:00
Antigravity
60a3fe5453 UI Stabilization: Global color theme updates (#75B2D6), AI Assistant styling refactor, and navigation fixes 2026-05-09 12:58:16 +00:00
Antigravity
97b08e5d0b feat: icon-only toolbar, versioning fixes, history modal, PanelRight repositioning
- Toolbar: remove text labels from all icon buttons (AI, Save, Preview, Convert)
  all buttons now icon-only with title tooltip for accessibility
- Toolbar: reposition PanelRight (info panel toggle) to far right after three-dot menu
- Versioning: decouple getNoteHistory/restoreNoteVersion from global userAISettings.noteHistory
  now checks note.historyEnabled directly — unblocks manual per-note history
- Versioning: add 'Sauvegarder cette version' button in Versions tab of info panel
  calls commitNoteHistory with visual feedback (spinner → success state)
- note-document-info-panel: import commitNoteHistory, add isSavingVersion state
- notes.ts: fix double guard that silently blocked all history operations
2026-05-09 07:28:03 +00:00
Antigravity
91b1201112 refactor: split NoteEditor into focused components + consolidate contexts
Phase 1: NoteEditor Split (64KB → 9 focused components)
- components/note-editor/: types.ts, context, toolbar, title-block,
  content-area, metadata-section, full-page, dialog compositions
- Maintains backwards compatibility via re-export from note-editor.tsx

Phase 2: Context Consolidation (5 → 3 contexts)
- NotebooksContext absorbs LabelContext (labels CRUD)
- EditorUIContext merges HomeViewContext + NotebookDragContext
- Removed: LabelContext, home-view-context, notebook-drag-context

Phase 3: React Query Infrastructure
- Added QueryProvider with @tanstack/react-query
- lib/query-keys.ts: centralized query key definitions
- lib/query-hooks.ts: useNotes, useNotebooksQuery, useLabelsQuery
- lib/use-refresh.ts: hybrid invalidateQueries + triggerRefresh helper
- NotebooksContext: invalidateQueries on mutations (with triggerRefresh fallback)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-08 14:31:08 +00:00
Antigravity
3b72e4afbb fix(prisma): colonnes Agent sourceNoteIds, slideTheme, slideStyle
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m33s
Aligne prisma/schema.prisma avec agent-actions.ts (typecheck Docker/Next).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-05 21:58:18 +00:00
Sepehr Ramezani
dbd49d6fcb feat: 8 AI providers, rich text editor, agent notifications, UI contrast & font settings
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m25s
- Add DeepSeek, OpenRouter, Mistral, Z.AI, LM Studio as AI providers
  with editable model names via Combobox in admin settings
- Fix OpenRouter broken by normalizeProvider bug in config.ts
- Convert agent-created notes from Markdown to HTML (TipTap rich text)
- Add Notification model + in-app notifications for agent results
- Agent notification click opens the created note directly
- Add note count display on notebook and inbox headers
- Fix checklist toggle in card view (persist state via localCheckItems)
- Add checklist creation option in tabs/list view (dropdown on + button)
- Fix image description ENOENT error with HTTP fallback
- Improve UI contrast across all themes (input, border, checkbox visibility)
- Add font family setting (Inter vs System Default) in Appearance settings
- Fix CSS font-sans variable conflict (removed dead Geist references)
- Update README with new features and 8 providers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-05-01 16:14:07 +02:00
1345403a31 feat: Notion-like rich text editor with TipTap, 4 note types, slash commands & bubble menu
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m33s
2026-05-01 01:11:03 +02:00
b92f6384a4 fix: chat memory lost between messages + per-note history
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m11s
Chat (AIChat floating widget): conversationId was never captured from
the API response, so every message created a new conversation with no
context. Now creates the conversation upfront before streaming (same
pattern as ChatContainer) so the ID persists across messages.

Note history: was stored globally in UserAISettings, so enabling
history on one note enabled it for ALL notes. Now each Note has its
own historyEnabled boolean field. The "Enable history" action only
affects the specific note. A migration adds the column with default
false.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 22:18:46 +02:00
ba6f0e9290 fix: add missing NoteHistory migration, fix manifest 403, add API error logging
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 43s
- Commit untracked 20260428150000_add_note_history migration (creates
  NoteHistory table + noteHistory column) that was causing 500s in prod
- Exclude static files (.json, .svg, .ico, etc.) from auth middleware
  to fix manifest.json 403
- Add console.error to echo API routes for production debug visibility

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 21:37:22 +02:00
69ea064ca8 feat: smart note history with manual/auto modes, delete entries, i18n fixes
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m16s
- Add noteHistoryMode setting (manual default / auto) with DB migration
- Manual mode: commit button in editor toolbar creates snapshots on demand
- Auto mode: smart snapshots with 20-char diff threshold + 5min cooldown,
  structural changes (color, pin, archive, labels) bypass cooldown
- Add delete individual history entries from history modal
- Fix sidebar: Notes nav no longer active on notebook pages
- Fix sidebar icon: replace filled Lightbulb with outlined FileText
- Fix title suggestions: change from amber to sky blue color scheme
- Fix hydration mismatch: add suppressHydrationWarning on locale dates
- Complete i18n: add history, sort, and AI chat translations for all 16 languages
- Translate French AI assistant section (40+ keys) from English to French
- Update README with new features and stack info

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-28 21:05:55 +02:00
38278c93c3 fix: make migration fully idempotent with DO blocks for all ALTER statements
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m3s
The ADD CONSTRAINT for Note.notebookId was not wrapped in an exception
handler, causing P3009 on production when the constraint already existed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 22:02:04 +02:00
3b3f4fdc9b feat: add migration for missing autoLabeling/languageDetection columns and indexes
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m3s
Production DB was missing autoLabeling and languageDetection on UserAISettings,
causing 500 errors on echo/connections endpoints. Also adds missing indexes
and fixes Note.notebookId FK to use ON DELETE SET NULL.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 21:50:33 +02:00
153c921960 fix: comprehensive i18n — replace hardcoded French/English strings with t() calls
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m7s
Replaced ~100+ hardcoded French and English text strings across 30+ components
with proper i18n t() calls. Added 57 new translation keys to all 15 locale files
(ar, de, en, es, fa, fr, hi, it, ja, ko, nl, pl, pt, ru, zh).

Key changes:
- contextual-ai-chat.tsx: 30 French strings → t() (actions, toasts, labels, placeholders)
- ai-chat.tsx: 15 French/English strings → t() (header, tabs, welcome, insights, history)
- note-inline-editor.tsx: 20 French fallbacks removed (toolbar, save status, checklist)
- lab-skeleton.tsx: French loading text → t()
- admin-header.tsx, header.tsx, editor-connections-section.tsx: French fallbacks removed
- New AI chat component, agent cards, sidebar, settings panel i18n cleanup

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 21:14:45 +02:00
950f024aa9 fix: add new migration to ensure agent schedule columns exist
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m3s
Previous migration (20260426130000) may be recorded as failed in
_prisma_migrations after a db push conflict. This new migration with
a different timestamp will be seen as pending and applied with
idempotent SQL that handles both cases.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 11:51:43 +02:00
9e9e17ed96 fix: make agent schedule migration idempotent for production
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m1s
Use DO blocks with EXCEPTION WHEN duplicate_column to safely handle
columns that may already exist from a previous db push.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 11:35:50 +02:00
102ccd13d4 fix: revert entrypoint to migrate deploy, add proper migration file
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m1s
Create migration 20260426130000_add_agent_schedule_fields with the 3 new
Agent columns (scheduledTime, scheduledDay, timezone). Reverts entrypoint
back to prisma migrate deploy. Removes redundant migration step from
deploy.yaml.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 11:12:23 +02:00
73de1cd26d feat: implement agent scheduled execution with cron and time picker
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m9s
- Add scheduledTime, scheduledDay, timezone fields to Agent schema
- Create calculateNextRun() helper with timezone-aware scheduling
- Add POST /api/cron/agents endpoint for external scheduler
- Calculate nextRun on agent create, update, and after execution
- Add time/day picker in agent form (daily/weekly/monthly)
- Show "Next run" countdown in agent card
- Add i18n keys for schedule UI (FR + EN)

External scheduler (N8N, Vercel Cron) should call /api/cron/agents
every 5-15 min. Requires `prisma db push` to apply schema changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 10:45:48 +02:00
986d438738 fix: resolve React Error #310 and refactor admin section
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
- Fix React bug #33580: remove Suspense boundaries co-located with Link components
- Delete settings/loading.tsx and admin/loading.tsx (root cause of race condition)
- Convert all admin navigation from Next.js Link to anchor tags
- Move admin pages to dedicated (admin) route group
- Add AdminHeader matching main header visual design
- Add AdminSidebar with anchor-based navigation
- Add /api/admin/models route handler (replaces server actions for GET)
- Add /api/debug/client-error for server-side browser error reporting
- Add useNoteRefreshOptional() to fix crash in AdminHeader
- Hide Admin Dashboard menu for non-admin users
- Change app icons from yellow to blue (#3A7CA5) matching brand primary
- Fix admin search bar width to match main header

Made-with: Cursor
2026-04-25 20:46:10 +02:00
Sepehr Ramezani
d3c2de2000 feat: add env setup wizard, fix docker-compose env passthrough and email from field
- Add interactive setup wizard (scripts/setup-env.js) with SQLite/PostgreSQL
  choice, AI provider config, email, MCP, admin account creation, and
  auto-switch of Prisma schema provider
- Fix docker-compose.yml: remove duplicate environment entries that overrode
  env_file values with empty strings (broke AI providers in Docker). Now only
  DATABASE_URL, NODE_ENV, NEXT_TELEMETRY_DISABLED remain in environment:
- Fix revalidateTag('system-config', '/settings') crash: Next.js 16 interprets
  the second arg as a cacheLife profile, not a path. Caused 500 on all admin
  settings saves
- Fix Resend "from" field: was building noreply@localhost which Resend rejects.
  Now uses SMTP_FROM from config, with localhost-aware fallback
- Add debug logging for auto-labeling background task
- Default DATABASE_URL changed from user:password to memento:memento

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-04-21 22:22:02 +02:00
Sepehr Ramezani
e4d4e23dc7 chore: clean up repo for public release
- Remove BMAD framework, IDE configs, dev screenshots, test files,
  internal docs, and backup files
- Rename keep-notes/ to memento-note/
- Update all references from keep-notes to memento-note
- Add Apache 2.0 license with Commons Clause (non-commercial restriction)
- Add clean .gitignore and .env.docker.example
2026-04-20 22:48:06 +02:00