Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(personen): der Satz am Hauptschalter verspricht nur noch, was der Code haelt

purple217f59c10505
diff --git a/src/components/personas/PersonaPanel.tsx b/src/components/personas/PersonaPanel.tsx
index 61e98abb..7509ef8d 100644
--- a/src/components/personas/PersonaPanel.tsx
+++ b/src/components/personas/PersonaPanel.tsx
@@ -18,7 +18,12 @@ export function PersonaPanel() {
{/* Master switch — controls whether any persona system prompt is
applied at all. When off, every new chat runs the raw model. The
picker below stays interactive so the user can pre-select a persona
- for the moment they flip the switch on. (Ported from uselu web.) */}
+ for the moment they flip the switch on. (Ported from uselu web.)
+ The line under the switch names the per-chat toggle on purpose:
+ chatStore creates every new conversation with `personaEnabled:
+ false`, so a globally chosen persona is prepared, never applied
+ on its own. Two testers in a row read the old wording as a
+ promise and filed the missing persona as a bug (T13d). */}
<div className="flex items-center justify-between mb-3 pb-2 border-b border-gray-100 dark:border-white/[0.04]">
<div className="flex flex-col">
<span className="text-[0.7rem] font-medium text-gray-800 dark:text-gray-200">
@@ -26,7 +31,7 @@ export function PersonaPanel() {
</span>
<span className="text-[0.55rem] text-gray-500 dark:text-gray-500">
{personasEnabled
- ? 'Active persona is applied to new chats.'
+ ? 'Active persona is available in every chat. Switch it on per chat in the Plugins menu.'
: 'Off: raw model, no persona prompt.'}
</span>
</div>
diff --git a/src/components/personas/__tests__/der-personensatz-verspricht-nichts-falsches.test.tsx b/src/components/personas/__tests__/der-personensatz-verspricht-nichts-falsches.test.tsx
new file mode 100644
index 00000000..bcb93c1f
--- /dev/null
+++ b/src/components/personas/__tests__/der-personensatz-verspricht-nichts-falsches.test.tsx
@@ -0,0 +1,62 @@
+// @vitest-environment jsdom
+/**
+ * T13d, Befund 4: der Satz unter dem Personen-Hauptschalter hat zwei Tester
+ * hintereinander in die Irre gefuehrt. Er lautete
+ * `Active persona is applied to new chats.` und versprach damit mehr, als der
+ * Code tut: `chatStore.createConversation` legt jede neue Unterhaltung mit
+ * `personaEnabled: false` an, und `system-prompt.ts` verlangt genau diese
+ * Flagge, bevor der Text der Person in den Anfragekoerper kommt. Angewandt
+ * wird die Person erst nach dem Schalter je Chat im Plugins-Menue.
+ *
+ * Run: npx vitest run src/components/personas/__tests__/der-personensatz-verspricht-nichts-falsches.test.tsx
+ */
+import { readFileSync } from 'node:fs'
+import { join } from 'node:path'
+import { afterEach, beforeEach, describe, expect, it } from 'vitest'
+import { cleanup, render, screen } from '@testing-library/react'
+import { PersonaPanel } from '../PersonaPanel'
+import { useSettingsStore } from '../../../stores/settingsStore'
+import { useChatStore } from '../../../stores/chatStore'
+
+const SATZ = 'Active persona is available in every chat. Switch it on per chat in the Plugins menu.'
+const ALTER_SATZ = 'Active persona is applied to new chats.'
+
+beforeEach(() => {
+ useChatStore.setState({ conversations: [], activeConversationId: null })
+})
+afterEach(() => cleanup())
+
+describe('der Satz unter dem Personen-Hauptschalter', () => {
+ it('nennt den Schalter je Chat, nicht die neue Unterhaltung', () => {
+ useSettingsStore.getState().updateSettings({ personasEnabled: true })
+ render(<PersonaPanel />)
+ expect(screen.getByText(SATZ)).toBeTruthy()
+ // Negativkontrolle: der alte Satz darf nirgends mehr stehen. Kommt er
+ // zurueck, faellt diese Zeile, nicht die daneben.
+ expect(screen.queryByText(ALTER_SATZ), 'der widerlegte Satz steht wieder da').toBeNull()
+ })
+
+ it('sagt damit die Wahrheit: eine neue Unterhaltung startet ohne Person', () => {
+ const id = useChatStore.getState().createConversation('gemma4:12b', '', 'lu')
+ const conv = useChatStore.getState().conversations.find(c => c.id === id)
+ expect(conv, 'die Unterhaltung wurde gar nicht angelegt').toBeTruthy()
+ expect(conv!.personaEnabled, 'eine neue Unterhaltung traegt die Person schon eingeschaltet, dann waere der alte Satz wahr gewesen').toBe(false)
+ })
+
+ it('nennt das Menue bei dem Namen, den es auf dem Schirm traegt', () => {
+ // Der Satz zeigt auf ein Menue. Steht dort ein anderer Name, schickt er
+ // den Kunden ins Leere, also wird der Name gegen die Quelle gehalten.
+ const quelle = readFileSync(join(__dirname, '../../chat/PluginsDropdown.tsx'), 'utf8')
+ expect(quelle).toContain('<span>Plugins</span>')
+ expect(quelle).toContain('aria-label="Plugins"')
+ expect(quelle).toContain("'Enable persona for this chat'")
+ expect(SATZ).toContain('Plugins menu')
+ })
+
+ it('laesst den Aus-Zustand unberuehrt', () => {
+ useSettingsStore.getState().updateSettings({ personasEnabled: false })
+ render(<PersonaPanel />)
+ expect(screen.getByText('Off: raw model, no persona prompt.')).toBeTruthy()
+ expect(screen.queryByText(SATZ), 'der Ein-Satz steht am ausgeschalteten Schalter').toBeNull()
+ })
+})