mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 11:29:41 +02:00
Mirror the "Voxtral via mana-stt" label that already sits under the
transcript: a small italic line directly below the title input
showing which tier (and roughly which model) generated the title.
This way the user can see at a glance whether the title came from
the local rules engine, from Gemma 4 in their browser, from
gemma3:4b on the Mana server, or from Google Gemini — and can
decide whether to keep it or rewrite manually.
Storage:
apps/mana/apps/web/src/lib/modules/memoro/llm-watcher.svelte.ts
- When applying a completed title task, the watcher now also
stamps memo.metadata.titleSource with the LlmTier string
('none' | 'browser' | 'mana-server' | 'cloud') from the queue
row's `source` field. Stored in the existing plaintext metadata
object — no encryption needed (the tier name isn't sensitive
and the encryption registry for memos only covers
title/intro/transcript). Existing metadata fields are
spread-preserved so we don't accidentally wipe STT failure
markers etc.
Manual override clears the marker:
apps/mana/apps/web/src/lib/modules/memoro/stores/memos.svelte.ts
- memosStore.update() now detects when `title` is in the diff
and clears `metadata.titleSource` so the DetailView stops
showing "via Mana-Server (gemma3:4b)" for a title the user
typed themselves. Only fires when title is actually present
in the update payload — non-title updates leave metadata alone
so we don't blow away other markers.
Display:
apps/mana/apps/web/src/lib/modules/memoro/views/DetailView.svelte
- New TITLE_SOURCE_LABELS map gives each tier a human-readable
label that surfaces the actual model name where known:
none → "Lokal (regelbasiert)"
browser → "Auf deinem Gerät (Gemma 4)"
mana-server → "Mana-Server (gemma3:4b)"
cloud → "Google Gemini"
We deliberately don't reuse @mana/shared-llm's tierLabel()
because the model name is more informative than the abstract
tier in this UX context.
- $derived `titleSourceLabel` reads memo.metadata.titleSource
and validates it via an isLlmTier type guard. Returns null
(→ no label rendered) when:
* the entity hasn't loaded yet
* a title task is currently in flight (titleIsGenerating)
* the title input is currently focused (user is editing)
* the metadata field is missing or not a known tier value
- New `<div class="source-label title-source-label">` slot
between the title-row and the properties block, with a small
CSS override (.title-source-label) for a tighter top gap and
a slight left indent so it visually lines up under the input
text rather than under the input border.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| e2e | ||
| src | ||
| static | ||
| .env.example | ||
| .gitignore | ||
| Dockerfile | ||
| eslint.config.js | ||
| MIDDLEWARE_SECURITY.md | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| SETUP.md | ||
| svelte.config.js | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| vite.config.ts | ||
| WELCOME_ROUTE_SETUP.md | ||
Mana Web
Modern SvelteKit web application for Mana credit/mana management system.
Features
- 🔐 Authentication with Supabase
- 🎨 Tailwind CSS for styling
- 📱 Responsive design
- 🔄 Real-time updates
- 🏢 Organization management
- 👥 Team management
- 💰 Credit/Mana transfers
- 🧪 Comprehensive testing
Tech Stack
- Framework: SvelteKit 2.x with Svelte 5 (Runes)
- Language: TypeScript
- Styling: Tailwind CSS 3.x
- Backend: Supabase (PostgreSQL + Auth)
- Middleware: Mana Middleware API
- Testing: Vitest + Playwright
- Deployment: Vercel/Netlify ready
Getting Started
Prerequisites
- Node.js 20+ and pnpm
- Supabase account and project
- Access to Mana Middleware
Installation
# Install dependencies
pnpm install
# Copy environment variables
cp .env.example .env
# Update .env with your credentials:
# - PUBLIC_SUPABASE_URL
# - PUBLIC_SUPABASE_ANON_KEY
# - PUBLIC_MIDDLEWARE_URL
Development
# Start dev server
pnpm dev
# Run type checking
pnpm check
# Run tests
pnpm test
# Run E2E tests
pnpm test:e2e
Building
# Build for production
pnpm build
# Preview production build
pnpm preview
Project Structure
src/
├── routes/ # File-based routing
│ ├── (auth)/ # Auth routes (login, register)
│ ├── (app)/ # Protected app routes
│ │ ├── dashboard/
│ │ ├── organizations/
│ │ ├── teams/
│ │ └── settings/
│ └── api/ # API endpoints
├── lib/
│ ├── components/ # Reusable components
│ │ ├── ui/ # UI primitives
│ │ └── features/ # Feature components
│ ├── stores/ # Svelte stores
│ ├── utils/ # Utilities
│ ├── types/ # TypeScript types
│ └── server/ # Server-only code
│ ├── db/ # Database utilities
│ ├── auth/ # Auth helpers
│ └── api/ # API integration
├── hooks.server.ts # Server hooks
└── app.css # Global styles
Environment Variables
Public Variables (exposed to client)
PUBLIC_SUPABASE_URL- Supabase project URLPUBLIC_SUPABASE_ANON_KEY- Supabase anonymous keyPUBLIC_MIDDLEWARE_URL- Mana Middleware URLPUBLIC_APP_NAME- Application name
Private Variables (server-only)
Add any private API keys or secrets here.
Deployment
Netlify (Production Setup)
The app is currently deployed to https://app.mana.how using Netlify.
Prerequisites
# Install Netlify CLI globally
npm install -g netlify-cli
# Login to Netlify
netlify login
Initial Setup (One-time)
The project is already configured with @sveltejs/adapter-netlify. If you need to set it up from scratch:
# Install the Netlify adapter
pnpm add -D @sveltejs/adapter-netlify
Update svelte.config.js:
import adapter from '@sveltejs/adapter-netlify';
Environment Variables
Ensure your .env file exists with the following variables:
PUBLIC_SUPABASE_URL=your_supabase_url
PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
MIDDLEWARE_URL=https://mana-middleware-111768794939.europe-west3.run.app
Important: Set these same environment variables in Netlify Dashboard → Site Settings → Environment Variables for production builds.
Deployment
# 1. Install dependencies (if needed)
pnpm install
# 2. Build for production
pnpm build
# 3. Deploy to production (site: mana)
netlify deploy --prod --site mana --dir build
The build process creates:
build/- Static assets and client code.netlify/- Serverless functions for SSR
Build Output
After running pnpm build, you should see:
- ✅ Client bundle in
build/ - ✅ Server functions in
.netlify/ - ✅ Netlify configuration (
_headers,_redirects)
Vercel (Alternative)
# Install Vercel adapter instead
pnpm add -D @sveltejs/adapter-vercel
# Deploy
vercel
Docker
# Build image
docker build -t mana-web .
# Run container
docker run -p 3000:3000 mana-web
Contributing
- Create a feature branch
- Make your changes
- Run tests and type checking
- Submit a pull request
License
Private - All rights reserved