fix(electrobun): wizard fixes — native dialog, models, PathBrowser, ensureDir
- Native dialog: resolve to nearest existing parent dir, detect user cancel (exit code 1) vs actual error, add createIfMissing option - Claude models: fallback to KNOWN_CLAUDE_MODELS (6 models) when API key unavailable. Adds Opus 4.6, Sonnet 4.6, Opus 4.5, Sonnet 4, Haiku 4.5, Sonnet 3.7. Live API paginated to limit=100. - PathBrowser: Select button moved to sticky header (always visible). Current path shown compact in header with RTL ellipsis. - files.ensureDir RPC: creates directory recursively before project creation - files.ensureDir added to RPC schema
This commit is contained in:
parent
162b5417e4
commit
a4d180d382
6 changed files with 77 additions and 12 deletions
|
|
@ -125,10 +125,14 @@
|
|||
</script>
|
||||
|
||||
<div class="path-browser">
|
||||
<!-- Header -->
|
||||
<!-- Header with Select always visible -->
|
||||
<div class="pb-header">
|
||||
<span class="pb-title">{t('wizard.step1.browse' as any)}</span>
|
||||
<button class="pb-close" onclick={onClose} aria-label={t('common.close' as any)}>✕</button>
|
||||
<div class="pb-header-actions">
|
||||
<span class="pb-current-compact" title={currentPath}>{currentPath}</span>
|
||||
<button class="pb-select-btn" onclick={confirmSelect}>Select</button>
|
||||
<button class="pb-close" onclick={onClose} aria-label={t('common.close' as any)}>✕</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Shortcuts -->
|
||||
|
|
@ -172,10 +176,9 @@
|
|||
{/if}
|
||||
</div>
|
||||
|
||||
<!-- Footer: current path + select -->
|
||||
<!-- Footer: current path (Select moved to header) -->
|
||||
<div class="pb-footer">
|
||||
<span class="pb-current" title={currentPath}>{currentPath}</span>
|
||||
<button class="pb-select-btn" onclick={confirmSelect}>Select</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -199,6 +202,25 @@
|
|||
justify-content: space-between;
|
||||
padding: 0.375rem 0.5rem;
|
||||
border-bottom: 1px solid var(--ctp-surface0);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 2;
|
||||
background: var(--ctp-mantle);
|
||||
}
|
||||
.pb-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
.pb-current-compact {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--ctp-subtext0);
|
||||
max-width: 12rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
direction: rtl;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.pb-title { font-size: 0.75rem; font-weight: 600; color: var(--ctp-text); }
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@
|
|||
|
||||
async function createProject() {
|
||||
const cwd = sourceType === 'remote' ? `ssh://${sanitize(remoteUser)}@${sanitize(remoteHost)}:${sanitize(remotePath)}` : (sanitizePath(localPath) || localPath.trim());
|
||||
// Ensure directory exists for local paths
|
||||
if (sourceType !== 'remote' && cwd) {
|
||||
try { await appRpc.request['files.ensureDir']({ path: cwd }); } catch { /* best effort */ }
|
||||
}
|
||||
onCreated({ id: `p-${Date.now()}`, name: sanitize(projectName) || 'Untitled', cwd, provider, model: model || undefined, systemPrompt: systemPrompt || undefined, autoStart, groupId: selectedGroupId, useWorktrees: useWorktrees || undefined, shell: shellChoice, icon: projectIcon, color: projectColor, modelConfig: Object.keys(modelConfig).length > 0 ? modelConfig : undefined });
|
||||
resetState();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue