Skip to content

Commit a869d76

Browse files
committed
Text tweak
1 parent 3385411 commit a869d76

File tree

1 file changed

+28
-1
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug_.projects.new

1 file changed

+28
-1
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug_.projects.new/route.tsx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import {
3838
import { generateVercelOAuthState } from "~/v3/vercel/vercelOAuthState.server";
3939

4040
const WORKING_ON_OTHER = "Other/not sure yet";
41+
const GOALS_OTHER = "Other/not sure yet";
4142

4243
const workingOnOptions = [
4344
"AI agent",
@@ -55,6 +56,7 @@ const goalOptions = [
5556
"Migrate an existing system",
5657
"Learn how Trigger works",
5758
"Evaluate against alternatives",
59+
GOALS_OTHER,
5860
] as const;
5961

6062
function shuffleArray<T>(arr: T[]): T[] {
@@ -166,6 +168,7 @@ const schema = z.object({
166168
technologies: z.string().optional(),
167169
technologiesOther: z.string().optional(),
168170
goals: z.string().optional(),
171+
goalsOther: z.string().optional(),
169172
});
170173

171174
export const action: ActionFunction = async ({ request, params }) => {
@@ -215,6 +218,10 @@ export const action: ActionFunction = async ({ request, params }) => {
215218
const goals = safeParseStringArray(submission.value.goals);
216219
if (goals) onboardingData.goals = goals;
217220

221+
if (submission.value.goalsOther) {
222+
onboardingData.goalsOther = submission.value.goalsOther;
223+
}
224+
218225
try {
219226
const project = await createProject({
220227
organizationSlug: organizationSlug,
@@ -314,15 +321,21 @@ export default function Page() {
314321
const [selectedTechnologies, setSelectedTechnologies] = useState<string[]>([]);
315322
const [customTechnologies, setCustomTechnologies] = useState<string[]>([]);
316323
const [selectedGoals, setSelectedGoals] = useState<string[]>([]);
324+
const [goalsOther, setGoalsOther] = useState("");
317325

318326
const [shuffledWorkingOn, setShuffledWorkingOn] = useState<string[]>([...workingOnOptions]);
327+
const [shuffledGoals, setShuffledGoals] = useState<string[]>([...goalOptions]);
319328

320329
useEffect(() => {
321330
const nonOther = workingOnOptions.filter((o) => o !== WORKING_ON_OTHER);
322331
setShuffledWorkingOn([...shuffleArray(nonOther), WORKING_ON_OTHER]);
332+
333+
const nonOtherGoals = goalOptions.filter((o) => o !== GOALS_OTHER);
334+
setShuffledGoals([...shuffleArray(nonOtherGoals), GOALS_OTHER]);
323335
}, []);
324336

325337
const showWorkingOnOther = selectedWorkingOn.includes(WORKING_ON_OTHER);
338+
const showGoalsOther = selectedGoals.includes(GOALS_OTHER);
326339

327340
return (
328341
<AppContainer className="bg-charcoal-900">
@@ -411,9 +424,23 @@ export default function Page() {
411424
<MultiSelectField
412425
value={selectedGoals}
413426
setValue={setSelectedGoals}
414-
items={[...goalOptions]}
427+
items={shuffledGoals}
415428
icon={<CommandLineIcon className="mr-1 size-4 text-text-dimmed" />}
416429
/>
430+
{showGoalsOther && (
431+
<>
432+
<input type="hidden" name="goalsOther" value={goalsOther} />
433+
<Input
434+
type="text"
435+
variant="small"
436+
value={goalsOther}
437+
onChange={(e) => setGoalsOther(e.target.value)}
438+
placeholder="Tell us what you're trying to do with Trigger.dev"
439+
spellCheck={false}
440+
containerClassName="h-8"
441+
/>
442+
</>
443+
)}
417444
</InputGroup>
418445

419446
<FormButtons

0 commit comments

Comments
 (0)