fix(electrobun): wizard creation flow + GitLab probe + shell detection + dropdown flip
- Git probe tries GitHub then GitLab for owner/repo shorthand - Shows "Found on GitHub/GitLab" with platform indicator - system.shells RPC detects installed shells (bash/zsh/fish/sh/dash) - CustomDropdown flip logic uses 200px threshold for flip-up - Project creation properly persists all wizard fields + adds card
This commit is contained in:
parent
021feba3ed
commit
e61473b025
7 changed files with 112 additions and 21 deletions
|
|
@ -1,4 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { PROJECT_ICONS, ACCENT_COLORS } from './wizard-icons.ts';
|
||||
import {
|
||||
Terminal, Server, Globe, Code, Database, Cpu, Zap, Shield,
|
||||
|
|
@ -11,6 +12,7 @@
|
|||
} from 'lucide-svelte';
|
||||
import CustomDropdown from './ui/CustomDropdown.svelte';
|
||||
import CustomCheckbox from './ui/CustomCheckbox.svelte';
|
||||
import { appRpc } from './rpc.ts';
|
||||
|
||||
interface Props {
|
||||
projectName: string;
|
||||
|
|
@ -33,7 +35,29 @@
|
|||
isGitRepo, onUpdate,
|
||||
}: Props = $props();
|
||||
|
||||
const SHELLS = ['bash', 'zsh', 'fish', 'sh'];
|
||||
let detectedShells = $state<Array<{ path: string; name: string }>>([]);
|
||||
const FALLBACK_SHELLS = ['bash', 'zsh', 'fish', 'sh'];
|
||||
|
||||
onMount(async () => {
|
||||
try {
|
||||
const r = await appRpc.request['system.shells']({});
|
||||
if (r?.shells?.length) {
|
||||
detectedShells = r.shells;
|
||||
// If current shellChoice is not in detected shells, select the first available
|
||||
if (!r.shells.some(s => s.name === shellChoice)) {
|
||||
onUpdate('shellChoice', r.shells[0].name);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Fallback — use hardcoded list
|
||||
}
|
||||
});
|
||||
|
||||
let shellItems = $derived(
|
||||
detectedShells.length > 0
|
||||
? detectedShells.map(s => ({ value: s.name, label: `${s.name} (${s.path})` }))
|
||||
: FALLBACK_SHELLS.map(sh => ({ value: sh, label: sh }))
|
||||
);
|
||||
|
||||
const ICON_MAP: Record<string, typeof Terminal> = {
|
||||
Terminal, Server, Globe, Code, Database, Cpu, Zap, Shield,
|
||||
|
|
@ -108,7 +132,7 @@
|
|||
|
||||
<label class="wz-label">Shell</label>
|
||||
<CustomDropdown
|
||||
items={SHELLS.map(sh => ({ value: sh, label: sh }))}
|
||||
items={shellItems}
|
||||
selected={shellChoice}
|
||||
onSelect={v => onUpdate('shellChoice', v)}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue