Skip to content

Setting up problem submissions#19

Open
admclamb wants to merge 2 commits into
mainfrom
admclamb/create-problem-submissions
Open

Setting up problem submissions#19
admclamb wants to merge 2 commits into
mainfrom
admclamb/create-problem-submissions

Conversation

@admclamb
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings March 10, 2026 04:14
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-aw-prod-01 Ready Ready Preview, Comment Mar 20, 2026 5:26am
web-aw-scrum-01 Ready Ready Preview, Comment Mar 20, 2026 5:26am

Copy link
Copy Markdown
Contributor

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

Adds initial scaffolding for a “problem submissions” page under the problems feature, mirroring the existing problem page pattern (server-side React Query prefetch + client-side sidebar layout).

Changes:

  • Introduces /problems/[slug]/submissions page that prefetches the problem by slug and hydrates React Query state.
  • Adds a client-side ProblemSubmissionsLayout using SidebarLayout breadcrumbs for the problem context.
  • Adds an (currently empty) problem-submissions-header.tsx placeholder file.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/features/problems/problem-submissions/problem-submissions-layout.tsx New client layout wrapper for submissions page with sidebar/breadcrumbs.
src/features/problems/problem-submissions/problem-submissions-header.tsx Empty placeholder file for a future submissions header component.
src/app/problems/[slug]/submissions/page.tsx New submissions route page that preloads problem data and renders the layout within a hydration boundary.

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

Comment on lines +7 to +15
type ProblemLayoutProps = {
problem: Problem;
accessToken?: string;
};

export default function ProblemSubmissionsLayout({
problem,
accessToken,
}: ProblemLayoutProps) {
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The props type name ProblemLayoutProps is misleading in this submissions-specific component. Consider renaming it to something submissions-specific (e.g., ProblemSubmissionsLayoutProps) to avoid confusion with the existing ProblemLayout component.

Copilot uses AI. Check for mistakes.
{
url: routerConfig.problem.execute({ slug: problem.slug }),
name: problem.title,
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The breadcrumbs array is missing the trailing comma after the last item; this repo’s Prettier config uses trailingComma: "es5", so formatting will get rewritten in CI. Please run Prettier or add the trailing comma here to keep the diff stable.

Suggested change
}
},

Copilot uses AI. Check for mistakes.
defaultOpen={false}

>
<h1>TESTING</h1>
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

<h1>TESTING</h1> looks like placeholder UI and will ship to users as-is. Please replace it with the intended submissions content (or remove until the feature is ready) before merging.

Suggested change
<h1>TESTING</h1>
{/* TODO: Implement problem submissions view */}

Copilot uses AI. Check for mistakes.
import { getProblemBySlugQueryOptions } from "@/features/problems/api/get-problem-by-slug";
import ProblemSubmissionsLayout from "@/features/problems/problem-submissions/problem-submissions-layout";
import { auth0 } from "@/lib/auth0";
import { dehydrate, HydrationBoundary, QueryClient } from "@tanstack/react-query"
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Missing semicolon at the end of this import; Prettier is configured with semi: true, so this will be auto-reformatted. Please run Prettier or add the semicolon to keep formatting consistent.

Suggested change
import { dehydrate, HydrationBoundary, QueryClient } from "@tanstack/react-query"
import { dehydrate, HydrationBoundary, QueryClient } from "@tanstack/react-query";

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +20
const preloadData = async (slug: string ) => {
const queryClient = new QueryClient();

await Promise.all([
queryClient.prefetchQuery(getProblemBySlugQueryOptions(slug)),
]);

const dehydratedState = dehydrate(queryClient);

return {
dehydratedState,
queryClient,
};
}

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The preloadData function block has formatting issues (extra space in slug: string )) and is missing the trailing semicolon after the function expression. With repo Prettier settings, this will be rewritten—please format it to match existing pages (e.g., src/app/problems/[slug]/page.tsx).

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +43
return (
<HydrationBoundary state={dehydratedState}>
<ProblemSubmissionsLayout problem={problem} accessToken={accessToken} />
</HydrationBoundary>
)
} No newline at end of file
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The component return at the end of the file is missing a terminating semicolon after the closing parenthesis. Prettier (semi: true) will change this; please align with the existing page implementations.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants