Skip to content

Commit d23f60a

Browse files
committed
feedback + opportunistic fixes
1 parent 112f129 commit d23f60a

File tree

3 files changed

+35
-61
lines changed

3 files changed

+35
-61
lines changed

app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/create_spec/+page.svelte

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,7 @@
139139
next_error = null
140140
submitting = true
141141
142-
// Validate required fields
143-
for (const field of field_configs) {
144-
if (field.required) {
145-
const value = property_values[field.key]
146-
if (!value || !value.trim()) {
147-
throw new Error(`${field.label} is required`)
148-
}
149-
}
150-
}
142+
validateRequiredFields()
151143
152144
if (!has_kiln_copilot) {
153145
submitting = false
@@ -165,15 +157,20 @@
165157
// Don't warn before unloading since we're intentionally navigating
166158
warn_before_unload = false
167159
168-
// Navigate to review_spec page
169-
await navigateToReviewSpec(
170-
project_id,
171-
task_id,
172-
name,
173-
spec_type,
174-
property_values,
175-
evaluate_full_trace,
176-
)
160+
try {
161+
// Navigate to review_spec page
162+
await navigateToReviewSpec(
163+
project_id,
164+
task_id,
165+
name,
166+
spec_type,
167+
property_values,
168+
evaluate_full_trace,
169+
)
170+
} catch (error) {
171+
warn_before_unload = true
172+
next_error = createKilnError(error)
173+
}
177174
}
178175
179176
let show_continue_to_review = false
@@ -195,21 +192,24 @@
195192
return false
196193
}
197194
195+
function validateRequiredFields() {
196+
for (const field of field_configs) {
197+
if (field.required) {
198+
const value = property_values[field.key]
199+
if (!value || !value.trim()) {
200+
throw new Error(`${field.label} is required`)
201+
}
202+
}
203+
}
204+
}
205+
198206
async function do_create_spec(set_error: (error: KilnError | null) => void) {
199207
try {
200208
set_error(null)
201209
submitting = true
202210
complete = false
203211
204-
// Validate required fields
205-
for (const field of field_configs) {
206-
if (field.required) {
207-
const value = property_values[field.key]
208-
if (!value || !value.trim()) {
209-
throw new Error(`${field.label} is required`)
210-
}
211-
}
212-
}
212+
validateRequiredFields()
213213
214214
const spec_id = await createSpec(
215215
project_id,
@@ -256,7 +256,7 @@
256256
]}
257257
>
258258
<FormContainer
259-
submit_label="Next"
259+
submit_label={has_kiln_copilot ? "Refine Spec with Copilot" : "Next"}
260260
on:submit={check_kiln_copilot_and_proceed}
261261
bind:error={next_error}
262262
bind:submitting
@@ -309,7 +309,7 @@
309309
<span class="text-xs text-gray-500">or</span>
310310
<button
311311
class="link underline text-xs text-gray-500"
312-
on:click={create_spec_from_form}>Create Spec Without Analysis</button
312+
on:click={create_spec_from_form}>Create Spec Without Copilot</button
313313
>
314314
</div>
315315
{/if}
@@ -341,8 +341,8 @@
341341
{#if show_continue_to_review}
342342
<button
343343
class="btn btn-primary mt-4 w-full"
344-
on:click={() => {
345-
proceed_to_review()
344+
on:click={async () => {
345+
await proceed_to_review()
346346
copilot_v_manual_dialog?.close()
347347
}}
348348
>

app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/refine_spec/+page.svelte

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
<!-- Column Headers -->
214214
<div class="grid grid-cols-2 gap-8 mb-4">
215215
<div class="text-xl font-bold">Current</div>
216-
<div class="text-xl font-bold">Suggestions</div>
216+
<div class="text-xl font-bold">Refined</div>
217217
</div>
218218

219219
<!-- Spec Name Row -->
@@ -266,36 +266,12 @@
266266
class="badge badge-success badge-outline badge-sm gap-1 ml-2"
267267
>
268268
No changes
269-
<svg
270-
class="w-3 h-3"
271-
viewBox="0 0 24 24"
272-
fill="none"
273-
xmlns="http://www.w3.org/2000/svg"
274-
>
275-
<path
276-
d="M16 9L10 15.5L7.5 13M12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"
277-
stroke="currentColor"
278-
stroke-width="2"
279-
stroke-linecap="round"
280-
stroke-linejoin="round"
281-
/>
282-
</svg>
283269
</span>
284270
{:else}
285271
<span
286272
class="badge badge-warning badge-outline badge-sm gap-1 ml-2"
287273
>
288-
Edit suggested
289-
<svg
290-
class="w-3 h-3"
291-
fill="currentColor"
292-
viewBox="0 0 256 256"
293-
xmlns="http://www.w3.org/2000/svg"
294-
>
295-
<path
296-
d="M128,20.00012a108,108,0,1,0,108,108A108.12217,108.12217,0,0,0,128,20.00012Zm0,192a84,84,0,1,1,84-84A84.0953,84.0953,0,0,1,128,212.00012Zm-12-80v-52a12,12,0,1,1,24,0v52a12,12,0,1,1-24,0Zm28,40a16,16,0,1,1-16-16A16.018,16.018,0,0,1,144,172.00012Z"
297-
/>
298-
</svg>
274+
Refined
299275
</span>
300276
{/if}
301277
{/if}

app/web_ui/src/routes/(app)/specs/[project_id]/[task_id]/review_spec/+page.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
let submitting = false
3636
let complete = false
3737
38-
$: submit_label = all_feedback_aligned
39-
? "Create Spec"
40-
: "Refine Spec with Feedback"
38+
$: submit_label = all_feedback_aligned ? "Create Spec" : "Next"
4139
$: submit_disabled = !all_feedback_aligned && !any_feedback_provided
4240
4341
type ReviewRow = {
@@ -395,7 +393,7 @@
395393
<div class="flex justify-center">
396394
<Warning
397395
warning_color="warning"
398-
warning_message="For best results, finish reviewing all examples before refining the spec."
396+
warning_message="For best results, finish reviewing all examples before continuing."
399397
tight={true}
400398
/>
401399
</div>

0 commit comments

Comments
 (0)