feat(electrobun): complete project wizard phases 4-5

- ModelConfigPanel: Claude thinking/effort, Codex sandbox/approval, Ollama
  temp/ctx/predict, Gemini thinkingLevel/budget (mutually exclusive)
- CustomDropdown: themed with keyboard nav, groupBy, display:none pattern
- CustomCheckbox/CustomRadio: themed with Lucide icons
- Replaced native selects in 5 settings panels + wizard steps
- wizard-state.ts: shared type definitions
- Gemini added as 4th provider throughout
This commit is contained in:
Hibryda 2026-03-23 13:12:47 +01:00
parent d4014a193d
commit 41b8d46a19
6 changed files with 210 additions and 247 deletions

View file

@ -0,0 +1,68 @@
/**
* Wizard state management field update dispatch and default values.
*
* Extracted from ProjectWizard.svelte to keep it under 300 lines.
*/
export type SourceType = 'local' | 'git-clone' | 'github' | 'template' | 'remote';
export type AuthMethod = 'password' | 'key' | 'agent' | 'config';
export type PathState = 'idle' | 'checking' | 'valid' | 'invalid' | 'not-dir';
export type ProbeState = 'idle' | 'probing' | 'ok' | 'error';
export interface WizardState {
step: number;
sourceType: SourceType;
localPath: string;
repoUrl: string;
cloneTarget: string;
githubRepo: string;
selectedTemplate: string;
templateTargetDir: string;
remoteHost: string;
remoteUser: string;
remotePath: string;
remoteAuthMethod: AuthMethod;
remotePassword: string;
remoteKeyPath: string;
remoteSshfs: boolean;
pathValid: PathState;
isGitRepo: boolean;
gitBranch: string;
gitProbeStatus: ProbeState;
gitProbeBranches: string[];
githubInfo: { stars: number; description: string; defaultBranch: string } | null;
githubLoading: boolean;
cloning: boolean;
projectName: string;
nameError: string;
selectedBranch: string;
branches: string[];
useWorktrees: boolean;
selectedGroupId: string;
projectIcon: string;
projectColor: string;
shellChoice: string;
provider: string;
model: string;
permissionMode: string;
systemPrompt: string;
autoStart: boolean;
providerModels: Array<{ id: string; name: string; provider: string }>;
modelsLoading: boolean;
}
export function getDefaults(groupId: string): WizardState {
return {
step: 1, sourceType: 'local', localPath: '', repoUrl: '', cloneTarget: '',
githubRepo: '', selectedTemplate: '', templateTargetDir: '~/projects',
remoteHost: '', remoteUser: '', remotePath: '',
remoteAuthMethod: 'agent', remotePassword: '', remoteKeyPath: '~/.ssh/id_ed25519',
remoteSshfs: false, pathValid: 'idle', isGitRepo: false, gitBranch: '',
gitProbeStatus: 'idle', gitProbeBranches: [], githubInfo: null, githubLoading: false,
cloning: false, projectName: '', nameError: '', selectedBranch: '',
branches: [], useWorktrees: false, selectedGroupId: groupId,
projectIcon: 'Terminal', projectColor: 'var(--ctp-blue)', shellChoice: 'bash',
provider: 'claude', model: '', permissionMode: 'default',
systemPrompt: '', autoStart: false, providerModels: [], modelsLoading: false,
};
}