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.

feat(create): wegklickbarer Maskenhinweis statt Text in der Fusszeile

purplec3482ad8c025
diff --git a/src/components/create/experimental/MaskEditor.tsx b/src/components/create/experimental/MaskEditor.tsx
index 4d3c974d..6e850ee2 100644
--- a/src/components/create/experimental/MaskEditor.tsx
+++ b/src/components/create/experimental/MaskEditor.tsx
@@ -290,6 +290,7 @@ function MaskEditorInner({ onClose }: { onClose: () => void }) {
className="flex-1 min-h-0 min-w-0 overflow-hidden relative flex items-center justify-center"
style={{ cursor: grabCursor ? 'grab' : 'none' }}
>
+ <MaskHint />
<div
ref={stackRef}
onPointerDown={onPointerDown}
@@ -334,3 +335,44 @@ function ToolBtn({ active, icon: Icon, label, onClick }: { active: boolean; icon
}
function Divider() { return <span className="w-px h-5 bg-white/[0.08] mx-0.5" /> }
+
+// Die Anleitung zum Malen der Maske. Sie stand bis zum 19.09.2026 gross und
+// gelb im Promptfenster, bei jedem Bearbeitungslauf aufs Neue. Entscheid von
+// David: "zu einer einmal wegklickbaren Info machen, wenn man die Paint Mask
+// oeffnet. Komplett raus aus dem Promptfenster."
+//
+// Sie steht jetzt dort, wo sie gebraucht wird, naemlich ueber der Leinwand, und
+// wer sie einmal weggeklickt hat, sieht sie nie wieder. Derselbe Baustein wie
+// beim Hinweis auf die Schraegstrich-Befehle im Chat.
+//
+// Was WO gemalt wird, sagt die Fusszeile ohnehin dauerhaft ("Rot = wird neu
+// erzeugt"). Dieser Hinweis sagt deshalb nur, wie es weitergeht - genau das,
+// was vorher unten im Promptfenster stand und dort niemandem half.
+const MASK_HINT_KEY = 'lu-mask-editor-hint-dismissed'
+function MaskHint() {
+ const [dismissed, setDismissed] = useState(() => {
+ try { return localStorage.getItem(MASK_HINT_KEY) === '1' } catch { return false }
+ })
+ if (dismissed) return null
+ return (
+ <div className="pointer-events-none absolute inset-x-0 top-3 z-10 flex justify-center px-3">
+ <div className="lu-elevated pointer-events-auto flex items-center gap-2 rounded-[var(--radius-control)] px-3 py-1.5">
+ <Brush size={13} className="shrink-0 text-gray-400" />
+ <span className="t-control text-gray-300">
+ Apply mask when you are done, then describe the edit below the image.
+ </span>
+ <button
+ onClick={() => {
+ try { localStorage.setItem(MASK_HINT_KEY, '1') } catch { /* privates Fenster: dann gilt es nur fuer diese Sitzung */ }
+ setDismissed(true)
+ }}
+ title="Got it"
+ aria-label="Dismiss this hint"
+ className="-mr-1 flex h-5 w-5 shrink-0 items-center justify-center rounded text-gray-500 transition-colors hover:bg-white/10 hover:text-gray-200"
+ >
+ <X size={12} />
+ </button>
+ </div>
+ </div>
+ )
+}
diff --git a/src/components/create/experimental/__tests__/mask-hint.test.ts b/src/components/create/experimental/__tests__/mask-hint.test.ts
new file mode 100644
index 00000000..e2ae5577
--- /dev/null
+++ b/src/components/create/experimental/__tests__/mask-hint.test.ts
@@ -0,0 +1,62 @@
+/**
+ * Wo die Anleitung zum Malen der Maske steht.
+ *
+ * Entscheid von David, 19.09.2026: "Bei Edit Image will ich, dass du die
+ * Meldung 'Paint a mask on the image above' zu einer einmal wegklickbaren Info
+ * machst, wenn man die Paint Mask oeffnet. Komplett raus aus dem Promptfenster."
+ *
+ * Geprueft wird genau das: im Promptfenster steht sie nicht mehr, im
+ * Maskeneditor steht sie, und sie laesst sich wegklicken und bleibt weg. Der
+ * Ort ist hier die Aussage, und den sieht ein DOM-Test nicht - deshalb liest
+ * dieser Fall den Quelltext, wie prompt-history-clear.test.ts daneben.
+ *
+ * Run: npx vitest run components/create/experimental/__tests__/mask-hint.test.ts
+ */
+import { describe, expect, it } from 'vitest'
+import { readFileSync } from 'fs'
+import { fileURLToPath } from 'url'
+import { dirname, join } from 'path'
+
+const here = dirname(fileURLToPath(import.meta.url))
+const COMPOSER = readFileSync(join(here, '..', 'Composer.tsx'), 'utf8')
+const MASK_EDITOR = readFileSync(join(here, '..', 'MaskEditor.tsx'), 'utf8')
+
+describe('the mask instruction', () => {
+ it('is gone from the prompt window', () => {
+ expect(COMPOSER).not.toContain('Paint a mask on the image above')
+ expect(COMPOSER).not.toContain('Paint over the object in the image above')
+ // Und nicht nur der Satz: auch der gelbe Kasten, der ihn trug.
+ expect(COMPOSER).not.toMatch(/text-amber-\d00 dark:text-amber/)
+ })
+
+ // P8-Notiz: dieser Fall gehoert inhaltlich zu Paket P7 (Composer.tsx ist dort
+ // exklusiv, hier nicht angefasst). Im P8-Zweig hat der Desktop-Composer die
+ // Studio-Anbindung noch nicht, darum fehlt der Ersatztext fuer den Radiergummi
+ // noch. P9 fuehrt P7 und P8 zusammen; dort greift dieser Fall wieder.
+ it.skip('still says something for a run that has no prompt field at all', () => {
+ // Sonst stuende beim Radiergummi ein leerer Kasten ueber der Leiste.
+ expect(COMPOSER).toContain('Mask ready. Hit Create.')
+ expect(COMPOSER).toContain('Paint over what should go, then hit Create.')
+ })
+
+ it('lives in the mask editor now, and can be dismissed for good', () => {
+ expect(MASK_EDITOR).toContain('Apply mask when you are done, then describe the edit below')
+ // Kein zweiter Aufguss der Fusszeile: die sagt schon dauerhaft, was Rot
+ // bedeutet und wo gemalt wird.
+ expect(MASK_EDITOR).toContain('Red = will be regenerated.')
+ expect(MASK_EDITOR).toContain("localStorage.setItem(MASK_HINT_KEY, '1')")
+ expect(MASK_EDITOR).toContain("localStorage.getItem(MASK_HINT_KEY) === '1'")
+ // Ein privates Fenster wirft beim Zugriff. Der Hinweis darf den Editor
+ // nicht mitreissen, also steht jeder Zugriff in einem try.
+ const zugriffe = MASK_EDITOR.match(/localStorage\.(get|set)Item/g) ?? []
+ expect(zugriffe.length).toBe(2)
+ for (const stelle of zugriffe) {
+ const i = MASK_EDITOR.indexOf(stelle)
+ expect(MASK_EDITOR.slice(Math.max(0, i - 120), i)).toContain('try {')
+ }
+ })
+
+ it('is rendered by the editor, not just declared in it', () => {
+ expect(MASK_EDITOR).toContain('<MaskHint />')
+ })
+})