Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/desktop/e2e/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,9 @@ test('the first start walks through SolidCraft, assistant, printer and project f
await setup.getByTestId('first-start-next').click();
await expect(setup).toHaveAttribute('data-step', 'assistant');
await expect(setup.getByRole('radio', { name: /^Claude Code/ })).toBeChecked();
// Signed in, the step says so; the model per step waits folded under "Advanced" (usability U-01).
await expect(setup.getByTestId('agent-detail')).toContainText('Signed in');
await expect(setup.getByTestId('first-start-models')).not.toHaveAttribute('open');
await setup.getByTestId('first-start-next').click();
await expect(setup).toHaveAttribute('data-step', 'print');
await setup.getByTestId('printer-name').getByRole('textbox').fill('Werkstatt');
Expand Down Expand Up @@ -1472,7 +1475,7 @@ test('the assistant shows the signed-in plan and needs SolidCraft', async () =>
// The plan's default model with a named effort; the plan itself is in the menu.
await expect(chip).toHaveText('Claude Code · Opus 9 · Medium');
await chip.click();
await expect(page.getByTestId('agent-detail')).toHaveText('Claude Code 9.9.9 · Claude subscription');
await expect(page.getByTestId('agent-detail')).toHaveText('Signed in · Claude Code 9.9.9 · Claude subscription');
await expect(page.getByRole('radio', { name: /^Claude Code/ })).toBeChecked();
await page.screenshot({ path: test.info().outputPath('agent-menu.png') });
await page.keyboard.press('Escape');
Expand Down
36 changes: 36 additions & 0 deletions apps/desktop/e2e/solidcraft.contract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,42 @@ test('a failed turn says why: the plan used up until a time, no connection, or t
}
});

test('on an empty start page "Describe a part" opens a new project with the chat ready to type (usability U-06, U-11)', async () => {
const { mkdtempSync, rmSync } = await import('node:fs');
const { tmpdir } = await import('node:os');
const { join } = await import('node:path');
const work = mkdtempSync(join(tmpdir(), 'partbuddy-describe-'));
const launched = await launchApp({
isolated: false,
work,
env: {
SOLIDCRAFT_CONTROL_DIR: join(work, 'control'),
PARTBUDDY_SOLIDCRAFT_PORT: '7902',
PARTBUDDY_PROJECTS_DIR: join(work, 'projects'),
PARTBUDDY_START_PAGE: '1',
PARTBUDDY_KEYRING_SERVICE: 'PartBuddy-e2e',
PARTBUDDY_CLAUDE_COMMAND: JSON.stringify([process.execPath, join(__dirname, '..', 'test', 'fakeClaude.mjs')]),
},
});
const { page } = launched;
try {
await expect(page.getByTestId('connection-status')).toHaveAttribute('data-engine', 'headless', { timeout: 30_000 });
const home = page.getByTestId('home-page');
// The start page is no project: no name, no printer or print light in the bars.
await expect(page.getByTestId('project-menu')).toHaveCount(0);
await expect(page.getByTestId('material-chip')).toHaveCount(0);
await page.screenshot({ path: test.info().outputPath('home-empty.png') });
await home.getByTestId('home-describe').click();
await expect(home).toHaveCount(0);
await expect(page.getByTestId('design-name')).toHaveText('New part', { timeout: 30_000 });
await expect(page.getByRole('textbox', { name: 'Message to the assistant' })).toBeFocused();
await expect(page.getByTestId('material-chip')).toBeVisible();
} finally {
await launched.close();
rmSync(work, { recursive: true, force: true, maxRetries: 10, retryDelay: 500 });
}
});

test('PartBuddy starts on the start page with no project open; a saved part gets a preview, and tiles open and import projects (B3)', async () => {
test.setTimeout(240_000);
const { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync } = await import('node:fs');
Expand Down
14 changes: 12 additions & 2 deletions apps/desktop/src/renderer/src/assistant/AgentChip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ function ModelChoiceSection({ status }: { status: AgentStatus }) {
* The assistant's route, model and effort, and its sign-in state (B1); in the chip's menu and in the
* settings (B6).
*/
export function AssistantChoice() {
/** `setup`: the first start, where the model choice waits folded under "Advanced" (usability U-01). */
export function AssistantChoice({ setup = false }: { setup?: boolean }) {
const { t } = useTranslation();
const state = useAssistant((s) => s.state);
const status = selectedStatus(state);
Expand Down Expand Up @@ -261,7 +262,16 @@ export function AssistantChoice() {
</RadioField>
))}
</RadioGroup>
<ModelChoiceSection status={status} />
{setup ? (
signedIn(status) && (status.models ?? []).length > 0 ? (
<details className="text-text-muted" data-testid="first-start-models">
<summary className="cursor-pointer text-xs outline-none focus-visible:focus-ring">{t('firstStart.models')}</summary>
<ModelChoiceSection status={status} />
</details>
) : null
) : (
<ModelChoiceSection status={status} />
)}
<div className="flex flex-col gap-1 border-t border-border pt-2">
<span data-testid="agent-detail">
<StatusDot tone={toneOf(status)} label={statusLabel(t, status)} />
Expand Down
21 changes: 16 additions & 5 deletions apps/desktop/src/renderer/src/assistant/AssistantPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ function Working({ label }: { label: string }) {
);
}

function Setup() {
/** Sign-in, install or wait notice of the chosen route; nothing once it is ready. Also on the first start (usability U-01). */
export function AssistantSetup() {
const { t } = useTranslation();
const status = selectedStatus(useAssistant((s) => s.state));
const api = platform().agent;
Expand Down Expand Up @@ -561,11 +562,21 @@ export function AssistantPanel() {
if (request && request.serial !== handled) {
setHandled(request.serial);
if (request.what === 'sketch') setSketching(true);
else setDraft((current) => current || t('parameters.askDraft'));
else if (request.what === 'parameters') setDraft((current) => current || t('parameters.askDraft'));
}
// Once per request, as soon as the composer takes text: a new project's composer opens locked until its design is ready.
// The start page gives the focus back to its own button as it closes: only after that.
const homeOpen = useStudio((s) => s.homeOpen);
// A new project locks the composer once more while it loads, which drops the focus: within a few seconds of the
// request the focus comes back each time the composer takes text again.
const focusedFor = useRef<{ serial: number; at: number }>({ serial: 0, at: 0 });
useEffect(() => {
if (request?.what === 'parameters') composer.current?.focus();
}, [request]);
if (!request || (request.what !== 'parameters' && request.what !== 'describe') || !writable || homeOpen) return;
const now = Date.now();
if (focusedFor.current.serial === request.serial && now - focusedFor.current.at > 8000) return;
if (focusedFor.current.serial !== request.serial) focusedFor.current = { serial: request.serial, at: now };
composer.current?.focus();
}, [request, writable, homeOpen]);
// Photos of a real object for the next message (F6), up to four; a sketch or a drawing goes alone.
// Each keeps the file's own name and size for its chip, so two pictures can be told apart (audit C-12).
const [photos, setPhotos] = useState<{ picture: SketchPicture; name: string }[]>([]);
Expand Down Expand Up @@ -759,7 +770,7 @@ export function AssistantPanel() {
<div className="relative flex min-h-0 flex-1 flex-col">
<div ref={list} {...handlers} className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto" data-testid="chat-list">
<div ref={content} className="cs-chat-list flex flex-col gap-2 p-3 pb-12">
<Setup />
<AssistantSetup />
{items.length === 0 && (status.state === 'ready' || busy) ? (
// A way in for an empty chat (polish round 1): examples fill the input, they do not send.
<div className="flex flex-col gap-2 pt-4" data-testid="chat-start">
Expand Down
15 changes: 15 additions & 0 deletions apps/desktop/src/renderer/src/home/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function HomePage() {
const { t, i18n } = useTranslation();
const connection = useStudio((s) => s.connection);
const setHomeOpen = useStudio((s) => s.setHomeOpen);
const requestAssistant = useStudio((s) => s.requestAssistant);
const run = useProjectSwitch();
// The template SolidCraft is building: its tile says so, and the others wait (audit P-02).
const [building, setBuilding] = useState<TemplateId | null>(null);
Expand Down Expand Up @@ -265,6 +266,20 @@ export function HomePage() {
<div className="flex flex-col items-center gap-2 py-7 text-center" data-testid="home-empty">
<p className="text-md font-semibold text-text">{t('home.emptyTitle')}</p>
<p className="max-w-text-max text-sm text-text-muted">{t('home.emptyBody')}</p>
{/* The way to a first part for someone new: a project, and the chat ready to type (usability U-06). */}
<Button
variant="primary"
className="mt-2"
onPress={() =>
run(async () => {
await api.create();
requestAssistant('describe');
})
}
data-testid="home-describe"
>
{t('home.describe')}
</Button>
</div>
) : shown.length === 0 ? (
<div className="flex flex-col items-center gap-2 py-7 text-center" role="status" data-testid="home-no-match">
Expand Down
12 changes: 7 additions & 5 deletions apps/desktop/src/renderer/src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"preview": "Vorschau",
"plan": "Claude-Abo",
"apiKey": "API-Key, getrennt abgerechnet",
"signedIn": "Claude Code {version} · {plan}",
"signedIn": "Angemeldet · Claude Code {version} · {plan}",
"state": {
"claude-code": {
"checking": "Claude Code wird gesucht",
Expand Down Expand Up @@ -1112,7 +1112,7 @@
"hint": "Spart Material und Druckzeit: lässt Volumen weg, das nichts trägt (offener Boden, Rahmen statt Platte), ohne geschlossene Körper auszuhöhlen, und hält die Bauhöhe gering. Funktion und Festigkeit gehen vor; Füllung und Geschwindigkeit bleiben Sache deines Slicers."
}
},
"add": "Drucker hinzufügen",
"add": "Drucker aus der Liste …",
"catalog": "Druckerkatalog",
"catalogSearch": "Marke oder Modell suchen",
"catalogEmpty": "Kein Drucker passt. Kopiere einen vorhandenen und trage die Werte von Hand ein.",
Expand Down Expand Up @@ -1362,8 +1362,9 @@
"searchClear": "Suche leeren",
"import": "Importieren …",
"list": "{count, plural, one {# Projekt} other {# Projekte}}",
"emptyTitle": "Noch keine Projekte",
"emptyBody": "Starte ein neues Projekt, öffne eines oder importiere eine Datei (STEP, IGES, STL, 3MF, OBJ oder ein SolidCraft-Design), auch per Ziehen aufs Fenster. Jedes Projekt bekommt einen eigenen Ordner im Projektordner (Einstellungen › Allgemein).",
"emptyTitle": "Dein erstes Teil",
"emptyBody": "Beschreib, was du brauchst – der Assistent baut es Schritt für Schritt. Oder fang unten mit einer Vorlage an.",
"describe": "Teil beschreiben",
"noMatch": "Kein Projekt passt zu „{query}“.",
"openNow": "Gerade geöffnet",
"justNow": "gerade eben",
Expand Down Expand Up @@ -1515,8 +1516,9 @@
},
"solidcraft": "PartBuddy zeigt und ändert deine Teile über SolidCraft, ein freies CAD-Programm, das im Hintergrund läuft. PartBuddy sucht es selbst; ist es nicht installiert, lade es herunter und such erneut.",
"download": "SolidCraft herunterladen (GitHub)",
"models": "Erweitert: Modell je Arbeitsschritt",
"assistant": "Wähle den Assistenten, den du schon bezahlst: Claude über dein Claude Code oder ChatGPT mit deinem Abo. Anmelden geht auch später.",
"print": "Trag Drucker und Material einmal ein; der Assistent konstruiert passend dazu. Speichern oder diesen Schritt überspringen.",
"print": "Wähl deinen Drucker aus der Liste – Bauraum, Düse und Schichthöhe trägt PartBuddy dann selbst ein. Der Assistent konstruiert passend dazu.",
"projects": "Jedes Projekt bekommt hier einen eigenen Ordner mit Design, Gespräch, Versionen und Exporten.",
"skip": "Einrichtung überspringen",
"back": "Zurück",
Expand Down
12 changes: 7 additions & 5 deletions apps/desktop/src/renderer/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
"preview": "Preview",
"plan": "Claude subscription",
"apiKey": "API key, billed separately",
"signedIn": "Claude Code {version} · {plan}",
"signedIn": "Signed in · Claude Code {version} · {plan}",
"state": {
"claude-code": {
"checking": "Looking for Claude Code",
Expand Down Expand Up @@ -1112,7 +1112,7 @@
"hint": "Saves material and print time: leaves out volume that does nothing (an open bottom, a frame instead of a plate) without hollowing closed bodies, and keeps the build height low. Function and strength come first; infill and speed stay with your slicer."
}
},
"add": "Add printer",
"add": "Printer from the list …",
"catalog": "Printer catalog",
"catalogSearch": "Search brand or model",
"catalogEmpty": "No printer matches. Copy an existing one and enter the values by hand.",
Expand Down Expand Up @@ -1362,8 +1362,9 @@
"searchClear": "Clear search",
"import": "Import …",
"list": "{count, plural, one {# project} other {# projects}}",
"emptyTitle": "No projects yet",
"emptyBody": "Start a new project, open one or import a file (STEP, IGES, STL, 3MF, OBJ or a SolidCraft design), also by dropping it on the window. Every project gets a folder of its own in the projects folder (Settings › General).",
"emptyTitle": "Your first part",
"emptyBody": "Describe what you need – the assistant builds it step by step. Or start from a template below.",
"describe": "Describe a part",
"noMatch": "No project matches “{query}”.",
"openNow": "Open now",
"justNow": "just now",
Expand Down Expand Up @@ -1515,8 +1516,9 @@
},
"solidcraft": "PartBuddy shows and changes your parts through SolidCraft, a free CAD program that runs in the background. PartBuddy looks for it on its own; if it is not installed, download it and look again.",
"download": "Download SolidCraft (GitHub)",
"models": "Advanced: model per step",
"assistant": "Choose the assistant you already pay for: Claude through your Claude Code, or ChatGPT with your plan. You can sign in later as well.",
"print": "Enter your printer and material once; the assistant designs for them. Save or skip this step.",
"print": "Pick your printer from the list – PartBuddy fills in build volume, nozzle and layer height. The assistant designs for it.",
"projects": "Every project gets a folder of its own here, with the design, the conversation, versions and exports.",
"skip": "Skip setup",
"back": "Back",
Expand Down
4 changes: 3 additions & 1 deletion apps/desktop/src/renderer/src/shell/FirstStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Dialog, Heading, Modal, ModalOverlay } from 'react-aria-components';

import type { GeneralSettingsInfo } from '../../../shared/contract';
import { AssistantChoice } from '../assistant/AgentChip';
import { AssistantSetup } from '../assistant/AssistantPanel';
import { PrintProfilesEditor } from '../print/PrintProfilesEditor';
import { platform } from '../platform';
import { Button, linkClass } from '../ui/Button';
Expand Down Expand Up @@ -108,7 +109,8 @@ export function FirstStart() {
) : step === 'assistant' ? (
<div className="flex flex-col gap-3">
<p className="text-sm text-text">{t('firstStart.assistant')}</p>
<AssistantChoice />
<AssistantChoice setup />
<AssistantSetup />
</div>
) : step === 'print' ? (
<div className="flex flex-col gap-3">
Expand Down
10 changes: 7 additions & 3 deletions apps/desktop/src/renderer/src/shell/StatusBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ export function StatusBar() {

return (
<footer className="flex h-statusbar shrink-0 items-center gap-4 overflow-hidden whitespace-nowrap border-t border-border bg-surface px-3 text-xs text-text-muted">
<span title={t('status.unitsTitle')}>{t('status.units')}</span>
<MaterialMenu />
<PrintCheckChip />
{homeOpen ? null : (
<>
<span title={t('status.unitsTitle')}>{t('status.units')}</span>
<MaterialMenu />
<PrintCheckChip />
</>
)}
{bodies.length > 0 && !homeOpen ? (
<span
data-testid="mesh-summary"
Expand Down
13 changes: 8 additions & 5 deletions apps/desktop/src/renderer/src/shell/TitleBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ export function TitleBar() {
<span className="font-display text-lg font-semibold text-text">{t('app.name')}</span>
</AriaButton>
</Tip>
<nav aria-label={t('app.design')} className="flex min-w-0 items-center gap-2 text-md">
<span className="text-text-subtle">/</span>
<ProjectMenu designName={designName} />
{model.status === 'ready' && connection.save && !homeOpen ? <SaveState state={connection.save} /> : null}
</nav>
{/* The start page is no project: its name, save state and actions come with one (usability U-11, audit A-14). */}
{homeOpen ? null : (
<nav aria-label={t('app.design')} className="flex min-w-0 items-center gap-2 text-md">
<span className="text-text-subtle">/</span>
<ProjectMenu designName={designName} />
{model.status === 'ready' && connection.save ? <SaveState state={connection.save} /> : null}
</nav>
)}
{homeOpen ? null : <DesignActions />}
{/* The bar names SolidCraft's version; the model's revision stays on hover (14 November 2026). */}
<div
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/renderer/src/state/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ interface StudioState {
focusRequest: { box: FindingBox; serial: number } | null;
requestFocus: (box: FindingBox) => void;
/** An empty state of the structure tree asks the chat for something: a draft about parameters, or the sketch pad. */
assistantRequest: { what: 'parameters' | 'sketch'; serial: number } | null;
requestAssistant: (what: 'parameters' | 'sketch') => void;
assistantRequest: { what: 'parameters' | 'sketch' | 'describe'; serial: number } | null;
requestAssistant: (what: 'parameters' | 'sketch' | 'describe') => void;
/** An export waiting for the user to confirm it despite a red check. */
exportConfirm: ExportTarget | null;
setExportConfirm: (target: ExportTarget | null) => void;
Expand Down
Binary file added docs/screens/usability-2026-11/U-01-vorher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screens/usability-2026-11/U-06-nachher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.