Skip to content

Conversation

@kotelyakvatwit
Copy link

@kotelyakvatwit kotelyakvatwit commented Dec 29, 2025

I guess working version, send me ideas on design as well as pictures …
Jasper, don't be lazy

Copilot AI review requested due to automatic review settings December 29, 2025 17:46
@jaspermayone
Copy link
Member

ah its volo

@kotelyakvatwit
Copy link
Author

I will add working google docs sync once this is approved and I get access to the gmail account that you guys want to use

@jaspermayone
Copy link
Member

@kotelyakvatwit there's assets in the discord channel in a folder

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a registration form for what appears to be a hackathon event. The implementation includes a Svelte frontend with form validation, a backend API endpoint for handling submissions, and supporting validation logic. The PR also adds three decorative images displayed alongside form sections and updates package dependencies.

Key Changes:

  • New registration form with personal info, school, major, food allergies, t-shirt size, and project idea fields
  • Client and server-side validation for form submissions
  • API endpoints for submitting and viewing registrations
  • Three images added via Git LFS for visual enhancement

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/routes/register/+page.svelte New registration form component with multi-section layout, real-time validation, and word count tracking
src/routes/api/register/+server.ts API endpoints for handling registration POST requests and GET requests to view submissions
src/lib/registration.ts Validation logic and type definitions for registration form data
static/images/hack-identity.png Decorative image for identity section (Git LFS)
static/images/hack-school.png Decorative image for school section (Git LFS)
static/images/hack-food.png Decorative image for food preferences section (Git LFS)
package-lock.json Dependency updates removing "peer: true" flags from several packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

projectWordCount = countWords(form.projectIdea);
projectTooLong = projectWordCount > MAX_WORDS;

console.log(`Project idea word count: ${projectWordCount}`);
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console.log statement should be removed before production. Debug logging statements should not be left in production code as they can clutter the console and potentially expose implementation details.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +8
const submissions: any[] = [];

export const POST: RequestHandler = async ({ request }) => {
let body: any;
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'any' type removes type safety. Consider creating a proper type for the submission object or using 'unknown' with proper type guards. This would help catch potential type-related bugs at compile time.

Suggested change
const submissions: any[] = [];
export const POST: RequestHandler = async ({ request }) => {
let body: any;
type RegistrationData = ReturnType<typeof validateRegistration> extends { ok: true; data: infer D }
? D
: never;
type Submission = RegistrationData & {
id: string;
createdAt: string;
};
const submissions: Submission[] = [];
export const POST: RequestHandler = async ({ request }) => {
let body: unknown;

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only valid thing, but we r in web. Types here are basically non existent u little piece of scrap

Comment on lines +50 to +52
if (typeof payload?.email === "string" && !/^\S+@\S+\.\S+$/.test(payload.email)) {
errors.email = "Invalid email";
}
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The email validation regex is overly simplistic and will accept many invalid email addresses (e.g., "a@b.c" or emails with invalid characters). Consider using a more robust email validation pattern or a dedicated email validation library to ensure proper email format validation.

Copilot uses AI. Check for mistakes.
$effect(() => {
if (form.school === "__OTHER__") {
otherSelected = true;
}else if (schools.includes(form.school)) {
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after the closing brace before 'else'. The code should be formatted as '} else if' instead of '}else if' for better readability and consistency with standard JavaScript/TypeScript formatting conventions.

Suggested change
}else if (schools.includes(form.school)) {
} else if (schools.includes(form.school)) {

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bro, fr.... Stop hallucinating random functions before commenting on my formatting

Comment on lines +122 to +143
alert(
"There are some errors with your submission:\n\n" +
Object.values(result.errors).join("\n")
);
return;
}

const res = await fetch("/api/register", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(form)
});

const data = await res.json().catch(() => null);

if (!res.ok) {
console.error("Server validation failed:", data);
alert("Submit failed. Check console for validation errors.");
return;
}

alert(`Submitted! id = ${data.id}`);
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using alert() for displaying validation errors and submission feedback provides a poor user experience. Consider implementing inline error messages or a more modern notification system (e.g., toast notifications) that doesn't block the UI.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the thing is.... IT SHOULD BE IMPOSSIBLE TO GET TO THAT ALERT... so yes, no UX affected

image: { src: "/images/hack-identity.png", alt: "blabla1" }
},
{
image: { src: "/images/hack-school.png", alt: "blabla2" }
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alt text "blabla2" is not descriptive. Alt text should meaningfully describe the image content for accessibility purposes. Consider using descriptive text like "School registration section illustration" or similar based on what the image actually depicts.

Suggested change
image: { src: "/images/hack-school.png", alt: "blabla2" }
image: { src: "/images/hack-school.png", alt: "School registration section illustration" }

Copilot uses AI. Check for mistakes.
image: { src: "/images/hack-school.png", alt: "blabla2" }
},
{
image: { src: "/images/hack-food.png", alt: "blabla3" }
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alt text "blabla3" is not descriptive. Alt text should meaningfully describe the image content for accessibility purposes. Consider using descriptive text like "Food preferences section illustration" or similar based on what the image actually depicts.

Suggested change
image: { src: "/images/hack-food.png", alt: "blabla3" }
image: { src: "/images/hack-food.png", alt: "Food preferences section illustration" }

Copilot uses AI. Check for mistakes.
schools = [];
} finally {
schoolsLoading = false;
console.log("Finished loading schools.");
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console.log statement should be removed before production. Debug logging statements should not be left in production code.

Copilot uses AI. Check for mistakes.
Comment on lines +138 to +139
console.error("Server validation failed:", data);
alert("Submit failed. Check console for validation errors.");
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console.error statement should be removed or replaced with proper error handling before production. Consider using a proper logging service or error reporting mechanism instead of console logging in production code.

Suggested change
console.error("Server validation failed:", data);
alert("Submit failed. Check console for validation errors.");
alert(
`Submit failed. ${data?.message ?? "Server validation failed. Please review your input and try again."}`
);

Copilot uses AI. Check for mistakes.
import { json } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";
import { validateRegistration } from "$lib/registration";

Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing submissions in an in-memory array will lose all data when the server restarts. This is not suitable for production use. Consider implementing persistent storage using a database or file system, or at minimum, add a comment documenting that this is temporary/for development only.

Suggested change
// NOTE: In-memory store for development/debugging only. Not suitable for production.
// In production, replace this with persistent storage (e.g., database or filesystem).

Copilot uses AI. Check for mistakes.
@miretskyd miretskyd changed the title I guess working version, send me ideas on design as well as pictures … Registration page Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants