fix: unify theme system - fix theme switching persistence

- 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
This commit is contained in:
2026-01-18 22:33:41 +01:00
parent ef60dafd73
commit ddb67ba9e5
306 changed files with 59580 additions and 6063 deletions

View File

@@ -1,48 +1,67 @@
# Script to start MCP SSE Server for Memento
# Script pour démarrer le serveur MCP Keep Notes en mode SSE
# Mode: Server-Sent Events (HTTP)
Write-Host "`n╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
Write-Host "║ Starting Memento MCP SSE Server ║" -ForegroundColor Cyan
Write-Host "╚═══════════════════════════════════════════════════════════╝`n" -ForegroundColor Cyan
Write-Host ""
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host " 🚀 Keep Notes MCP Server (SSE)" -ForegroundColor Cyan
Write-Host "==========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "📌 Mode: SSE (HTTP sur port 3001)" -ForegroundColor Yellow
Write-Host "📌 Chemin: $PSScriptRoot" -ForegroundColor Yellow
Write-Host ""
# Check if running from correct directory
$currentDir = Get-Location
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
if ($scriptDir) {
Push-Location $scriptDir
# Vérifier si Prisma est généré
if (-not (Test-Path "node_modules\.prisma\client")) {
Write-Host "⚠️ Client Prisma non trouvé, génération en cours..." -ForegroundColor Yellow
npx prisma generate
if ($LASTEXITCODE -eq 0) {
Write-Host "✅ Client Prisma généré" -ForegroundColor Green
} else {
Write-Host "❌ Erreur lors de la génération du client Prisma" -ForegroundColor Red
exit 1
}
}
# Ensure we have node_modules
if (-not (Test-Path "node_modules")) {
Write-Host "📦 Installing dependencies..." -ForegroundColor Yellow
npm install
# Vérifier que Keep Notes est en cours d'exécution
Write-Host "🔍 Vérification de Keep Notes..." -ForegroundColor Cyan
try {
$response = Invoke-WebRequest -Uri "http://localhost:3000" -UseBasicParsing -TimeoutSec 5
Write-Host "✅ Keep Notes est en cours d'exécution (port 3000)" -ForegroundColor Green
} catch {
Write-Host "⚠️ Attention: Keep Notes n'est pas accessible sur localhost:3000" -ForegroundColor Yellow
Write-Host " Le serveur MCP SSE risque de ne pas fonctionner correctement" -ForegroundColor Yellow
Write-Host ""
$continue = Read-Host "Voulez-vous continuer quand même? (O/N)"
if ($continue -ne "O" -and $continue -ne "o") {
Write-Host "❌ Annulation" -ForegroundColor Red
exit 1
}
}
# Check if Prisma Client exists in parent keep-notes
$prismaClientPath = "..\keep-notes\node_modules\.prisma\client"
if (Test-Path $prismaClientPath) {
Write-Host "✅ Prisma Client found in keep-notes" -ForegroundColor Green
} else {
Write-Host "⚠️ Prisma Client not found. Run: cd ..\keep-notes && npx prisma generate" -ForegroundColor Yellow
Write-Host " Then restart this script." -ForegroundColor Yellow
Write-Host ""
Write-Host "⏳ Démarrage du serveur MCP SSE..." -ForegroundColor Green
Write-Host "🛑 Appuyez sur Ctrl+C pour arrêter" -ForegroundColor Red
Write-Host ""
Write-Host "🌐 Serveur accessible sur:" -ForegroundColor Cyan
Write-Host " - Local: http://localhost:3001" -ForegroundColor White
Write-Host " - Network: Trouvez votre IP avec 'ipconfig'" -ForegroundColor White
Write-Host ""
Write-Host "📋 Endpoints:" -ForegroundColor Cyan
Write-Host " - Health: GET http://localhost:3001/" -ForegroundColor White
Write-Host " - SSE: GET http://localhost:3001/sse" -ForegroundColor White
Write-Host " - Message: POST http://localhost:3001/message" -ForegroundColor White
Write-Host ""
# Démarrer le serveur
try {
node index-sse.js
} catch {
Write-Host "❌ Erreur lors du démarrage du serveur:" -ForegroundColor Red
Write-Host " $($_.Exception.Message)" -ForegroundColor Red
Write-Host ""
Write-Host "Dépannage:" -ForegroundColor Yellow
Write-Host "1. Vérifiez que le port 3001 n'est pas déjà utilisé" -ForegroundColor White
Write-Host "2. Vérifiez que Node.js est installé (node --version)" -ForegroundColor White
Write-Host "3. Vérifiez les dépendances (npm list)" -ForegroundColor White
exit 1
}
# Get local IP address
Write-Host "`n🔍 Detecting network configuration..." -ForegroundColor Cyan
$ipAddresses = Get-NetIPAddress -AddressFamily IPv4 | Where-Object { $_.InterfaceAlias -notlike "*Loopback*" -and $_.IPAddress -notlike "169.*" }
$mainIP = $ipAddresses | Select-Object -First 1 -ExpandProperty IPAddress
Write-Host "`n📡 Your IP addresses:" -ForegroundColor Cyan
foreach ($ip in $ipAddresses) {
Write-Host " - $($ip.IPAddress)" -ForegroundColor White
}
Write-Host "`n🌐 For N8N configuration, use:" -ForegroundColor Green
Write-Host " http://$mainIP:3001/sse" -ForegroundColor Yellow -BackgroundColor DarkGray
Write-Host "`n🚀 Starting MCP SSE Server on port 3001..." -ForegroundColor Cyan
Write-Host " Press Ctrl+C to stop`n" -ForegroundColor Gray
# Start the server
node index-sse.js