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.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
test(create): pin the lane caption rule instead of leaving it inline
purple38d8903ca1e6
diff --git a/src/components/create/experimental/Composer.tsx b/src/components/create/experimental/Composer.tsxindex 0d281008..3275357b 100644--- a/src/components/create/experimental/Composer.tsx+++ b/src/components/create/experimental/Composer.tsx@@ -1,7 +1,7 @@import { useCallback, useRef, useState } from 'react'import { motion, AnimatePresence } from 'framer-motion'import { Sparkles, X, History, SlidersHorizontal, Square } from 'lucide-react'-import { useCreateStore, MODEL_TYPE_DEFAULTS, type CreateIntent } from '../../../stores/createStore'+import { useCreateStore, MODEL_TYPE_DEFAULTS } from '../../../stores/createStore'import { classifyModel } from '../../../api/comfyui'import { useCreateExp } from './CreateContext'import { intentToJob } from '../../../lib/render/cloud-jobs'@@ -14,6 +14,7 @@ import {runCredits,} from '../../../stores/cloudCatalogStore'import { INTENT_MAP } from './intents'+import { noPromptHint, shouldShowLaneHint } from './laneHint'import { ModelChip } from './ModelChip'import { SpecialControls } from './SpecialIntentControls'import { CreditsMeter } from './CreditsMeter'@@ -143,13 +144,7 @@ export function Composer({ onOpenAdvanced }: Props) {(!meta.needsSource || !!source) &&specialReady &&creditsOk- // The "add X above" captions go stale the moment the chips are filled: mid- // run the motion lane still asked for the image and the video it was already- // sampling from. They go away once the lane reports ready. The action- // captions (cutout, upscale, eraser) stay, because they describe the click- // and not a missing input, and the eraser's mask is not part of specialReady.- const hintIsAboutInputs = intent === 'character' || intent === 'lipsync' || intent === 'motion'- const showNoPromptHint = !needPrompt && !isGenerating && !(hintIsAboutInputs && specialReady)+ const showNoPromptHint = shouldShowLaneHint({ needPrompt, isGenerating, intent, specialReady })return (// A stable min-height (bottom-anchored) so the prompt window occupies the@@ -248,26 +243,6 @@ export function Composer({ onOpenAdvanced }: Props) {)}-// Caption for prompt-less intents so each reads honestly (the old copy said-// "remove the background" for every one of them — misleading the eraser into-// a guaranteed "Paint a mask first" error).-function noPromptHint(id: CreateIntent): string {- switch (id) {- case 'upscale':- return 'No prompt needed. Just hit Create to enhance the image.'- case 'eraser':- return 'No prompt needed. Paint a mask over the object to remove, then hit Create.'- case 'character':- return 'Add 4 to 30 photos of one person or character above, pick a trigger word, then hit Create to train.'- case 'lipsync':- return 'Add the portrait (or clip) and a voice above, then hit Create to make it speak.'- case 'motion':- return 'Add a character image and a driving dance/pose video above, then hit Create.'- default:- return 'No prompt needed. Just hit Create to remove the background.'- }-}-// Quality (proxy over steps) + Aspect (image) + Edit strength (edit).// The tuning row above the prompt. It renders exactly the knobs the lane's// submit path actually consumes, so nothing on screen is a dead control:diff --git a/src/components/create/experimental/__tests__/laneHint.test.ts b/src/components/create/experimental/__tests__/laneHint.test.tsnew file mode 100644index 00000000..b6f1c0e6--- /dev/null+++ b/src/components/create/experimental/__tests__/laneHint.test.ts@@ -0,0 +1,82 @@+/**+ * Regression: the Motion Control card kept printing "add a character image and+ * a driving dance/pose video above, then hit Create" while both chips were+ * filled and the sampler was already counting steps (David, 2026-07-26, live+ * run on the 2.5.9 ship exe). The caption hung off `!needsPrompt` alone, so it+ * never reacted to the inputs or to a run being in flight.+ *+ * These pin the rule in both directions, including the two cases that must NOT+ * change: the eraser caption is the only place that mentions painting a mask,+ * and a mask is deliberately not part of `specialReady`.+ */+import { describe, it, expect } from 'vitest'+import { noPromptHint, shouldShowLaneHint } from '../laneHint'+import type { CreateIntent } from '../../../../stores/createStore'++const show = (+ intent: CreateIntent,+ o: Partial<{ needPrompt: boolean; isGenerating: boolean; specialReady: boolean }> = {},+) =>+ shouldShowLaneHint({+ needPrompt: false,+ isGenerating: false,+ specialReady: false,+ intent,+ ...o,+ })++describe('shouldShowLaneHint', () => {+ it('shows the motion caption while the inputs are still missing', () => {+ expect(show('motion', { specialReady: false })).toBe(true)+ })++ it('hides the motion caption once both chips are in', () => {+ expect(show('motion', { specialReady: true })).toBe(false)+ })++ it('hides every caption while a run is in flight', () => {+ // The exact case David watched: ready inputs plus a running sampler.+ expect(show('motion', { specialReady: true, isGenerating: true })).toBe(false)+ // And the incomplete case too, because mid run it is not an instruction.+ expect(show('motion', { specialReady: false, isGenerating: true })).toBe(false)+ expect(show('eraser', { isGenerating: true })).toBe(false)+ })++ it('applies the same rule to the other two input captions', () => {+ for (const id of ['character', 'lipsync'] as CreateIntent[]) {+ expect(show(id, { specialReady: false })).toBe(true)+ expect(show(id, { specialReady: true })).toBe(false)+ }+ })++ it('keeps the action captions up even when the lane reports ready', () => {+ // These describe the click, not a missing input. The eraser one carries the+ // only "paint a mask" instruction in the UI and specialReady is true for it+ // as soon as an image is loaded, so readiness must not hide it.+ for (const id of ['eraser', 'upscale', 'removebg'] as CreateIntent[]) {+ expect(show(id, { specialReady: true })).toBe(true)+ }+ })++ it('shows nothing at all for lanes that have a prompt field', () => {+ expect(show('image', { needPrompt: true })).toBe(false)+ expect(show('motion', { needPrompt: true, specialReady: false })).toBe(false)+ })+})++describe('noPromptHint', () => {+ it('names the inputs each lane is waiting for', () => {+ expect(noPromptHint('motion')).toContain('driving dance/pose video')+ expect(noPromptHint('lipsync')).toContain('voice')+ expect(noPromptHint('character')).toContain('4 to 30 photos')+ })++ it('keeps the eraser on its own line instead of the cutout default', () => {+ // The old copy said "remove the background" for every prompt-less lane,+ // which walked eraser users straight into "Paint a mask first".+ expect(noPromptHint('eraser')).toContain('Paint a mask')+ expect(noPromptHint('eraser')).not.toContain('remove the background')+ expect(noPromptHint('upscale')).toContain('enhance the image')+ expect(noPromptHint('removebg')).toContain('remove the background')+ })+})diff --git a/src/components/create/experimental/laneHint.ts b/src/components/create/experimental/laneHint.tsnew file mode 100644index 00000000..69677208--- /dev/null+++ b/src/components/create/experimental/laneHint.ts@@ -0,0 +1,58 @@+// The caption under the prompt field for lanes that take no prompt — shared,+// pure, testable.+//+// David 2026-07-26, watching a Motion Control run: the card kept saying "add a+// character image and a driving dance/pose video above, then hit Create" while+// both chips were filled and the sampler was already counting steps. The+// caption was rendered on `!needsPrompt` alone, so it never reacted to anything+// the user did.+import type { CreateIntent } from '../../../stores/createStore'++/** Captions that name the inputs a lane is waiting for. These go stale the+ * moment the chips are filled, so they hide once the lane reports ready. */+const INPUT_HINT_INTENTS: ReadonlySet<CreateIntent> =+ new Set(['character', 'lipsync', 'motion'] as CreateIntent[])++/** Caption for prompt-less intents so each reads honestly (the old copy said+ * "remove the background" for every one of them — misleading the eraser into+ * a guaranteed "Paint a mask first" error). */+export function noPromptHint(id: CreateIntent): string {+ switch (id) {+ case 'upscale':+ return 'No prompt needed. Just hit Create to enhance the image.'+ case 'eraser':+ return 'No prompt needed. Paint a mask over the object to remove, then hit Create.'+ case 'character':+ return 'Add 4 to 30 photos of one person or character above, pick a trigger word, then hit Create to train.'+ case 'lipsync':+ return 'Add the portrait (or clip) and a voice above, then hit Create to make it speak.'+ case 'motion':+ return 'Add a character image and a driving dance/pose video above, then hit Create.'+ default:+ return 'No prompt needed. Just hit Create to remove the background.'+ }+}++/**+ * Should the caption be on screen right now?+ *+ * Never while a run is going (nothing there is an instruction any more), and+ * never for an "add X above" caption whose inputs are already in. The action+ * captions (cutout, upscale, eraser) stay: they describe the click rather than+ * a missing input, and the eraser's mask is deliberately not part of+ * `specialReady`, so hiding on readiness would drop the one line that tells+ * people to paint a mask.+ */+export function shouldShowLaneHint(opts: {+ /** meta.needsPrompt || characterUse — a lane with a prompt field shows none of this. */+ needPrompt: boolean+ /** A run is in flight. */+ isGenerating: boolean+ intent: CreateIntent+ /** Per-intent input readiness, as computed by the Composer. */+ specialReady: boolean+}): boolean {+ if (opts.needPrompt) return false+ if (opts.isGenerating) return false+ return !(INPUT_HINT_INTENTS.has(opts.intent) && opts.specialReady)+}diff --git a/src/components/layout/__tests__/DownloadBadge-autoclose.test.ts b/src/components/layout/__tests__/DownloadBadge-autoclose.test.tsnew file mode 100644index 00000000..d271672e--- /dev/null+++ b/src/components/layout/__tests__/DownloadBadge-autoclose.test.ts@@ -0,0 +1,40 @@+/**+ * Regression: the downloads tray opens itself when a download starts, but had+ * no way back. Cancel the download (or let the last file finish) and the panel+ * kept hanging over the app reading "No active downloads" until the user+ * happened to mousedown somewhere else. Seen live on 2026-07-26 while the tray+ * sat on top of the cloud retention banner.+ *+ * There is no render harness in this repo (no @testing-library), so this guards+ * the source for the three pieces of the fix, in the same style as+ * AppShell-backend-autoenable.test.ts. The behaviour itself is covered by the+ * CDP run on the ship exe: tray opens on start, closes on cancel.+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'fs'+import { fileURLToPath } from 'url'+import { dirname, join } from 'path'++const __filename = fileURLToPath(import.meta.url)+const __dirname = dirname(__filename)+const src = readFileSync(join(__dirname, '../DownloadBadge.tsx'), 'utf8')++describe('DownloadBadge tray auto-close', () => {+ it('remembers that the tray opened itself', () => {+ expect(src).toMatch(/const autoOpened = useRef\(false\)/)+ // The auto-open effect must set the flag, not just open the panel.+ expect(src).toMatch(/if \(totalActive > 0\) \{ setOpen\(true\); autoOpened\.current = true \}/)+ })++ it('closes again when the list empties, but only if it opened itself', () => {+ expect(src).toMatch(/if \(!hasAny && autoOpened\.current\) \{ setOpen\(false\); autoOpened\.current = false \}/)+ // Keyed on hasAny (every entry, not just active ones) so a finished row is+ // still readable until it is cleared.+ expect(src).toMatch(/\}, \[hasAny\]\)/)+ })++ it('leaves a hand-opened tray alone', () => {+ // Clicking the trigger drops the flag, so the close effect skips it.+ expect(src).toMatch(/onClick=\{\(\) => \{ setOpen\(!open\); autoOpened\.current = false \}\}/)+ })+})