Translates all German user-facing strings (command names, notices, settings, modal labels, template names/descriptions, error messages, status bar, and code comments) to English. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
107 lines
5.4 KiB
Markdown
107 lines
5.4 KiB
Markdown
# Logfire — Obsidian Plugin
|
|
|
|
Kombiniertes Plugin aus **Basefire** (SQLite-Query-Engine) und **Logfire** (Event-Logging).
|
|
Trackt alle Vault-Aktivitaeten, speichert in SQLite, macht per SQL abfragbar, visualisiert mit Charts/Dashboards.
|
|
|
|
## Technischer Stack
|
|
|
|
- **SQLite**: `better-sqlite3` (nativ, synchron, schnell)
|
|
- **Build**: esbuild mit `nativeModulePlugin` fuer Electron-Kompatibilitaet
|
|
- **Desktop-only** (FileSystemAdapter erforderlich)
|
|
- **Autor**: tolvitty
|
|
|
|
## Architektur
|
|
|
|
```
|
|
src/
|
|
├── main.ts # Plugin-Einstieg, Lifecycle
|
|
├── types.ts # Event-Typen, Settings, Query-Interfaces
|
|
├── core/
|
|
│ ├── database.ts # better-sqlite3, Schema, Retention, Maintenance
|
|
│ ├── event-bus.ts # Circular Buffer, Pub/Sub, Auto-Flush
|
|
│ ├── session-manager.ts # Session-Start/End, Dauer-Tracking
|
|
│ ├── content-analyzer.ts # Snapshot-Cache, Wort-/Link-/Tag-Diffs
|
|
│ └── query-builder.ts # QueryConfig → parametrisiertes SQL
|
|
├── collectors/
|
|
│ ├── file-collector.ts # File CRUD Events
|
|
│ ├── content-collector.ts # Semantische Content-Analyse
|
|
│ ├── nav-collector.ts # Navigation-Tracking
|
|
│ ├── editor-collector.ts # CM6 ViewPlugin, Debouncing
|
|
│ └── system-collector.ts # Command-Tracking
|
|
├── query/
|
|
│ ├── processor.ts # Code-Block-Prozessoren (logfire, logfire-sql, logfire-dashboard)
|
|
│ ├── query-modal.ts # Interaktiver SQL-Editor (Shorthand + SQL)
|
|
│ └── virtual-tables.ts # _files, _links, _tags, _headings
|
|
├── viz/
|
|
│ ├── table-renderer.ts # Table, Timeline, Summary, Metric, List, Heatmap
|
|
│ ├── chart-renderer.ts # 10 SVG-Chart-Typen (Bar, Line, Pie, Gauge, ...)
|
|
│ └── dashboard.ts # Multi-Widget-Dashboards, Grid-Layout
|
|
├── management/
|
|
│ ├── history.ts # Automatische Query-History mit Metriken
|
|
│ ├── favorites.ts # Gespeicherte Queries, Kategorien, Tags
|
|
│ └── templates.ts # Built-in + Custom Templates, Parameter-Substitution
|
|
├── projection/
|
|
│ ├── formatters.ts # Query-Results → Markdown (Timeline, Table, Summary, Metric, Heatmap)
|
|
│ ├── template-registry.ts # Built-in + Custom ProjectionTemplate Verwaltung
|
|
│ ├── projection-engine.ts # Kern-Engine: Scheduling, Session-End-Listener, PickerModal
|
|
│ └── presets/
|
|
│ ├── daily-log.ts # Tagesprotokoll-Preset
|
|
│ ├── session-log.ts # Session-Protokoll-Preset
|
|
│ └── weekly-digest.ts # Wochenuebersicht-Preset
|
|
├── ui/
|
|
│ ├── settings-tab.ts # Obsidian-native Settings
|
|
│ ├── status-bar.ts # Live-Status-Widget (Recording/Paused)
|
|
│ ├── event-stream-view.ts # Echtzeit-Event-Sidebar
|
|
│ ├── schema-view.ts # Schema-Browser (Tabellen, Spalten, Indizes)
|
|
│ └── initial-scan-modal.ts # Initialer Vault-Scan mit Fortschritt
|
|
```
|
|
|
|
## DB-Schema
|
|
|
|
**Kern-Tabellen** (database.ts):
|
|
- `events` — id, timestamp, type, category, source, target, payload, session
|
|
- `sessions` — id, start_time, end_time, vault_name
|
|
- `baseline` — file_path, word_count, char_count, links, tags, headings, ...
|
|
- `daily_stats` — date, file_path, events_count, words_added/removed, time_active_ms
|
|
- `monthly_stats` — wie daily_stats, aggregiert pro Monat
|
|
|
|
**Virtual Tables** (virtual-tables.ts):
|
|
- `_files` — path, name, basename, extension, size, created, modified, folder
|
|
- `_links` — from_path, to_path, display_text, link_type
|
|
- `_tags` — path, tag
|
|
- `_headings` — path, level, heading
|
|
|
|
## Konventionen
|
|
|
|
- **Sprache**: Code und Variablennamen auf Englisch, UI-Texte und Commits auf Deutsch
|
|
- **Commits**: Kleinschrittig, atomar, deutsch. Niemals pushen (Nutzer pusht manuell)
|
|
- **Branching**: Feature-Branches (`feature/<name>`), Merge mit `--no-ff` in `main`
|
|
- **CSS**: Ausschliesslich Obsidian-Variablen, Monospace, "Utilitarian System Monitor" Aesthetic
|
|
- **Charts**: Reines SVG, keine externen Bibliotheken
|
|
- **Queries**: `Record<string, unknown>[]` Format (better-sqlite3 Rueckgabe)
|
|
- **Storage**: History/Favorites/Templates in localStorage, Plugin-Daten via loadData/saveData
|
|
|
|
## Feature-Roadmap
|
|
|
|
### Abgeschlossen
|
|
|
|
- [x] **Feature 1**: Projekt-Grundgeruest & Datenbank (`feature/grundgeruest`)
|
|
- [x] **Feature 2**: Event-System & Collectors (`feature/event-system`)
|
|
- [x] **Feature 3**: Echtzeit-UI (`feature/echtzeit-ui`)
|
|
- [x] **Feature 4**: SQL-Query-Engine (`feature/sql-engine`)
|
|
- [x] **Feature 5**: Virtual Tables (`feature/virtual-tables`)
|
|
- [x] **Feature 6**: Datenvisualisierung (`feature/visualisierung`)
|
|
- [x] **Feature 7**: Query-Management (`feature/query-management`)
|
|
- [x] **Feature 8**: Projections & Reports (`feature/projections`)
|
|
- [x] **Feature 9**: Polish & Extras (`feature/polish`)
|
|
|
|
## Build & Test
|
|
|
|
```bash
|
|
npm run build # Production-Build (esbuild)
|
|
npm run dev # Watch-Mode
|
|
```
|
|
|
|
Build-Output: `main.js` (aktuell ~86KB), `styles.css`, `manifest.json`
|
|
|
|
Zum Testen: Plugin-Ordner in `.obsidian/plugins/logfire/` eines Vaults verlinken/kopieren.
|