Skip to content

Commit c15dbc9

Browse files
committed
Small nit pick fixes from code rabbit
1 parent c82e500 commit c15dbc9

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed

apps/webapp/app/components/onboarding/TechnologyPicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ export function TechnologyPicker({
186186
<button
187187
type="button"
188188
onClick={() => removeItem(item)}
189+
aria-label={`Remove ${item}`}
189190
className="ml-0.5 flex items-center hover:text-white/70"
190191
>
191192
<XMarkIcon className="size-3.5" />
@@ -214,7 +215,6 @@ export function TechnologyPicker({
214215
>
215216
<Ariakit.Select
216217
className="group flex h-8 w-full items-center rounded bg-charcoal-750 pl-2 pr-2.5 text-sm text-text-dimmed ring-charcoal-600 transition focus-custom hover:bg-charcoal-650 hover:ring-1"
217-
onClick={() => setOpen(true)}
218218
>
219219
<div className="flex grow items-center">
220220
<CubeIcon className="mr-1.5 size-4 flex-none text-text-dimmed" />
@@ -280,7 +280,7 @@ export function TechnologyPicker({
280280
onChange={(e) => setOtherInputValue(e.target.value)}
281281
onKeyDown={handleOtherKeyDown}
282282
placeholder="Type and press Enter to add"
283-
className="pl-0.5can flex-1 border-none bg-transparent text-2sm text-text-bright shadow-none outline-none ring-0 placeholder:text-text-dimmed focus:border-none focus:outline-none focus:ring-0"
283+
className="pl-0.5 flex-1 border-none bg-transparent text-2sm text-text-bright shadow-none outline-none ring-0 placeholder:text-text-dimmed focus:border-none focus:outline-none focus:ring-0"
284284
autoFocus
285285
/>
286286
<ShortcutKey

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

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ import {
3737
} from "~/utils/pathBuilder";
3838
import { generateVercelOAuthState } from "~/v3/vercel/vercelOAuthState.server";
3939

40+
const WORKING_ON_OTHER = "Other/not sure yet";
41+
4042
const workingOnOptions = [
4143
"AI agent",
4244
"Media processing pipeline",
4345
"Media generation with AI",
4446
"Event-driven workflow",
4547
"Realtime streaming",
4648
"Internal tool or background job",
47-
"Other/not sure yet",
49+
WORKING_ON_OTHER,
4850
] as const;
4951

5052
const goalOptions = [
@@ -183,37 +185,40 @@ export const action: ActionFunction = async ({ request, params }) => {
183185
const configurationId = url.searchParams.get("configurationId");
184186
const next = url.searchParams.get("next");
185187

186-
const onboardingData: Record<string, Prisma.InputJsonValue> = {};
188+
try {
189+
const stringArraySchema = z.array(z.string());
190+
191+
const onboardingData: Record<string, Prisma.InputJsonValue> = {};
187192

188-
if (submission.value.workingOn) {
189-
const workingOn = JSON.parse(submission.value.workingOn) as string[];
190-
if (workingOn.length > 0) {
191-
onboardingData.workingOn = workingOn;
193+
if (submission.value.workingOn) {
194+
const workingOn = stringArraySchema.parse(JSON.parse(submission.value.workingOn));
195+
if (workingOn.length > 0) {
196+
onboardingData.workingOn = workingOn;
197+
}
192198
}
193-
}
194-
if (submission.value.workingOnOther) {
195-
onboardingData.workingOnOther = submission.value.workingOnOther;
196-
}
197-
if (submission.value.technologies) {
198-
const technologies = JSON.parse(submission.value.technologies) as string[];
199-
if (technologies.length > 0) {
200-
onboardingData.technologies = technologies;
199+
if (submission.value.workingOnOther) {
200+
onboardingData.workingOnOther = submission.value.workingOnOther;
201201
}
202-
}
203-
if (submission.value.technologiesOther) {
204-
const technologiesOther = JSON.parse(submission.value.technologiesOther) as string[];
205-
if (technologiesOther.length > 0) {
206-
onboardingData.technologiesOther = technologiesOther;
202+
if (submission.value.technologies) {
203+
const technologies = stringArraySchema.parse(JSON.parse(submission.value.technologies));
204+
if (technologies.length > 0) {
205+
onboardingData.technologies = technologies;
206+
}
207207
}
208-
}
209-
if (submission.value.goals) {
210-
const goals = JSON.parse(submission.value.goals) as string[];
211-
if (goals.length > 0) {
212-
onboardingData.goals = goals;
208+
if (submission.value.technologiesOther) {
209+
const technologiesOther = stringArraySchema.parse(
210+
JSON.parse(submission.value.technologiesOther)
211+
);
212+
if (technologiesOther.length > 0) {
213+
onboardingData.technologiesOther = technologiesOther;
214+
}
215+
}
216+
if (submission.value.goals) {
217+
const goals = stringArraySchema.parse(JSON.parse(submission.value.goals));
218+
if (goals.length > 0) {
219+
onboardingData.goals = goals;
220+
}
213221
}
214-
}
215-
216-
try {
217222
const project = await createProject({
218223
organizationSlug: organizationSlug,
219224
name: submission.value.projectName,
@@ -316,11 +321,11 @@ export default function Page() {
316321
const [shuffledWorkingOn, setShuffledWorkingOn] = useState<string[]>([...workingOnOptions]);
317322

318323
useEffect(() => {
319-
const nonOther = workingOnOptions.filter((o) => o !== "Other/not sure yet");
320-
setShuffledWorkingOn([...shuffleArray(nonOther), "Other/not sure yet"]);
324+
const nonOther = workingOnOptions.filter((o) => o !== WORKING_ON_OTHER);
325+
setShuffledWorkingOn([...shuffleArray(nonOther), WORKING_ON_OTHER]);
321326
}, []);
322327

323-
const showWorkingOnOther = selectedWorkingOn.includes("Other/not sure yet");
328+
const showWorkingOnOther = selectedWorkingOn.includes(WORKING_ON_OTHER);
324329

325330
return (
326331
<AppContainer className="bg-charcoal-900">

apps/webapp/app/routes/confirm-basic-details.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,9 @@ export default function Page() {
309309
<>
310310
<div className="border-t border-charcoal-700" />
311311
<InputGroup>
312-
<Label className="mb-0.5">How did you hear about us?</Label>
312+
<Label className="mb-0.5" id="referral-label">
313+
How did you hear about us?
314+
</Label>
313315
<input
314316
type="hidden"
315317
name="referralSource"
@@ -319,6 +321,7 @@ export default function Page() {
319321
value={selectedReferralSource}
320322
onValueChange={setSelectedReferralSource}
321323
className="flex flex-wrap gap-2"
324+
aria-labelledby="referral-label"
322325
>
323326
{shuffledReferralSources.map((option) => (
324327
<RadioGroupItem
@@ -343,12 +346,13 @@ export default function Page() {
343346
</InputGroup>
344347

345348
<InputGroup className="mt-1">
346-
<Label>What role fits you best?</Label>
349+
<Label id="role-label">What role fits you best?</Label>
347350
<input type="hidden" name="role" value={selectedRole} />
348351
<Select<string, string>
349352
value={selectedRole}
350353
setValue={setSelectedRole}
351354
placeholder="Select an option"
355+
aria-labelledby="role-label"
352356
variant="secondary/small"
353357
dropdownIcon
354358
icon={<UserGroupIcon className="mr-1 size-4.5 text-text-dimmed" />}

0 commit comments

Comments
 (0)