Skip to content
Merged
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
7 changes: 4 additions & 3 deletions app/new/stack/stack-summary-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,9 +435,10 @@ export function StackSummaryPage({ stackId, mode }: StackSummaryPageProps) {
return null
}
const currentValue = responses ? responses[editingQuestion.id] : undefined
const currentFreeText = typeof freeTextResponses[editingQuestion.id] === "string"
? freeTextResponses[editingQuestion.id]
: ""
const storedFreeTextValue = freeTextResponses[editingQuestion.id]
const currentFreeText = typeof storedFreeTextValue === "string"
? storedFreeTextValue
: undefined
return (
<WizardEditAnswerDialog
question={editingQuestion}
Expand Down
2 changes: 1 addition & 1 deletion components/instructions-wizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ export function InstructionsWizard({
>
<CheckCircle2 className="h-3.5 w-3.5" />
<span>
We'll use
We&apos;ll use
{" "}
<code className="rounded bg-muted px-1.5 py-0.5 text-[0.7rem] font-medium">
{savedCustomFreeTextValue}
Expand Down
2 changes: 1 addition & 1 deletion components/wizard-edit-answer-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export function WizardEditAnswerDialog({
>
<CheckCircle2 className="h-3.5 w-3.5" />
<span>
We'll use
We&apos;ll use
{" "}
<code className="rounded bg-muted px-1.5 py-0.5 text-[0.7rem] font-medium">
{persistedCustomAnswer}
Expand Down
5 changes: 3 additions & 2 deletions lib/wizard-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ export const serializeWizardResponses = (

const answer = responses[question.id]
const targetKey = responseKey as keyof WizardResponses
const freeTextValue = typeof freeTextResponses[question.id] === "string"
? freeTextResponses[question.id]?.trim()
const rawFreeTextValue = freeTextResponses[question.id]
const freeTextValue = typeof rawFreeTextValue === "string"
? rawFreeTextValue.trim()
: ""
const entries: string[] = []

Expand Down
5 changes: 3 additions & 2 deletions lib/wizard-summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ export const buildCompletionSummary = (
return value === answer.value
})

const freeTextValue = typeof freeTextResponses[question.id] === "string"
? freeTextResponses[question.id]?.trim()
const storedFreeTextValue = freeTextResponses[question.id]
const freeTextValue = typeof storedFreeTextValue === "string"
? storedFreeTextValue.trim()
: ""
const customAnswer = freeTextValue.length > 0 ? `Custom: ${freeTextValue}` : null
const answerSummaries = customAnswer
Expand Down