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
3 changes: 2 additions & 1 deletion docker-relay-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ level = "info"
# Explicitly allow these event kinds
# 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]
# 30023: Long Text
event_kind_allowlist = [0, 1, 5, 30000, 30301, 30302, 30303, 30023, 20001]

27 changes: 13 additions & 14 deletions e2e/test-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ export async function loginWithTestUser(page: Page, user: TestUser) {

// Development-Login (wenn verfügbar)
await page.evaluate((userData) => {
// @ts-ignore
// @ts-expect-error
if (window.authStore && window.authStore.loginWithDummy) {
// @ts-ignore
// @ts-expect-error
window.authStore.loginWithDummy(userData.name, userData.pubkey);
}
}, user);
Expand Down Expand Up @@ -290,7 +290,7 @@ export async function loginWithTestUser(page: Page, user: TestUser) {
await page.locator('button:has-text("Anmelden")').click();
}
}
} catch (e) {
} catch {
console.log('UI-Login fehlgeschlagen, nutze Development-API');
}

Expand Down Expand Up @@ -337,13 +337,12 @@ export async function shareTestBoard(
const { pubkey, role } = args;

try {
// @ts-ignore
if (window.boardStore) {
if (role === 'editor') {
// @ts-ignore
// @ts-expect-error
await window.boardStore.addEditor(pubkey);
} else {
// @ts-ignore
// @ts-expect-error
await window.boardStore.addViewer(pubkey);
}
return true;
Expand Down Expand Up @@ -448,7 +447,7 @@ export async function attemptBoardAction(
): Promise<{ success: boolean; error?: string; data?: any }> {
try {
switch (action) {
case 'createCard':
case 'createCard': {
const addButton = page.locator('button:has-text("Neue Karte")').first();
if (!(await addButton.isVisible())) {
return { success: false, error: 'Add Card button not visible' };
Expand All @@ -460,8 +459,8 @@ export async function attemptBoardAction(

await expect(page.locator(`text="${options?.title || 'Test Karte'}"`)).toBeVisible({ timeout: 3000 });
return { success: true, data: { title: options?.title || 'Test Karte' } };
case 'createColumn':
}
case 'createColumn': {
const columnButton = page.locator('button:has-text("Neue Spalte")').first();
if (!(await columnButton.isVisible())) {
return { success: false, error: 'Add Column button not visible' };
Expand All @@ -473,8 +472,8 @@ export async function attemptBoardAction(

await expect(page.locator(`text="${options?.name || 'Test Spalte'}"`)).toBeVisible({ timeout: 3000 });
return { success: true, data: { name: options?.name || 'Test Spalte' } };
case 'deleteBoard':
}
case 'deleteBoard': {
const settingsButton = page.locator('button:has-text("Einstellungen")').first();
if (!(await settingsButton.isVisible())) {
return { success: false, error: 'Settings button not visible' };
Expand All @@ -492,8 +491,8 @@ export async function attemptBoardAction(
// Prüfe ob zur Board-Liste umgeleitet
await expect(page.locator('text="Boards"')).toBeVisible({ timeout: 5000 });
return { success: true };
case 'editCard':
}
case 'editCard': {
const card = page.locator('[data-testid="card"]').or(
page.locator('text="Test Karte"')
).first();
Expand All @@ -509,7 +508,7 @@ export async function attemptBoardAction(

await expect(page.locator(`text="${options?.newTitle || 'Edited Card'}"`)).toBeVisible({ timeout: 3000 });
return { success: true, data: { newTitle: options?.newTitle || 'Edited Card' } };
}
default:
return { success: false, error: `Unknown action: ${action}` };
}
Expand Down
11 changes: 8 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ export default defineConfig(
languageOptions: {
globals: { ...globals.browser, ...globals.node }
},
rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
"no-undef": 'off' }
rules: {
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'svelte/require-each-key': 'off'
}
},
{
files: [
Expand Down
2 changes: 1 addition & 1 deletion src/lib/agent/llmRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export async function llmRequest<T = any>(
try {
return JSON.parse(content) as T;
} catch (err) {
console.error('❌ JSON Parse Error:', content);
console.error('❌ JSON Parse Error:', (err as Error).message);
throw new Error(`LLM returned invalid JSON: ${content.substring(0, 100)}`);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/classes/BoardModel.card-operations.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* Für Integration Tests mit echtem Relay siehe: BoardModel.card-integration.spec.ts
*/

import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import { Board, Column, Card } from './BoardModel';
import type { BoardProps, CardProps } from './BoardModel';
import { describe, it, expect, vi } from 'vitest';
import { Board, Card } from './BoardModel';
import type { CardProps } from './BoardModel';

// ============================================================================
// TEST HELPERS
Expand Down
5 changes: 3 additions & 2 deletions src/lib/components/CardEditModal.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { resolve } from '$app/paths';
import type { CardProps } from '../classes/BoardModel.js';

interface Props {
Expand Down Expand Up @@ -215,9 +216,9 @@

{#if (formData.links || []).length > 0}
<div class="links-list">
{#each formData.links as link}
{#each formData.links as link (link.id)}
<div class="link-item">
<a href={link.url} target="_blank" rel="noopener noreferrer" class="link-title">{link.title}</a>
<a href={resolve(link.url, {})} target="_blank" rel="noopener noreferrer" class="link-title">{link.title}</a>
<span class="link-url">({link.url})</span>
<button
type="button"
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/ImportPopover.svelte.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { describe, it, expect } from 'vitest';

/**
* UNIT TESTS FÜR IMPORTPOPOVER.SVELTE KOMPONENTE
Expand Down Expand Up @@ -271,7 +271,6 @@ describe('ImportPopover Component - Business Logic', () => {
it('zeigt Loading-Text während Import', () => {
// Arrange
const isLoading = true;
const isBackupFile = false;

// Act
const buttonText = isLoading
Expand Down
7 changes: 4 additions & 3 deletions src/lib/components/auth/LoginSheet.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import KeyRoundIcon from "@lucide/svelte/icons/key-round";
import Nos2x from './assets/nos2x.png';
import Alby from './assets/alby.svg';
import { resolve } from '$app/paths';

interface Props {
open: boolean;
Expand All @@ -33,7 +34,7 @@

onClose();

if (user) goto('/cardsboard');
if (user) goto(resolve('/cardsboard', {}));
} catch (err: any) {
error = err.message;

Expand All @@ -53,7 +54,7 @@

const user = await authStore.loginWithNsec(nsecInput);
onClose();
if (user) goto('/cardsboard');
if (user) goto(resolve('/cardsboard', {}));
} catch (err: any) {
error = err.message;
} finally {
Expand All @@ -68,7 +69,7 @@

const user = await authStore.loginWithNip46(nip46Input);
onClose();
if (user) goto('/cardsboard');
if (user) goto(resolve('/cardsboard', {}));
} catch (err: any) {
error = err.message;
} finally {
Expand Down
5 changes: 3 additions & 2 deletions src/lib/components/board/FollowBoardDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
import { boardStore } from "$lib/stores/kanbanStore.svelte";
import { authStore } from "$lib/stores/authStore.svelte";
import { BoardSharingOperations } from "$lib/stores/boardstore/sharing";
import { Board, type BoardProps } from "$lib/classes/BoardModel";
import { Board } from "$lib/classes/BoardModel";
import { goto } from "$app/navigation";
import { toast } from "svelte-sonner";
import { getContext } from "svelte";
import type NDK from "@nostr-dev-kit/ndk";
import EyeIcon from "@lucide/svelte/icons/eye";
import CalendarIcon from "@lucide/svelte/icons/calendar";
import UserIcon from "@lucide/svelte/icons/user";
import { resolve } from "$app/paths";

// Get NDK from context (set in +layout.svelte)
const ndk = getContext<NDK>('ndk');
Expand Down Expand Up @@ -110,7 +111,7 @@

// Zum Board navigieren (Board ist bereits geladen!)
open = false;
goto('/cardsboard');
goto(resolve('/cardsboard', {}));

} catch (error: any) {
errorMessage = error.message || 'Fehler beim Folgen des Boards';
Expand Down
4 changes: 0 additions & 4 deletions src/lib/components/board/ShareButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
import { Button } from "$lib/components/ui/button";
import ShareDialog from "./ShareDialog.svelte";
import { boardStore } from "$lib/stores/kanbanStore.svelte";
import { authStore } from "$lib/stores/authStore.svelte";
import { BoardRole } from "$lib/types/sharing";
import { toast } from "svelte-sonner";
import ShareIcon from "@lucide/svelte/icons/share";
import HeartIcon from "@lucide/svelte/icons/heart";
import HeartOffIcon from "@lucide/svelte/icons/heart-off";

// Props
let { boardId } = $props<{ boardId: string }>();

// State
let showShareDialog = $state(false);
let isLoading = $state(false);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/board/ShareDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
description: 'Der Share-Link wurde in die Zwischenablage kopiert'
});
setTimeout(() => linkCopied = false, 2000);
} catch (error) {
} catch {
toast.error('Fehler beim Kopieren', {
description: 'Link konnte nicht kopiert werden'
});
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/board/VersionHistory.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import * as Dialog from '$lib/components/ui/dialog/index.js';
import { Button } from '$lib/components/ui/button/index.js';
import { Input } from '$lib/components/ui/input/index.js';
import { Label } from '$lib/components/ui/label/index.js';
import { Badge } from '$lib/components/ui/badge/index.js';
import { Separator } from '$lib/components/ui/separator/index.js';
import { Spinner } from '$lib/components/ui/spinner/index.js';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/settings/SettingsPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
</div>
<Switch
checked={settings.showLeftSidebar}
onCheckedChange={(checked) => settingsStore.toggleLeftSidebar()}
onCheckedChange={() => settingsStore.toggleLeftSidebar()}
/>
</div>

Expand All @@ -271,7 +271,7 @@
</div>
<Switch
checked={settings.showRightSidebar}
onCheckedChange={(checked) => settingsStore.toggleRightSidebar()}
onCheckedChange={() => settingsStore.toggleRightSidebar()}
/>
</div>

Expand Down
13 changes: 0 additions & 13 deletions src/lib/stores/boardstore/nostr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1331,19 +1331,6 @@ export class NostrIntegration {
relaysPrivate: settingsStore.settings.relaysPrivate
});

// ⚠️ SICHERHEITS-CHECK: Warne wenn Draft nicht publiziert werden kann
if (normalizedState === 'draft' && targetRelays.length === 0) {
const mode = settingsStore.settings.draftPublishingMode;

if (mode === 'private-relays') {
toast.warning('🔒 Keine privaten Relays konfiguriert', {
description: 'Karten-Änderungen werden nur lokal gespeichert. Gehe zu Einstellungen → Nostr → Private Relays um Synchronisation zu aktivieren.',
duration: 6000
});
console.warn('[NostrIntegration] 🔒 Draft card cannot be published - no private relays configured');
}
}

const syncManager = getSyncManager();
const publishedEvent = await syncManager.publishOrQueue(
event,
Expand Down
Loading