Skip to content

Turn one illustration into an animated 2D mesh avatar with a coding agent and a local editor

Replace visible paths with copy and open buttons

shinshin86e1eac13cd9d3
diff --git a/e2e/agent-request.spec.ts b/e2e/agent-request.spec.ts
index b671621..ba04741 100644
--- a/e2e/agent-request.spec.ts
+++ b/e2e/agent-request.spec.ts
@@ -3,20 +3,31 @@ import { resolve } from 'node:path';
import { homedir } from 'node:os';
import { dismissGuide, samplePresent, sampleSkipReason } from './sample';
-test('paths and tooltips use ~ while copies keep full paths, and recipient changes persist', async ({ page, context }) => {
+test('paths stay hidden while copies keep full paths, folder buttons work and recipient changes persist', async ({ page, context }) => {
test.skip(!samplePresent, sampleSkipReason); await context.grantPermissions(['clipboard-read', 'clipboard-write']);
await page.goto('/'); await dismissGuide(page);
await page.locator('.open-menu > summary').click(); await page.getByTestId('project-sample-miko-qipao').click();
await page.getByTestId('variants-panel').getByRole('checkbox', { name: 'Mouth', exact: true }).check();
const card = page.getByTestId('ask-agent-variants');
- await expect(card.locator('.root-path')).toHaveText(resolve('.').replace(homedir(), '~'));
- await expect(card.locator('.root-path')).toHaveAttribute('title', resolve('.').replace(homedir(), '~'));
- await expect(page.getByTestId('project-location')).toContainText('~/');
- await card.getByRole('button', { name: 'Copy full path', exact: true }).click(); expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(resolve('.'));
+ await expect(card.locator('.root-path')).toHaveCount(0);
+ const location = page.getByTestId('project-location');
+ await expect(location.locator('strong')).toHaveText('Sample project');
+ await expect(location.locator('.project-path')).toHaveCount(0);
+ await expect(location).not.toContainText('~/'); await expect(location).not.toContainText('samples/miko-qipao');
+ await location.getByRole('button', { name: 'Copy path', exact: true }).click();
+ expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(resolve('samples/miko-qipao'));
+ const copyFolder = card.getByRole('button', { name: 'Copy folder path', exact: true });
+ await copyFolder.click(); expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(resolve('.'));
+ await expect(card.locator('.agent-folder-actions .copy-button')).toHaveText('✓ Copied');
+ let revealed = false;
+ await page.route('**/__studio/reveal', route => { revealed = true; return route.fulfill({ contentType: 'application/json', body: '{}' }); });
+ await card.getByRole('button', { name: 'Open folder', exact: true }).click(); await expect.poll(() => revealed).toBe(true);
const leaked = await page.locator('main').evaluate((main, home) => {
const text = (main as HTMLElement).innerText, attributes = [...main.querySelectorAll('*')].flatMap(element => [...element.attributes].map(attr => attr.value));
return [text, ...attributes].filter(value => value.includes(home));
}, homedir()); expect(leaked).toEqual([]);
+ const visiblePaths = await page.locator('[data-testid=project-location], .agent-folder-actions').evaluateAll(elements => elements.flatMap(element => [element.textContent ?? '', ...[element, ...element.querySelectorAll('*')].flatMap(child => [...child.attributes].map(attr => attr.value))]).filter(value => value.includes('~/') || value.includes('samples/miko-qipao')));
+ expect(visiblePaths).toEqual([]);
await card.getByRole('button', { name: 'Copy message', exact: true }).click();
const codex = await page.evaluate(() => navigator.clipboard.readText());
for (const word of ['imagegen', 'source.png', 'variants/', 'build-sprites', 'render-poses', 'already consented', 'Do not use other external services']) expect(codex).toContain(word);
@@ -33,6 +44,13 @@ test('paths and tooltips use ~ while copies keep full paths, and recipient chang
await card.getByRole('button', { name: 'Codex', exact: true }).click();
await expect(card.getByText('画像は Codex の画像生成に送られます', { exact: true })).toBeVisible();
await expect(card.getByRole('textbox')).toContainText('ユーザーは Codex の画像生成の利用に同意済み');
+ await expect(card.locator('.agent-instruction')).toHaveText('このリポジトリのフォルダで Codex を開いて、次の文章を貼ってください。');
+ await card.getByRole('button', { name: 'フォルダのパスをコピー', exact: true }).click();
+ expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(resolve('.'));
+ await expect(card.locator('.agent-folder-actions .copy-button')).toHaveText('✓ コピーしました');
+ await expect(card.getByRole('button', { name: 'フォルダを開く', exact: true })).toBeVisible();
+ await page.route('**/__studio/reveal', route => route.fulfill({ status: 500, contentType: 'application/json', body: '{}' }));
+ await card.getByRole('button', { name: 'フォルダを開く', exact: true }).click(); await expect(card.getByRole('alert')).toBeVisible();
});
test('blocked preference storage still allows recipient and wheel mode changes', async ({ page }) => {
test.skip(!samplePresent, sampleSkipReason);
diff --git a/e2e/projects-lipsync.spec.ts b/e2e/projects-lipsync.spec.ts
index 332d685..77c3944 100644
--- a/e2e/projects-lipsync.spec.ts
+++ b/e2e/projects-lipsync.spec.ts
@@ -1,4 +1,3 @@
-import { homedir } from 'node:os';
import { expect, test, type Page } from '@playwright/test';
import { cp, mkdir, mkdtemp, readFile, rm } from 'node:fs/promises';
import { resolve, basename, join } from 'node:path';
@@ -41,12 +40,15 @@ async function hashMouth(page: Page) {
test('listed project saves in place with one backup, supports keyboard save, path copy and stubbed reveal', async ({ page, context }) => {
await context.grantPermissions(['clipboard-read', 'clipboard-write']);
await open(page, name);
- const location = page.getByTestId('project-location'); await expect(location).toContainText(`projects/${name}`);
- await expect(location.locator('.project-path')).toHaveAttribute('title', directory.replace(homedir(), '~'));
- await page.getByRole('button', { name: 'Copy full path' }).click();
+ const location = page.getByTestId('project-location'); await expect(location).toContainText(name);
+ await expect(location.locator('strong')).toHaveText(name);
+ await expect(location.locator('.project-path')).toHaveCount(0);
+ await expect(location).not.toContainText('projects/');
+ await expect(location.getByRole('button', { name: 'Copy path', exact: true })).toHaveAttribute('title', 'Copy path');
+ await page.getByRole('button', { name: 'Copy path' }).click();
expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(directory);
await expect(page.getByTestId('project-location').getByRole('button', { name: '✓ Copied', exact: true })).toHaveAttribute('aria-live', 'polite');
- await expect(page.getByTestId('project-location').getByRole('button', { name: 'Copy full path', exact: true })).toBeVisible({ timeout: 5000 });
+ await expect(page.getByTestId('project-location').getByRole('button', { name: 'Copy path', exact: true })).toBeVisible({ timeout: 5000 });
let revealed = false;
await page.route(`**/__studio/projects/${name}/reveal`, route => { revealed = true; return route.fulfill({ contentType: 'application/json', body: JSON.stringify({ path: directory }) }); });
await location.locator('button').last().click(); await expect.poll(() => revealed).toBe(true);
@@ -100,7 +102,8 @@ test('unavailable local server keeps the project picker and rig download without
await expect(page.getByRole('button', { name: 'Browse for a project folder…', exact: true })).toBeVisible();
await page.getByLabel('Open project folder files', { exact: true }).setInputFiles(directory);
await expect(page.getByTestId('preview-status')).toHaveAttribute('data-state', 'ready');
- await expect(page.getByTestId('project-location')).toContainText('full path unavailable');
+ await expect(page.getByTestId('project-location')).toContainText(name);
+ await expect(page.getByTestId('project-location').getByRole('button')).toHaveCount(0);
const download = page.waitForEvent('download'); await page.getByRole('button', { name: 'Save rig', exact: true }).click();
expect((await download).suggestedFilename()).toBe('rig.json'); expect(errors).toEqual([]);
});
@@ -122,17 +125,17 @@ test('recent projects persist in order, auto-reopen, remove missing entries, and
await page.getByRole('spinbutton', { name: 'head.cx', exact: true }).fill('555');
await expect(page.getByRole('button', { name: 'Undo', exact: true })).toBeEnabled();
await page.locator('.open-menu > summary').click(); await page.getByTestId('project-sample-miko-qipao').click();
- await expect(page.getByTestId('project-location')).toContainText('samples/miko-qipao');
+ await expect(page.getByTestId('project-location')).toContainText('Sample project');
await expect(page.getByRole('button', { name: 'Undo', exact: true })).toBeDisabled();
await page.reload();
- await expect(page.getByTestId('project-location')).toContainText('samples/miko-qipao');
+ await expect(page.getByTestId('project-location')).toContainText('Sample project');
await page.locator('.open-menu > summary').click();
const menu = page.locator('.project-menu');
const ids = await menu.locator('.recent-row > button:first-child').evaluateAll(buttons => buttons.map(button => button.getAttribute('data-testid')));
expect(ids.slice(0, 2)).toEqual(['recent-server:sample-miko-qipao', `recent-server:${name}`]);
await menu.getByTestId(`recent-server:${name}`).click();
- await expect(page.getByTestId('project-location')).toContainText(`projects/${name}`);
- await page.reload(); await expect(page.getByTestId('project-location')).toContainText(`projects/${name}`);
+ await expect(page.getByTestId('project-location')).toContainText(name);
+ await page.reload(); await expect(page.getByTestId('project-location')).toContainText(name);
await page.evaluate(() => {
const key = 'mesh-avatar-recent-projects', entries = JSON.parse(localStorage.getItem(key)!);
entries.unshift({ id: 'server:missing-ui-test', kind: 'server', name: 'missing-ui-test', serverName: 'missing-ui-test', relativePath: 'projects/missing-ui-test', lastOpened: new Date().toISOString() });
diff --git a/e2e/workflow.spec.ts b/e2e/workflow.spec.ts
index 26ec429..c457fc4 100644
--- a/e2e/workflow.spec.ts
+++ b/e2e/workflow.spec.ts
@@ -2,7 +2,6 @@ import { test, expect, type Page } from '@playwright/test';
import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import { join, resolve, basename } from 'node:path';
import { createHash } from 'node:crypto';
-import { homedir } from 'node:os';
import { PNG } from 'pngjs';
import fixture from '../samples/miko-qipao/rig.json' with { type: 'json' };
import { dismissGuide, samplePresent, sampleSkipReason } from './sample';
@@ -76,7 +75,7 @@ test('requests provide masks, root handoff and prompts; drops accept valid drawi
await expect(panel.getByTestId('ask-agent-variants')).toHaveCount(0);
await expect(panel.locator('.manual-variants')).not.toHaveAttribute('open', '');
await panel.getByRole('checkbox', { name: 'Mouth', exact: true }).check();
- const agent = page.getByTestId('ask-agent-variants'); await agent.getByRole('button', { name: 'Copy full path', exact: true }).click();
+ const agent = page.getByTestId('ask-agent-variants'); await agent.getByRole('button', { name: 'Copy folder path', exact: true }).click();
expect(await page.evaluate(() => navigator.clipboard.readText())).toBe(resolve('.'));
await agent.getByRole('button', { name: 'Copy message', exact: true }).click();
const prompt = await page.evaluate(() => navigator.clipboard.readText()); expect(prompt).toContain(`projects/${name}`); expect(prompt).toContain('Step 6'); expect(prompt).toContain('mouth drawn variants');
@@ -112,19 +111,21 @@ test('requests provide masks, root handoff and prompts; drops accept valid drawi
await expect(panel.getByRole('alert')).toContainText('Pixels outside the edit mask changed.', { timeout: 60000 });
expect(await readFile(join(directory, 'variants/mouth_a.png'))).toEqual(savedVariant); expect(await readFile(join(directory, 'built/sprites/sprites.json'))).toEqual(savedManifest);
await panel.getByText('Measured comparison outside the mask', { exact: true }).click(); await expect(panel.locator('.job-feedback')).toContainText('Maximum difference');
- await expect(page.getByTestId('project-location')).toContainText(`projects/${name}`);
+ await expect(page.getByTestId('project-location')).toContainText(name);
});
-test('empty workspace has a single prompt copy and a one-line repository path, without extra steps', async ({ page, context }) => {
+test('empty workspace offers folder actions and a single prompt copy without a visible repository path', async ({ page, context }) => {
await context.grantPermissions(['clipboard-read', 'clipboard-write']);
await page.route('**/miko-qipao/**/*.png', route => route.fulfill({ status: 404, body: '' }));
await page.route('**/miko-qipao/source.png', route => route.fulfill({ status: 404, body: '' }));
await page.goto('/'); const card = page.getByTestId('ask-agent-new'); await expect(card).toBeVisible();
- await expect(card.locator('.root-path')).toHaveText(resolve('.').replace(homedir(), '~'));
+ await expect(card.locator('.root-path')).toHaveCount(0);
+ await expect(card.getByRole('button', { name: 'Copy folder path', exact: true })).toBeVisible();
+ await expect(card.getByRole('button', { name: 'Open folder', exact: true })).toBeVisible();
await card.getByRole('button', { name: 'Copy message', exact: true }).click();
expect(await page.evaluate(() => navigator.clipboard.readText())).toContain('projects/my-avatar');
await expect(card.getByRole('button', { name: '✓ Copied', exact: true })).toHaveAttribute('aria-live', 'polite');
await expect(card.getByRole('button', { name: 'Copy message', exact: true })).toBeVisible({ timeout: 5000 });
- await expect(card.getByRole('button')).toHaveCount(2); await expect(card.locator('ol')).toHaveCount(0);
+ await expect(card.getByRole('button')).toHaveCount(3); await expect(card.locator('ol')).toHaveCount(0);
await expect(card.getByRole('button', { name: 'Reload project', exact: true })).toHaveCount(0);
});
test('eye and mouth checkboxes immediately adapt the prompt and lip fallback opens the mouth request', async ({ page }) => {
@@ -139,7 +140,7 @@ test('eye and mouth checkboxes immediately adapt the prompt and lip fallback ope
await expect(page.locator('.mouth-fallback')).toContainText('using mesh deformation');
await page.locator('.mouth-fallback button').click();
await expect(panel).toHaveAttribute('open', ''); await expect(panel.getByRole('checkbox', { name: 'Mouth', exact: true })).toBeChecked();
- await expect(prompt).toContainText(`projects/${name}`); await expect(prompt).toBeVisible();
+ await expect(prompt).toContainText(name); await expect(prompt).toBeVisible();
});
test('the read-only sample still gives a mouth request and keeps its source protected', async ({ page }) => {
await page.goto('/'); await dismissGuide(page);
diff --git a/src/editor/App.tsx b/src/editor/App.tsx
index 8ccfa1d..8d285a7 100644
--- a/src/editor/App.tsx
+++ b/src/editor/App.tsx
@@ -48,13 +48,12 @@ function Workspace() {
const [saving, setSaving] = useState(false);
const [opening, setOpening] = useState(false);
const [rootPath, setRootPath] = useState<string>();
- const [displayRootPath, setDisplayRootPath] = useState<string>();
const [focusRequest, setFocusRequest] = useState<{ group: string; id: number }>();
const [mouthSprites, setMouthSprites] = useState(true), [mouthRequest, setMouthRequest] = useState(0);
const [job, setJob] = useState<ProjectJob | null>(null);
const jobRef = useRef<ProjectJob | null>(null);
const [rebuildError, setRebuildError] = useState<ProjectJobError | null>(null);
- useEffect(() => { void repositoryContext().then(context => { setRootPath(context?.rootPath); setDisplayRootPath(context?.displayRootPath); }); }, []);
+ useEffect(() => { void repositoryContext().then(context => { setRootPath(context?.rootPath); }); }, []);
const [recent, setRecent] = useState(readRecent);
const [reopen, setReopen] = useState(() => readPreference(REOPEN_KEY) !== '0');
const remember = (entry: RecentProject) => {
@@ -343,7 +342,6 @@ function Workspace() {
</header>
{(localProject || pickedName) && <div className="project-location" data-testid="project-location">
<strong>{localProject?.readOnly ? t.sampleProject : localProject?.name || pickedName}</strong>
- <span className="project-path" title={localProject?.displayPath ?? localProject?.relativePath}>{localProject?.displayPath ?? localProject?.relativePath ?? t.unknownPath}</span>
{localProject && <><CopyButton value={localProject.absolutePath} label={t.copyPath} icon />
<button className="icon-button" aria-label={navigator.platform.includes('Mac') ? t.showFinder : t.showFolder} title={navigator.platform.includes('Mac') ? t.showFinder : t.showFolder} onClick={() => { void reveal(); }}><Icon name="folder" /></button>
{localProject.readOnly && <span className="badge">{t.readOnly}</span>}</>}
@@ -354,7 +352,7 @@ function Workspace() {
{localProject && !localProject.readOnly ? <button className="primary" disabled={job !== null || saving} onClick={() => { setRebuildError(null); void runJob('rebuild').catch(error => setRebuildError(error instanceof ProjectJobError ? error : new ProjectJobError('toolFailed'))); }}>{job === 'rebuild' ? t.rebuilding : t.rebuild}</button> : <p>{t.rebuildUnavailable}</p>}
{rebuildError && <JobFeedback error={rebuildError} />}
</div>}
- {!sourceUrl && <section className="panel empty-project"><h2>{checking ? t.checking : t.emptyTitle}</h2><p>{t.projectHelp}</p><p>{t.emptyHelp}</p>{recentControl}<AskAgent newProject rootPath={rootPath} displayRootPath={displayRootPath} />{errorNotice}</section>}
+ {!sourceUrl && <section className="panel empty-project"><h2>{checking ? t.checking : t.emptyTitle}</h2><p>{t.projectHelp}</p><p>{t.emptyHelp}</p>{recentControl}<AskAgent newProject rootPath={rootPath} />{errorNotice}</section>}
{sourceUrl && <div className="workspace">
<div className="parts-container" inert={job !== null}><PartList rig={rig} visible={visible} selected={selected} onSelect={selectPart} onFocus={group => { selectPart(group); setFocusRequest(current => ({ group, id: (current?.id ?? 0) + 1 })); }} onVisible={setVisible} /></div>
<section className="panel editor-panel" inert={job !== null}>
@@ -368,8 +366,8 @@ function Workspace() {
</section>
<div className="right-column">
<Preview rig={rig} assets={assets} hasMouthSprites={mouthSprites} onDrawMouth={() => setMouthRequest(value => value + 1)} />
- <VariantsPanel project={localProject} projectPath={localProject?.relativePath ?? (pickedName ? `<${pickedName}>` : 'samples/miko-qipao')} assets={assets} rootPath={rootPath} displayRootPath={displayRootPath} busy={job !== null || saving} stale={changed.length > 0} onRun={runJob} mouthRequest={mouthRequest} onMouthPresence={setMouthSprites} />
- {!localProject && !pickedName && <details className="panel new-illustration"><summary>{t.newIllustration}</summary><AskAgent newProject rootPath={rootPath} displayRootPath={displayRootPath} /></details>}
+ <VariantsPanel project={localProject} projectPath={localProject?.relativePath ?? (pickedName ? `<${pickedName}>` : 'samples/miko-qipao')} assets={assets} rootPath={rootPath} busy={job !== null || saving} stale={changed.length > 0} onRun={runJob} mouthRequest={mouthRequest} onMouthPresence={setMouthSprites} />
+ {!localProject && !pickedName && <details className="panel new-illustration"><summary>{t.newIllustration}</summary><AskAgent newProject rootPath={rootPath} /></details>}
<aside className="panel inspector" inert={job !== null}>
<div className="selection-heading"><h2>{selectedPart?.[0] ?? t.selection}</h2></div>
{errorNotice}
diff --git a/src/editor/AskAgent.tsx b/src/editor/AskAgent.tsx
index dc6ff6e..8993d85 100644
--- a/src/editor/AskAgent.tsx
+++ b/src/editor/AskAgent.tsx
@@ -2,18 +2,25 @@ import { useState } from 'react';
import { readPreference, savePreference } from './preferences';
import { useI18n } from './i18n';
import { CopyButton } from './CopyButton';
+import { revealRepository } from './project';
-export function AskAgent({ rootPath, displayRootPath, projectPath, target = 'both', newProject = false, readOnlySource }: {
- rootPath?: string; displayRootPath?: string; projectPath?: string; target?: 'eyes' | 'mouth' | 'both'; newProject?: boolean; readOnlySource?: string;
+export function AskAgent({ rootPath, projectPath, target = 'both', newProject = false, readOnlySource }: {
+ rootPath?: string; projectPath?: string; target?: 'eyes' | 'mouth' | 'both'; newProject?: boolean; readOnlySource?: string;
}) {
const { t } = useI18n();
const [recipient, setRecipient] = useState(() => readPreference('mesh-avatar-agent-recipient') === 'claude' ? 'claude' : 'codex');
+ const [revealError, setRevealError] = useState(false);
+ const reveal = async () => {
+ try { await revealRepository(); setRevealError(false); }
+ catch { setRevealError(true); }
+ };
const agent = newProject || recipient === 'codex' ? 'Codex' : 'Claude Code';
const path = projectPath ?? 'projects/my-avatar';
const prompt = (readOnlySource ? t.agentCopySample.replace('SOURCE', readOnlySource).replace('PROJECT', path) : '') + (newProject ? t.agentNewPrompt : recipient === 'codex' ? t.agentCodexPrompt : t.agentClaudePrompt).replace('PROJECT', path).replace('TARGET', target === 'eyes' ? t.agentEyes : target === 'mouth' ? t.agentMouth : t.agentBoth);
return <section className="ask-agent" data-testid={newProject ? 'ask-agent-new' : 'ask-agent-variants'} aria-label={t.askAgent}>
<p className="agent-instruction">{t.agentInstruction.replace('AGENT', agent)}</p>
- {rootPath ? <div className="agent-path"><code className="root-path" title={displayRootPath}>{displayRootPath ?? t.rootUnavailable}</code><CopyButton value={rootPath} label={t.copyPath} icon /></div> : <p className="workflow-note">{t.rootUnavailable}</p>}
+ {rootPath ? <div className="agent-folder-actions"><CopyButton value={rootPath} label={t.copyFolderPath} /><button type="button" onClick={() => { void reveal(); }}>{t.showFolder}</button></div> : <p className="workflow-note">{t.rootUnavailable}</p>}
+ {revealError && <p role="alert">{t.revealError}</p>}
{!newProject && <><div className="agent-recipient" role="group" aria-label={t.agentRecipient}>
{(['codex', 'claude'] as const).map(value => <button key={value} type="button" aria-pressed={recipient === value} onClick={() => { setRecipient(value); savePreference('mesh-avatar-agent-recipient', value); }}>{value === 'codex' ? 'Codex' : 'Claude Code'}</button>)}
</div>{recipient === 'codex' && <p className="agent-disclosure">{t.agentDisclosure}</p>}</>}
diff --git a/src/editor/VariantsPanel.tsx b/src/editor/VariantsPanel.tsx
index 44eec50..849eaf6 100644
--- a/src/editor/VariantsPanel.tsx
+++ b/src/editor/VariantsPanel.tsx
@@ -6,8 +6,8 @@ import { JobFeedback } from './JobFeedback';
import { CopyButton } from './CopyButton';
const labels = ['eyesClosed', 'eyesHalf', 'eyesSmile', 'mouthA', 'mouthAHalf', 'mouthI', 'mouthO'] as const;
-export function VariantsPanel({ project, projectPath, assets, rootPath, displayRootPath, busy, stale, onRun, mouthRequest, onMouthPresence }: {
- project: LocalProject | null; projectPath?: string; assets?: Record<string, string>; rootPath?: string; displayRootPath?: string; busy: boolean; stale: boolean;
+export function VariantsPanel({ project, projectPath, assets, rootPath, busy, stale, onRun, mouthRequest, onMouthPresence }: {
+ project: LocalProject | null; projectPath?: string; assets?: Record<string, string>; rootPath?: string; busy: boolean; stale: boolean;
onRun: (action: ProjectJob, files?: File[]) => Promise<JobResult>; mouthRequest: number; onMouthPresence: (present: boolean) => void;
}) {
const { t } = useI18n();
@@ -58,7 +58,7 @@ export function VariantsPanel({ project, projectPath, assets, rootPath, displayR
<label><input type="checkbox" checked={eyes} onChange={event => setEyes(event.target.checked)} aria-label={t.targetEyes} /><span>{t.targetEyes}<small>{t.eyesKinds}</small></span><span className="variant-count">{count('eyes_', 3)}</span></label>
<label><input ref={mouthCheckbox} type="checkbox" checked={mouth} onChange={event => setMouth(event.target.checked)} aria-label={t.targetMouth} /><span>{t.targetMouth}<small>{t.mouthKinds}</small></span><span className="variant-count">{count('mouth_', 4)}</span></label>
</div>
- {(eyes || mouth) && projectPath && (projectPath.startsWith('<') ? <p className="workflow-note">{t.agentUnknownPath}</p> : <AskAgent rootPath={rootPath} displayRootPath={displayRootPath} projectPath={project?.readOnly || projectPath === 'samples/miko-qipao' ? 'projects/miko-qipao-variants' : projectPath} readOnlySource={project?.readOnly || projectPath === 'samples/miko-qipao' ? projectPath : undefined} target={target} />)}
+ {(eyes || mouth) && projectPath && (projectPath.startsWith('<') ? <p className="workflow-note">{t.agentUnknownPath}</p> : <AskAgent rootPath={rootPath} projectPath={project?.readOnly || projectPath === 'samples/miko-qipao' ? 'projects/miko-qipao-variants' : projectPath} readOnlySource={project?.readOnly || projectPath === 'samples/miko-qipao' ? projectPath : undefined} target={target} />)}
<details className="manual-variants"><summary>{t.manualVariants}</summary>
<p>{t.manualHelp}</p>
{writable ? <button disabled={busy || stale} onClick={() => { void run('variant-requests'); }}>{busy ? t.operationBusy : t.createRequests}</button> : <p className="workflow-note">{t.variantsUnavailable}</p>}
diff --git a/src/editor/i18n.tsx b/src/editor/i18n.tsx
index 8644ff7..2b72ba4 100644
--- a/src/editor/i18n.tsx
+++ b/src/editor/i18n.tsx
@@ -16,8 +16,8 @@ const en = {
recent: 'Recent', noRecent: 'No recent projects.', clearHistory: 'Clear history', removeRecent: 'Remove from history',
reopenLast: 'Reopen last project on start', browseAgain: 'Browse again', missingRecent: 'Project no longer exists; removed from history:',
localProjects: 'Local projects', noProjects: 'No local projects yet.', sampleProject: 'Sample project', updated: 'Updated',
- drawnVariants: 'Drawn eyes/mouths', readOnly: 'Read-only', copyPath: 'Copy full path', copied: 'Path copied',
- showFinder: 'Show in Finder', showFolder: 'Show in folder', unknownPath: 'Browser-picked project · full path unavailable',
+ drawnVariants: 'Drawn eyes/mouths', readOnly: 'Read-only', copyPath: 'Copy path', copyFolderPath: 'Copy folder path', copied: 'Path copied',
+ showFinder: 'Show in Finder', showFolder: 'Open folder', unknownPath: 'Browser-picked project · full path unavailable',
savedTo: 'Saved to', saveError: 'Could not save the project. Your edits are still in the editor; try again.', revealError: 'Could not open the project folder.', copyError: 'Could not copy the path.',
help: 'Help', close: 'Close help', language: 'Language', english: 'English', japanese: '日本語', enCode: 'EN', jaCode: 'JA',
parts: 'Parts', faceSection: 'Face', hairSection: 'Hair & accessories', bodySection: 'Body', advanced: 'Advanced',
@@ -56,7 +56,7 @@ const ja: typeof en = {
recent: '最近開いたプロジェクト', noRecent: '履歴はまだありません。', clearHistory: '履歴を消去', removeRecent: '履歴から削除',
reopenLast: '起動時に最後のプロジェクトを開く', browseAgain: 'フォルダを選び直す', missingRecent: 'プロジェクトが見つからないため、履歴から削除しました:',
localProjects: 'ローカルのプロジェクト', noProjects: 'プロジェクトはまだありません。', sampleProject: 'サンプル', updated: '更新',
- drawnVariants: '目・口の差分画像あり', readOnly: '読み取り専用', copyPath: 'フルパスをコピー', copied: 'パスをコピーしました',
+ drawnVariants: '目・口の差分画像あり', readOnly: '読み取り専用', copyPath: 'パスをコピー', copyFolderPath: 'フォルダのパスをコピー', copied: 'パスをコピーしました',
showFinder: 'フォルダを開く', showFolder: 'フォルダを開く', unknownPath: 'ブラウザで選択 · フルパスは取得できません',
savedTo: '保存しました:', saveError: 'プロジェクトを保存できませんでした。編集内容は画面に残っています。もう一度お試しください。', revealError: 'プロジェクトのフォルダを開けませんでした。', copyError: 'パスをコピーできませんでした。',
help: 'ヘルプ', close: 'ヘルプを閉じる', language: '言語', english: '英語', japanese: '日本語', enCode: '英語', jaCode: '日本語',
diff --git a/src/editor/style.css b/src/editor/style.css
index 3c2b484..6adae5a 100644
--- a/src/editor/style.css
+++ b/src/editor/style.css
@@ -54,7 +54,6 @@ summary::-webkit-details-marker { display: none; }
.recent-empty { font-size: 12px; color: var(--muted); }
.empty-project .recent-projects { max-width: 460px; margin: 16px auto 0; }
.project-location { display: flex; align-items: center; gap: 8px; margin: -8px 0 12px; min-height: 32px; font-size: 12px; }
-.project-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.project-location .icon-button { width: 28px; height: 28px; padding: 5px; }
.save-notice { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 20; background: var(--ink); color: white; padding: 10px 16px; border-radius: 8px; font-size: 12px; }
main:has(.project-location) .editor-panel { height: calc(100dvh - 132px); }
@@ -160,11 +159,9 @@ main:has(.stale) .editor-panel, main:has(.stale) .parts-panel { height: calc(100
.ask-agent { border: 1px solid #b3cdfa; border-radius: 8px; padding: 12px; background: #f5f8ff; margin: 12px 0; text-align: left; }
.empty-project .ask-agent { max-width: 620px; margin: 20px auto; }
.agent-instruction { margin: 0 0 8px; font-size: 12px; }
-.agent-path { display: flex; gap: 6px; align-items: center; }
-.root-path { display: block; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; background: white; padding: 6px; border-radius: 4px; }
+.agent-folder-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-agent textarea { display: block; resize: vertical; width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; font-size: 12px; margin: 8px 0; }
.copy-button { flex-shrink: 0; white-space: nowrap; font-size: 12px; }
-.agent-path .icon-button { width: 28px; height: 28px; min-height: 28px; padding: 4px; }
.mouth-fallback { margin: 4px 0; font-size: 10px; color: var(--muted); }
.mouth-fallback button { color: var(--accent); border: 0; background: none; font: inherit; padding: 0; cursor: pointer; }
.workflow-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }