Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Bun",
"image": "oven/bun:latest",
"customizations": {
"vscode": {
"extensions": [
"Oven.bun-vscode"
]
}
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ node_modules
.DS_Store
coverage
coverage-html
coverage_html
.vscode
*.lcov
.turbo
.qlty
Expand Down
7 changes: 7 additions & 0 deletions .opencode/commands/scotty.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
description: Create Scotty Dog ASCII Art
agent: build
model: opencode/big-pickle
---

Output an ASCII art of a Scottish Terrier dog named "Scotty"
36 changes: 0 additions & 36 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 31 additions & 1 deletion packages/app/src/wsl/settings-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
createProbeFailureGate,
runAddableProbePlan,
wslOpencodeAction,
wslRuntimeRetryable,
wslRuntimeRetryable
} from "./settings-model"
import type { WslServersState } from "./types"

Expand Down Expand Up @@ -214,6 +214,36 @@ describe("WSL server settings presentation", () => {
expect(model.primaryButton.action).toBe("install-opencode")
})

test("correct button loads when server probing selected", () => {
const model = addServerViewModel({
state: {
...readyWslState,
installed: [
{ name: "Debian", version: 2, isDefault: true },
{ name: "Ubuntu", version: 2, isDefault: false },
],
online: [{ name: "Alpine", label: "Alpine Linux" }],
distroProbes: {
Ubuntu: { name: "Ubuntu", canExecute: true, hasBash: true, hasCurl: true, error: null },
},
},
view: "main",
selectedDistro: null,
catalogSearch: "",
catalogTarget: null,
adding: true,
probingAddable: true,
})
expect(model.primaryButton).toEqual({
variant: "contrast",
label: { key: "wsl.onboarding.distroStatus.checking" },
disabled: true,
action: null,
loading: true,
width: null,
})
})

test("delegates addable probe plans to one batch command", async () => {
const calls: string[][] = []

Expand Down
25 changes: 17 additions & 8 deletions packages/app/src/wsl/settings-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,23 @@ function addServerPrimaryButton(input: {
}): AddServerPrimaryButton {
const ready = !!input.selectedDistro && wslDistroReady(input.state, input.selectedDistro)
const probingSelected = input.probingAddable && !addServerSelectedDistroSettled(input.state, input.selectedDistro)
const probingOpencode =
probingSelected ||
(ready &&
(!input.opencodeCheck ||
(!!input.selectedDistro &&
input.state?.job?.kind === "probe-addable" &&
input.state.job.distros.includes(input.selectedDistro))))
const installingOpencode =

const selectedDistro = input.selectedDistro;
const job = input.state?.job;

const distroIsAddable =
!!selectedDistro &&
job?.kind === "probe-addable" &&
job.distros.includes(selectedDistro);

const probingOpencode = probingSelected || (ready && (!input.opencodeCheck || distroIsAddable));
// const probingOpencode = probingSelected ||
// (ready &&
// (!input.opencodeCheck ||
// (!!input.selectedDistro &&
// input.state?.job?.kind === "probe-addable" &&
// input.state.job.distros.includes(input.selectedDistro))))
const installingOpencode =
input.state?.job?.kind === "install-opencode" && input.state.job.distro === input.selectedDistro
if (!ready || probingOpencode) {
return {
Expand Down
Loading