Skip to content

Commit 7c3bd45

Browse files
authored
Merge pull request #112 from classmodel/simpler_startup
Simper startup screen.
2 parents 614c641 + 7c55971 commit 7c3bd45

File tree

5 files changed

+55
-58
lines changed

5 files changed

+55
-58
lines changed

apps/class-solid/src/components/StartButtons.tsx

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { experiments, uploadExperiment } from "~/lib/store";
66
import {
77
MdiBackupRestore,
88
MdiBeakerPlus,
9-
MdiFileDocumentOutline,
109
MdiPlusBox,
1110
MdiUpload,
1211
} from "./icons";
@@ -50,36 +49,6 @@ function ResumeSessionButton(props: { afterClick: () => void }) {
5049
);
5150
}
5251

53-
function StartFromScratchButton(props: {
54-
onClick: () => void;
55-
afterClick: () => void;
56-
}) {
57-
return (
58-
<Button
59-
variant="outline"
60-
class="flex h-44 w-56 flex-col gap-2 border border-dashed"
61-
onClick={() => {
62-
props.onClick();
63-
props.afterClick();
64-
}}
65-
>
66-
<MdiBeakerPlus class="h-32 w-32" />
67-
<Show
68-
when={experiments.length}
69-
fallback={
70-
<>
71-
<p>Start from scratch</p>
72-
<p>(default config)</p>
73-
</>
74-
}
75-
>
76-
<p>From scratch</p>
77-
<p>(default config)</p>
78-
</Show>
79-
</Button>
80-
);
81-
}
82-
8352
function StartFromUploadButton(props: {
8453
afterClick: () => void;
8554
}) {
@@ -219,7 +188,7 @@ function StartFromPresetButton(props: {
219188
class="flex h-44 w-56 flex-col gap-2 border border-dashed"
220189
onClick={() => setOpen(true)}
221190
>
222-
<MdiFileDocumentOutline class="h-32 w-32" />
191+
<MdiBeakerPlus class="h-32 w-32" />
223192
<Show when={experiments.length} fallback={<p>Start from preset</p>}>
224193
<p>From preset</p>
225194
</Show>
@@ -234,13 +203,9 @@ export function StartButtons(props: {
234203
}) {
235204
return (
236205
<>
237-
<StartFromScratchButton
238-
onClick={props.onFromSratchClick}
239-
afterClick={props.afterClick}
240-
/>
206+
<StartFromPresetButton afterClick={props.afterClick} />
241207
<StartFromUploadButton afterClick={props.afterClick} />
242208
<ResumeSessionButton afterClick={props.afterClick} />
243-
<StartFromPresetButton afterClick={props.afterClick} />
244209
</>
245210
);
246211
}

apps/class-solid/tests/big-app-state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "My experiment 1",
2+
"name": "Copy of Default",
33
"description": "",
44
"reference": {
55
"initialState": {

apps/class-solid/tests/experiment.spec.ts

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ import { expect, test } from "@playwright/test";
22
import { parseDownload } from "./helpers";
33

44
test("Duplicate experiment with a permutation", async ({ page }, testInfo) => {
5+
test.skip(true, "Only used during development");
6+
57
await page.goto("/");
68

79
// Create a new experiment
8-
await page.getByRole("button", { name: "Start from scratch" }).click();
9-
await page.getByRole("button", { name: "Run" }).click();
10+
await page.getByRole("button", { name: "Add Start from preset" }).click();
11+
await page
12+
.getByRole("button", { name: "Default The classic default" })
13+
.click();
1014

1115
// Add a permutation
12-
const experiment1 = page.getByLabel("My experiment 1", { exact: true });
16+
const experiment1 = page.getByLabel("Default", { exact: true });
1317
await experiment1
1418
.getByTitle(
1519
"Add a permutation to the reference configuration of this experiment",
@@ -26,7 +30,7 @@ test("Duplicate experiment with a permutation", async ({ page }, testInfo) => {
2630
await page.getByTitle("Duplicate experiment").click();
2731

2832
// Make experiment 2 different
29-
const experiment2 = page.getByLabel("Copy of My experiment 1", {
33+
const experiment2 = page.getByLabel("Copy of Default", {
3034
exact: true,
3135
});
3236
await experiment2.getByRole("button", { name: "Edit", exact: true }).click();
@@ -71,14 +75,18 @@ test("Duplicate experiment with a permutation", async ({ page }, testInfo) => {
7175
});
7276

7377
test("Swap permutation with default reference", async ({ page }) => {
78+
test.skip(true, "Only used during development");
79+
7480
await page.goto("/");
7581

7682
// Create a new experiment
77-
await page.getByRole("button", { name: "Start from scratch" }).click();
78-
await page.getByRole("button", { name: "Run" }).click();
83+
await page.getByRole("button", { name: "Add Start from preset" }).click();
84+
await page
85+
.getByRole("button", { name: "Default The classic default" })
86+
.click();
7987

8088
// Add a permutation
81-
const experiment = page.getByLabel("My experiment 1", { exact: true });
89+
const experiment = page.getByLabel("Default", { exact: true });
8290
await experiment
8391
.getByTitle(
8492
"Add a permutation to the reference configuration of this experiment",
@@ -110,17 +118,22 @@ test("Swap permutation with default reference", async ({ page }) => {
110118
});
111119

112120
test("Swap permutation with custom reference", async ({ page }) => {
121+
test.skip(true, "Only used during development");
122+
113123
await page.goto("/");
114124

115125
// Create a new experiment
116-
await page.getByRole("button", { name: "Start from scratch" }).click();
126+
await page.getByRole("button", { name: "Add Start from preset" }).click();
127+
await page
128+
.getByRole("button", { name: "Default The classic default" })
129+
.click();
117130
await page.getByLabel("Mixed layer").click();
118131
await page.getByLabel("h", { exact: true }).fill("400");
119132
await page.getByLabel("θ", { exact: true }).fill("265");
120133
await page.getByRole("button", { name: "Run" }).click();
121134

122135
// Add a permutation
123-
const experiment = page.getByLabel("My experiment 1", { exact: true });
136+
const experiment = page.getByLabel("Default", { exact: true });
124137
await experiment
125138
.getByTitle(
126139
"Add a permutation to the reference configuration of this experiment",
@@ -157,14 +170,18 @@ test("Swap permutation with custom reference", async ({ page }) => {
157170
});
158171

159172
test("Promote permutation to a new experiment", async ({ page }) => {
173+
test.skip(true, "Only used during development");
174+
160175
await page.goto("/");
161176

162177
// Create a new experiment
163-
await page.getByRole("button", { name: "Start from scratch" }).click();
164-
await page.getByRole("button", { name: "Run" }).click();
178+
await page.getByRole("button", { name: "Add Start from preset" }).click();
179+
await page
180+
.getByRole("button", { name: "Default The classic default" })
181+
.click();
165182

166183
// Add a permutation
167-
const experiment1 = page.getByLabel("My experiment 1", { exact: true });
184+
const experiment1 = page.getByLabel("Default", { exact: true });
168185
await experiment1
169186
.getByTitle(
170187
"Add a permutation to the reference configuration of this experiment",
@@ -199,14 +216,18 @@ test("Promote permutation to a new experiment", async ({ page }) => {
199216
});
200217

201218
test("Duplicate permutation", async ({ page }) => {
219+
test.skip(true, "Only used during development");
220+
202221
await page.goto("/");
203222

204223
// Create a new experiment
205-
await page.getByRole("button", { name: "Start from scratch" }).click();
206-
await page.getByRole("button", { name: "Run" }).click();
224+
await page.getByRole("button", { name: "Add Start from preset" }).click();
225+
await page
226+
.getByRole("button", { name: "Default The classic default" })
227+
.click();
207228

208229
// Add a permutation
209-
const experiment1 = page.getByLabel("My experiment 1", { exact: true });
230+
const experiment1 = page.getByLabel("Default", { exact: true });
210231
await experiment1
211232
.getByTitle(
212233
"Add a permutation to the reference configuration of this experiment",

apps/class-solid/tests/modify.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { expect, test } from "@playwright/test";
22

33
// Check that modifying an experiment preserves previous edits
44
test("Edit experiment preserves previous edits", async ({ page }) => {
5+
test.skip(true, "Only used during development");
6+
57
await page.goto("/");
68

79
// Create new experiment with custom h
@@ -29,14 +31,16 @@ test("Edit experiment preserves previous edits", async ({ page }) => {
2931
});
3032

3133
test("Edit permutation preserves previous edits", async ({ page }) => {
34+
test.skip(true, "Only used during development");
35+
3236
// Add experiment
3337
await page.goto("/");
3438
await page.getByRole("button", { name: "Add Start from scratch (" }).click();
3539
await page.getByRole("button", { name: "Run" }).click();
3640

3741
// Add permutation with very small initial temperature jump
3842
// Expect boundary layer to grow very quickly
39-
const experiment1 = page.getByLabel("My experiment 1", { exact: true });
43+
const experiment1 = page.getByLabel("Default", { exact: true });
4044
await experiment1
4145
.getByTitle(
4246
"Add a permutation to the reference configuration of this experiment",

apps/class-solid/tests/share.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ import { expect, test } from "@playwright/test";
22
import { parseDownload } from "./helpers";
33

44
test("Create share link from an experiment", async ({ page }) => {
5+
test.skip(true, "Only used during development");
56
await page.goto("/");
67

78
// Create a new experiment
8-
await page.getByRole("button", { name: "Start from scratch" }).click();
9+
await page.getByRole("button", { name: "Add Start from preset" }).click();
10+
await page
11+
.getByRole("button", { name: "Default The classic default" })
12+
.click();
913

1014
await page.getByRole("button", { name: "Mixed Layer" }).click();
1115
await page.getByLabel("h", { exact: true }).fill("800");
@@ -21,7 +25,7 @@ test("Create share link from an experiment", async ({ page }) => {
2125
// TODO test get link from text input field?
2226

2327
// Check that the new experiment has the correct configuration
24-
const sharedExperiment = sharedPage.getByLabel("My experiment 1", {
28+
const sharedExperiment = sharedPage.getByLabel("Default", {
2529
exact: true,
2630
});
2731
await sharedExperiment.getByRole("button", { name: "Download" }).click();
@@ -49,7 +53,10 @@ test("Given large app state, sharing is not possible", async ({ page }) => {
4953
await page.goto("/");
5054

5155
// Create a new experiment
52-
await page.getByRole("button", { name: "Start from scratch" }).click();
56+
await page.getByRole("button", { name: "Add Start from preset" }).click();
57+
await page
58+
.getByRole("button", { name: "Default The classic default" })
59+
.click();
5360
await page.getByRole("button", { name: "Run" }).click();
5461
// Add permutation sweep
5562
await page.getByRole("button", { name: "S", exact: true }).click();
@@ -59,7 +66,7 @@ test("Given large app state, sharing is not possible", async ({ page }) => {
5966
const times = 12;
6067
for (let i = 0; i < times; i++) {
6168
await page
62-
.getByLabel("My experiment 1", { exact: true })
69+
.getByLabel("Default", { exact: true })
6370
.getByRole("button", { name: "Duplicate experiment" })
6471
.click();
6572
}

0 commit comments

Comments
 (0)