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
fix(character): a character without photos stands in the middle of its room
purple6612d8defd0f
diff --git a/e2e/character-hub.spec.ts b/e2e/character-hub.spec.tsindex c34d9f2a..c0b680e0 100644--- a/e2e/character-hub.spec.ts+++ b/e2e/character-hub.spec.ts@@ -231,6 +231,13 @@ test('one pill: the characters as tabs, the stage, and the row over the window sawait expect(page.getByRole('list', { name: 'Photos of Sam' }).locator('img')).toHaveCount(12)await savePhotoCharacter(page, 'Oma', 'oma.png', 8)await expect(page.locator('[data-hub-photo-only]')).toBeVisible()+ // With photos that fill the room the block starts at the top.+ {+ const room = (await page.locator('.hub-scroll').boundingBox())!+ const block = (await page.locator('.hub-center').boundingBox())!+ expect(block.height).toBeGreaterThanOrEqual(room.height - 1)+ expect(Math.abs(block.y - room.y)).toBeLessThanOrEqual(2)+ }// Four characters at this width: the row in full, around the middle, with// New character as its last entry; the head and the photos under it on// the same axis as the prompt window.@@ -409,6 +416,12 @@ test('local mode: Swap is locked to the cloud, the local lanes are there', asyncawait expect(page.locator('[data-hub-card]')).toContainText('Local LoRA')// A local LoRA has no picture and no photos here: a line says so, nothing stands in.await expect(page.locator('[data-hub-no-photos]')).toBeVisible()+ // Shorter than the room: the block stands in the middle between the row+ // of the characters and the row over the prompt window, not at the top.+ const room = (await page.locator('.hub-scroll').boundingBox())!+ const block = (await page.locator('.hub-center').boundingBox())!+ expect(block.height).toBeLessThan(room.height)+ expect(Math.abs((block.y + block.height / 2) - (room.y + room.height / 2))).toBeLessThanOrEqual(2)// Image is the action, and the window is ready for a text. The character// of this machine is not put into the run by opening the tab (its LoRA and// its model would follow into the Image tab): Create does that.diff --git a/src/components/create/experimental/__tests__/character-stage.test.tsx b/src/components/create/experimental/__tests__/character-stage.test.tsxindex 4e749a94..f8249cd2 100644--- a/src/components/create/experimental/__tests__/character-stage.test.tsx+++ b/src/components/create/experimental/__tests__/character-stage.test.tsx@@ -259,6 +259,9 @@ describe('one middle axis', () => {it('the head, the photos and the first page are centred', () => {const block = hubCss()+ // Up and down too: what is shorter than the room stands in its middle.+ expect(block).toMatch(/\.lu-hub \.hub-scroll \{[^}]*display: flex;[^}]*flex-direction: column/)+ expect(block).toMatch(/\.lu-hub \.hub-center \{[^}]*margin-block: auto/)expect(block).toMatch(/\.lu-hub \.hub-photos \{[^}]*justify-content: center/)expect(block).toMatch(/\.lu-hub \.hub-empty \{[^}]*align-items: center;[^}]*justify-content: center/)const c: HubCharacter = { key: 'saved:1', kind: 'saved', name: 'Oma', meta: 'Photos · 2', image: null, photos: [new Blob(['a']), new Blob(['b'])] }diff --git a/src/components/create/experimental/hub/CharacterHub.tsx b/src/components/create/experimental/hub/CharacterHub.tsxindex 445d20d7..eb7c220e 100644--- a/src/components/create/experimental/hub/CharacterHub.tsx+++ b/src/components/create/experimental/hub/CharacterHub.tsx@@ -167,8 +167,12 @@ export function CharacterHub({ stage, onOpenGallery }: Props) {onNew={() => setHubStep('new')}/>{/* One scroll for the head and what stands under it, so a low- window never squeezes the head. */}+ window never squeezes the head. What is shorter than the room+ (a character without photos) stands in its middle, between the+ row of the characters and the row over the prompt window; what+ fills it starts at the top. */}<div className="hub-scroll scrollbar-thin">+ <div className="hub-center"><HubCard c={current} photo={photos[0] ?? null} /><StageClip />{oneClick ? (@@ -184,6 +188,7 @@ export function CharacterHub({ stage, onOpenGallery }: Props) {</div>)}</div>+ </div></div>)}diff --git a/src/index.css b/src/index.cssindex d47668a6..fd2ea059 100644--- a/src/index.css+++ b/src/index.css@@ -3240,7 +3240,10 @@ input[type="range"].neuron-range:disabled { cursor: not-allowed; opacity: 0.5; }.lu-hub .hub-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; margin: 0 10px; vertical-align: top; white-space: nowrap; border-bottom: 1.5px solid transparent; }.lu-hub .hub-tab--on { border-bottom-color: var(--hub-text); }.lu-hub .hub-tabs[data-hub-tabs-fit="pictures"] .hub-tab { margin: 0 6px; }-.lu-hub .hub-scroll { flex: 1 1 0%; min-width: 0; min-height: 0; overflow-y: auto; border-top: 1px solid var(--hub-sep); }+.lu-hub .hub-scroll { display: flex; flex-direction: column; flex: 1 1 0%; min-width: 0; min-height: 0; overflow-y: auto; border-top: 1px solid var(--hub-sep); }+/* Shorter than the room: in its middle. Longer: from the top (the auto+ margins are then nothing). */+.lu-hub .hub-center { flex: none; width: 100%; margin-block: auto; }.lu-hub .hub-card { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 14px 0 12px; text-align: center; }.lu-hub .hub-card > .hub-portrait { width: 64px; margin-bottom: 8px; }.lu-hub .hub-body { min-width: 0; }diff --git a/src/lib/create/__tests__/characters-after-update.test.ts b/src/lib/create/__tests__/characters-after-update.test.tsnew file mode 100644index 00000000..de52d934--- /dev/null+++ b/src/lib/create/__tests__/characters-after-update.test.ts@@ -0,0 +1,70 @@+/**+ * David, 16.11.2026: do people who already have characters see them on the+ * stage right after the update to 3.1.0?+ *+ * The stage reads the same three places 3.0.x wrote to, in the same format.+ * This file pins that, with rows and names as 3.0.10 left them:+ * (a) LoRA files of this machine: `char_<name>_zimage.safetensors`, the+ * name the trainer has written since 3.0.0, also in a subfolder;+ * (b) characters trained in LU Cloud: the rows of /api/loras;+ * (c) characters saved from photos: the IndexedDB `lu-saved-characters`,+ * version 1, store `characters`, rows { id, name, createdAt, photos }.+ * Nothing is migrated, because nothing changed place or shape.+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'node:fs'+import { resolve } from 'node:path'+import { listLocalCharacters } from '../../characters'+import { hubFromCloud, hubFromLocal, hubFromSaved, mergeHubCharacters } from '../character-hub'+import type { CloudLora } from '../../../api/cloud/loras'++const src = (p: string) => readFileSync(resolve(__dirname, '../../..', p), 'utf8')++describe('characters from 3.0.x after the update', () => {+ it('(a) every file the old trainer wrote is a character: plain, in a subfolder, in any case', async () => {+ const files = [+ 'char_anna_zimage.safetensors',+ 'chars/char_anna_b_zimage.safetensors',+ 'sub\\char_Tom_zimage.safetensors',+ 'CHAR_MIA_ZIMAGE.SAFETENSORS',+ // Not characters: a style of 3.0.9 and somebody's own LoRA.+ 'style_ink_zimage.safetensors',+ 'detail_tweaker.safetensors',+ ]+ const refs = await listLocalCharacters(async () => files, 'local:')+ expect(refs.map((r) => r.triggerWord).sort()).toEqual(['MIA', 'Tom', 'anna', 'anna_b'])+ const onStage = refs.map(hubFromLocal)+ expect(onStage.every((c) => c.kind === 'local' && c.image === null && !!c.ref)).toBe(true)+ // The same pattern as in 3.0.10 (git show v3.0.10:src/api/trainer.ts).+ expect(src('api/trainer.ts')).toContain(String.raw`/(?:^|[\\/])char_(.+)_zimage\.safetensors$/i`)+ })++ it('(b) a character trained in LU Cloud stands on the stage with its name, family and look', () => {+ const row = {+ id: '11111111-1111-4111-8111-111111111111', name: 'Bean', trigger_word: 'beanchar', base_family: 'flux',+ created_at: '2026-10-01T10:00:00Z', source: 'trained', preview_url: null, base_url: 'https://lu-labs.ai/x.png',+ } as unknown as CloudLora+ const c = hubFromCloud(row)+ expect(c).toMatchObject({ key: `cloud:${row.id}`, kind: 'cloud', name: 'Bean', meta: 'Trained · Flux', image: 'https://lu-labs.ai/x.png' })+ expect(c.ref).toMatchObject({ id: row.id, triggerWord: 'beanchar', family: 'flux' })+ })++ it('(c) the store of the saved characters is the one 3.0.5 to 3.0.10 wrote: same name, version, store and row', () => {+ const now = src('lib/saved-characters.ts')+ expect(now).toContain("const DB_NAME = 'lu-saved-characters'")+ expect(now).toContain("const STORE = 'characters'")+ expect(now).toContain('indexedDB.open(DB_NAME, 1)')+ expect(now).toMatch(/createObjectStore\(STORE, \{ keyPath: 'id' \}\)/)+ expect(now).toMatch(/export interface StoredCharacter \{\s*id: string\s*name: string\s*createdAt: number\s*photos: \{ type: string; bytes: ArrayBuffer \}\[\]\s*\}/)+ // A row as 3.0.10 stored it becomes a character of the stage.+ const saved = { id: 'c1', name: 'Oma', photos: [new Blob(['a']), new Blob(['b'])] }+ expect(hubFromSaved(saved, 'blob:1')).toMatchObject({ key: 'saved:c1', kind: 'saved', name: 'Oma', meta: 'Photos · 2', image: 'blob:1' })+ })++ it('all three sources stand in one row, none hides another of the same name', () => {+ const cloud = [hubFromCloud({ id: '1', name: 'Oma', trigger_word: 'oma', base_family: 'flux', source: 'trained', preview_url: null, base_url: null } as unknown as CloudLora)]+ const local = [hubFromLocal({ id: 'local:char_oma_zimage.safetensors', name: 'oma', triggerWord: 'oma', family: 'zimage' })]+ const saved = [hubFromSaved({ id: 'c1', name: 'Oma', photos: [new Blob(['a'])] }, null)]+ expect(mergeHubCharacters(cloud, local, saved).map((c) => c.kind)).toEqual(['cloud', 'local', 'saved'])+ })+})