Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

**Projekt:** Nostr-basiertes KI-Kanban-Board mit Svelte 5
**Repository:** edufeed-org/kanban-editor
**Letztes Update:** 29. Oktober 2025
**Status:** Phase 1 (In Entwicklung)
**Letztes Update:** 3. Dezember 2025
**Status:** Phase 1 ✅ COMPLETE (inkl. Board Snapshots)
**Governance:** 🔴 v3.0 ACTIVE - Code ↔ Docs Sync MANDATORY

---
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Changelog

## Version 4.7.0 - Board Snapshots / Versionshistorie 📸

**Datum:** 3. Dezember 2025
**Branch:** `main`
**Status:** ✅ Vollständig implementiert

### ✨ Neues Feature: Board Versioning

Benutzer können jetzt **manuelle Snapshots** ihrer Kanban-Boards erstellen und bei Bedarf zu früheren Versionen zurückkehren.

#### Features
- **Manuelles Speichern von Versionen** - Button "Versionen" in der Topbar
- **Versionshistorie anzeigen** - Liste aller Snapshots mit Metadaten
- **Wiederherstellen** - Zurückkehren zu einem früheren Board-Zustand
- **Automatisches Backup** vor jeder Wiederherstellung

#### Technische Details
- Snapshots werden als **Kind 30303 Nostr Events** gespeichert (non-replaceable)
- Speicherung auf privaten Relays (für Draft-Boards) oder öffentlichen Relays
- Event-Tags: `a` (Board-Referenz), `v` (Label), `r` (Grund), `t` (Timestamp)
- Vollständiges Board-JSON im Event-Content

#### Komponenten
- `VersionHistory.svelte` - Dialog-Komponente für Versionshistorie
- `NostrIntegration.publishSnapshot()` - Event-Publishing
- `NostrIntegration.loadSnapshots()` - Laden von Snapshots von Relays
- `BoardStore.createManualSnapshot()` / `rollbackToSnapshot()` - Store-API

#### Relay-Konfiguration
- Kind 30303 zur Relay-Allowlist hinzugefügt (`docker-relay-config.toml`)
- Explizites Laden von privaten Relays für Snapshots

### 📚 Dokumentation
- `docs/FEATURE/BOARD-SNAPSHOTS.md` - Vollständige Feature-Dokumentation
- ROADMAP.md aktualisiert (Meilenstein 1.5C: DONE)

### 🔧 Technische Fixes
- TypeScript-Fehler in `nostr.ts` und `syncManager.svelte.ts` behoben
- Relay-Pool-Handling verbessert (keine `addRelay(url)` mehr, da Relays bereits im Pool)

---

## Unreleased - Board-Sharing Realtime Anzeige 🚀

**Datum:** 24. November 2025
Expand Down
4 changes: 3 additions & 1 deletion docker-relay-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ level = "info"
# Limits
[limits]
# Explicitly allow these event kinds
event_kind_allowlist = [0, 1, 5, 30000, 30301, 30302, 20001]
# 0: Metadata, 1: Text Note, 5: Event Deletion, 30000: Categorized People List
# 30301: Kanban Board, 30302: Kanban Card, 30303: Kanban Snapshot, 20001: Ephemeral Soft Lock
event_kind_allowlist = [0, 1, 5, 30000, 30301, 30302, 30303, 20001]

14 changes: 6 additions & 8 deletions docs/COLLABORATION/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# 🗺️ Roadmap: Nostr-basiertes KI-Kanban-Board

**Version:** 3.3 (PHASE 4 INFRASTRUCTURE ANALYSIS - 13. November 2025)
**Aktualisiert:** 13. November 2025 (Phase 4 Infrastruktur-Analyse)
**Status:** ✅ **PHASE 1: 95%** | ✅ **PHASE 3: 90%** | 🟡 **Phase 2: 15%** | 🟡 **Phase 4: 85% Infrastructure**
**Version:** 3.4 (PHASE 1.5C COMPLETE - 3. Dezember 2025)
**Aktualisiert:** 3. Dezember 2025 (Board Snapshots Feature fertig)
**Status:** ✅ **PHASE 1: 100% COMPLETE** | ✅ **PHASE 3: 90%** | 🟡 **Phase 2: 15%** | 🟡 **Phase 4: 85% Infrastructure**
**Projekt-Ziel:** Vollständige Implementierung bis 31.12.2025, Testing ab 01.01.2026

**Status:** ✅ **PHASE 1: COMPLETE** | ✅ **PHASE 3: 90%** | 🟡 **Phase 2: 15%** | 🟡 **Phase 4: 85% Infrastructure**
**Projekt-Ziel:** Vollständige Implementierung bis 31.12.2025, Testing ab 01.01.2026

**🆕 PHASE 1 COMPLETION (28.12.2024):**
- ✅ **Phase 1 Status:** **100% COMPLETE** (alle Meilensteine 1.0-1.6 DONE!)
**🆕 PHASE 1 COMPLETE (3.12.2025):**
- ✅ **Phase 1 Status:** **100% COMPLETE** (alle Meilensteine 1.0-1.6 + 1.5C DONE!)
- ✅ **Phase 3 Status:** **90% Complete** (ChatStore, AIPanel, LLM ALL DONE, 3 AI Actions fehlen!)
- 🟡 **Phase 2 Status:** **15% Complete** (Settings+Dark Mode DONE, Mobile+A11y offen)
- 🟡 **Phase 4 Status:** **85% Infrastructure Ready** (SoftLockManager, MergeEngine, SyncManager ✅! Nur UI fehlt)
- ✅ **MEILENSTEIN 1.5C COMPLETE:** Board Snapshots / Versionshistorie Feature FERTIG!
- ✅ **MEILENSTEIN 1.6 COMPLETE:** Demo Board System für anonyme User + benutzerbasierte Filterung FERTIG!

**🆕 Neu in v3.2 (Demo Board System - 28.12.2024):**
Expand Down
211 changes: 211 additions & 0 deletions docs/FEATURE/BOARD-SNAPSHOTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# Board Versioning / Snapshots Feature

**Status:** ✅ Vollständig Implementiert (Phase 1.5C)
**Erstellt:** 28. Dezember 2024
**Aktualisiert:** 3. Dezember 2025
**Basiert auf:** `docs/PROPOSALS/BOARD-VERSIONING.md`

---

## 📋 Übersicht

Das Board Versioning Feature ermöglicht es Benutzern, **manuelle Snapshots** ihrer Kanban-Boards zu erstellen und bei Bedarf zu früheren Versionen zurückzukehren. Snapshots werden als **Kind 30303 Nostr Events** gespeichert (non-replaceable).

---

## ✨ Features

### 1. Manuelles Speichern von Versionen
- Button "Versionen" in der Topbar öffnet den VersionHistory-Dialog
- User kann ein Label/eine Beschreibung eingeben (z.B. "Vor großem Umbau")
- Snapshot wird als Kind 30303 Event auf Nostr Relays veröffentlicht

### 2. Versionshistorie anzeigen
- Liste aller gespeicherten Snapshots sortiert nach Datum (neueste zuerst)
- Anzeige von:
- Label/Beschreibung
- Zeitstempel (relativ und absolut)
- Anzahl der Spalten und Karten
- Erstellungsgrund (manuell, automatisch, vor Import, Backup)

### 3. Wiederherstellen einer Version
- "Wiederherstellen" Button pro Snapshot
- Bestätigungs-Dialog mit Warnung
- **Automatisches Backup** des aktuellen Zustands vor der Wiederherstellung
- Board wird vollständig auf den Snapshot-Zustand zurückgesetzt

---

## 🏗️ Technische Architektur

### Event-Struktur (Kind 30303)

```javascript
{
kind: 30303, // Non-replaceable - jeder Snapshot ist permanent
tags: [
["a", "30301:<author>:<board-id>"], // Referenz zum Board
["v", "User-Label"], // Benutzer-Beschreibung
["r", "manual"], // Grund (manual|auto_save|before_import|before_restore)
["t", "1735392000"] // Unix-Timestamp
],
content: "{...komplettes Board-JSON...}" // Board.getContextData(true)
}
```

### Komponenten-Übersicht

```
src/
├── lib/
│ ├── stores/
│ │ ├── kanbanStore.svelte.ts ← Snapshot-Methoden hinzugefügt
│ │ │ ├── createManualSnapshot()
│ │ │ ├── loadSnapshots()
│ │ │ ├── rollbackToSnapshot()
│ │ │ └── createAutoSnapshot()
│ │ │
│ │ └── boardstore/
│ │ └── nostr.ts ← NostrIntegration erweitert
│ │ ├── publishSnapshot()
│ │ ├── loadSnapshots()
│ │ ├── fetchSnapshotByLabel()
│ │ └── fetchSnapshotById()
│ │
│ ├── components/
│ │ └── board/
│ │ ├── index.ts ← Export hinzugefügt
│ │ └── VersionHistory.svelte ← NEU: Dialog-Komponente
│ │
│ └── utils/
│ └── nostrEvents.ts ← EVENT_KINDS.SNAPSHOT (30303)
└── routes/
└── cardsboard/
├── Topbar.svelte ← VersionHistory importiert
└── types.ts ← Snapshot-Typen definiert
```

---

## 📖 API-Referenz

### BoardStore Methoden

#### `createManualSnapshot(label: string): Promise<boolean>`
Erstellt einen manuellen Snapshot des aktuellen Board-Zustands.

```typescript
await boardStore.createManualSnapshot('Vor großem Umbau');
```

#### `loadSnapshots(): Promise<BoardSnapshot[]>`
Lädt alle Snapshots für das aktuelle Board von Nostr Relays.

```typescript
const snapshots = await boardStore.loadSnapshots();
// Returns: Array<{ id, label, timestamp, reason, cardCount, columnCount, createdBy, boardData }>
```

#### `rollbackToSnapshot(snapshotId: string): Promise<boolean>`
Stellt das Board auf einen früheren Snapshot wieder her.

```typescript
// Erstellt automatisch ein Backup vor der Wiederherstellung!
await boardStore.rollbackToSnapshot('snapshot-event-id');
```

#### `createAutoSnapshot(reason: 'before_import' | 'auto_save'): Promise<boolean>`
Erstellt einen automatischen Snapshot (z.B. vor Import-Operationen).

```typescript
await boardStore.createAutoSnapshot('before_import');
```

---

## 🎨 UI-Komponente

### VersionHistory.svelte

Die Komponente besteht aus:

1. **Trigger-Button** (in Topbar)
- Icon: History
- Label: "Versionen"

2. **Dialog**
- Header: "Versionshistorie"
- Input für neues Snapshot-Label
- "Speichern" Button

3. **Snapshot-Liste**
- Karten pro Snapshot mit:
- Label (fett)
- Badge für Grund (Manuell, Auto, Backup, Vor Import)
- Metadaten (Datum, Spalten, Karten, Ersteller)
- "Wiederherstellen" Button
- Bestätigungs-Dialog für Wiederherstellung

---

## 📝 Verwendungsbeispiele

### Beispiel 1: Vor größeren Änderungen sichern

```typescript
// Im Code (z.B. vor Import)
await boardStore.createManualSnapshot('Backup vor großem Import');

// Dann Import durchführen...
await boardStore.importBoardFromJson(jsonData, 'merge');
```

### Beispiel 2: Snapshot per UI erstellen

1. Klicke auf "Versionen" in der Topbar
2. Gib ein Label ein (z.B. "Version 1.0 - Fertig für Review")
3. Klicke "Speichern"
4. Toast zeigt Bestätigung

### Beispiel 3: Zu einem früheren Stand zurückkehren

1. Klicke auf "Versionen" in der Topbar
2. Finde den gewünschten Snapshot in der Liste
3. Klicke "Wiederherstellen"
4. Bestätige die Warnung
5. Board wird zurückgesetzt, Toast zeigt Bestätigung

---

## 🔐 Sicherheit & Datenschutz

- Snapshots werden auf denselben Relays gespeichert wie das Board
- Die publishState des Boards (draft/published/archived) wird für Relay-Auswahl verwendet
- Automatische Backups vor Wiederherstellung verhindern Datenverlust
- Snapshot-Content ist das komplette Board-JSON (inkl. aller Karten und Metadaten)

---

## 🚀 Zukünftige Erweiterungen (Phase 2+)

- [ ] Auto-Save Snapshots bei bestimmten Trigger-Events
- [ ] Snapshot-Diff Ansicht (was hat sich geändert?)
- [ ] Snapshot-Suche nach Label
- [ ] Export einzelner Snapshots als JSON
- [ ] Benachrichtigungen bei Snapshot-Erstellung durch andere Maintainer

---

## 📚 Verwandte Dokumentation

- [Board Versioning Proposal](./PROPOSALS/BOARD-VERSIONING.md) - Ursprünglicher Design-Vorschlag
- [Export/Import Feature](./FEATURE/IMPORT-EXPORT.md) - Board-Export/Import
- [Merge System](./FEATURE/MERGE-SYSTEM.md) - Konfliktauflösung
- [ROADMAP](./COLLABORATION/ROADMAP.md) - Projekt-Roadmap

---

**Implementiert am:** 28. Dezember 2024
**Getestet mit:** svelte-check (0 Fehler)
**Basiert auf:** Phase 1.5 BOARD-VERSIONING.md Proposal
1 change: 1 addition & 0 deletions docs/_INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ docs/
| [`MERGE-SYSTEM.md`](./FEATURE/MERGE-SYSTEM.md) | Phase 1.5 - Git-like 3-way Merge + Visual Test Route | ✅ Neu (26.10.) |
| [`SHARELINK.md`](./FEATURE/SHARELINK.md) | Phase 1.5 - URL-basiertes Board-Sharing mit Token-Encoding | ✅ Neu (31.10.) |
| [`IMPORT-EXPORT.md`](./FEATURE/IMPORT-EXPORT.md) | Phase 1.5 - JSON-Export/Import mit 3 Modi (merge/new/overwrite) | ✅ Neu (31.10.) |
| [`BOARD-SNAPSHOTS.md`](./FEATURE/BOARD-SNAPSHOTS.md) | 🆕 **NEU (28.12.)**: Phase 1.5 - Board Versioning mit Kind 30303 Snapshots | ✅ Neu (28.12.) |
| [`CARD-DESIGN.md`](./FEATURE/CARD-DESIGN.md) | 🆕 **NEU (06.11.)**: UI/UX Design für Card-Komponente mit Badges & Popover | ✅ Neu (06.11.) |
| [`RELAY-SELECTION-IMPLEMENTATION.md`](./FEATURE/RELAY-SELECTION-IMPLEMENTATION.md) | ✅ Relay Selection Implementation Summary (referenziert von Test Guide) | ✅ |

Expand Down
Loading