Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6230072
fix: remove duplicate entry-code API call
chanwook01 May 4, 2026
ae41c9c
Merge pull request #28 from VibeCodeEval/fix/entry-code-duplicate
chanwook01 May 4, 2026
3a465ee
fix: gitignore fixed
chanwook01 May 8, 2026
4534659
fix: restore exam session after refresh
chanwook01 May 8, 2026
e98c6da
Merge pull request #29 from VibeCodeEval/fix/session-refresh-recovery
chanwook01 May 9, 2026
08fe26a
fix: improve assignment loading display
chanwook01 May 9, 2026
6cd3bce
Merge pull request #30 from VibeCodeEval/assignment-fix-chanwook
chanwook01 May 11, 2026
00a6443
fix: improve active-session and assignment recovery handling
chanwook01 May 11, 2026
f0c6cd5
관리자 평가 상세 화면 API 연동 및 Mock 제거
chanwook01 May 14, 2026
a713b2a
관리자 평가 상세 화면 제출 코드 및 루브릭 표시
chanwook01 May 14, 2026
812f838
응시자 제출 스트림 연결 및 SSE cleanup 개선
chanwook01 May 14, 2026
f2b6bf3
관리자 참가자 평가 상세 화면 개선
chanwook01 May 17, 2026
c7c3e8d
fix: resolve copilot review issues and improve runtime safety
chanwook01 May 17, 2026
6a8e630
fix: resolve copilot review issues for session recovery flow
chanwook01 May 17, 2026
da92bbb
세션 복구 participantId 구조 분리 및 AI Assistant 수정
chanwook01 May 18, 2026
b72b091
Merge pull request #32 from VibeCodeEval/fix/session-recovery-stability
chanwook01 May 18, 2026
ed9af6b
Merge pull request #33 from VibeCodeEval/feature/admin-result-api-int…
chanwook01 May 18, 2026
9d899d2
관리자 분석 및 참가자 관리 UI 개선
chanwook01 May 18, 2026
0c47bd8
Merge pull request #34 from VibeCodeEval/feature/admin-users-api-inte…
chanwook01 May 19, 2026
7a29396
관리자 계정 관리 화면 및 설정 UI 연동 개선
chanwook01 May 20, 2026
f5cbe53
마스터 테스트 세션 및 관리자 표시 로직 개선
chanwook01 May 21, 2026
f949ae1
운영 UI 정리 및 Copilot 리뷰 반영
chanwook01 May 21, 2026
d56cb55
Merge pull request #35 from VibeCodeEval/feature/master-ui-layout-ref…
chanwook01 May 22, 2026
33be42f
Merge pull request #36 from VibeCodeEval/chanwook
ydking0911 May 22, 2026
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
9 changes: 9 additions & 0 deletions app/admin-login/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import LoginCard from "@/components/login-card"

export default function AdminLoginPage() {
return (
<main className="min-h-screen w-full flex items-center justify-center bg-muted/40 py-16 md:py-24">
<LoginCard />
</main>
)
}
4 changes: 1 addition & 3 deletions app/admin-signup/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"use client";

import AdminSignupForm from "@/components/admin-signup-form";

export default function AdminSignupPage() {
return (
<main className="min-h-screen bg-[#F5F5F5] flex items-center justify-center py-16">
<main className="flex min-h-screen items-center justify-center bg-[#F5F5F5] px-4 py-16">
<AdminSignupForm />
</main>
);
Expand Down
14 changes: 7 additions & 7 deletions app/admin/results/[entryCode]/[participantId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default function ParticipantEvaluationPage() {
const searchParams = useSearchParams();
const from = searchParams.get("from");
const sessionId = searchParams.get("sessionId");
const participantName = searchParams.get("participantName") ?? undefined;

const decodedEntryCode = decodeURIComponent(entryCode);

Expand All @@ -36,12 +37,11 @@ export default function ParticipantEvaluationPage() {
};

return (
<main className="mt-[0px] min-h-[calc(100vh-80px)] overflow-y-auto py-6 px-8">
<ParticipantEvaluationContent
entryCode={decodedEntryCode}
participantId={String(participantId)}
onBack={handleBack}
/>
</main>
<ParticipantEvaluationContent
entryCode={decodedEntryCode}
participantId={String(participantId)}
participantName={participantName}
onBack={handleBack}
/>
);
}
22 changes: 11 additions & 11 deletions app/admin/results/[entryCode]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
// app/admin/results/[entryCode]/page.tsx
// Next.js 15+ / 16: 동적 라우트의 params는 Promise — 반드시 await 후 사용

import { ParticipantListContent } from "@/components/participant-list-content";

type ResultParticipantsPageProps = {
params: {
entryCode: string;
};
params: Promise<{ entryCode: string }>;
};

// ⚠️ 맨 위에 "use client" 가 있었다면 삭제해주세요.
// 이 파일은 서버 컴포넌트로 두는게 편합니다.

export default function ResultParticipantsPage({
export default async function ResultParticipantsPage({
params,
}: ResultParticipantsPageProps) {
// Next.js 동적 세그먼트에서 받은 값
const rawEntryCode = params?.entryCode ?? "";
const { entryCode: rawEntryCode } = await params;
const safe = rawEntryCode ?? "";
let decodedEntryCode = safe;

// 혹시 인코딩 되어 있을 수 있으니 decode
const decodedEntryCode = decodeURIComponent(rawEntryCode);
try {
decodedEntryCode = decodeURIComponent(safe);
} catch {
decodedEntryCode = safe;
}

return <ParticipantListContent entryCode={decodedEntryCode} />;
}
37 changes: 14 additions & 23 deletions app/master/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import type React from "react"
import type { ReactNode } from "react";
import type { ReactNode } from "react"
import type { Metadata } from "next"
import { Geist, Geist_Mono } from "next/font/google"
import { Analytics } from "@vercel/analytics/next"
import "../globals.css"
import { Sidebar } from "@/components/sidebar";
import { TopNavBar } from "@/components/top-nav-bar";
import { Sidebar } from "@/components/sidebar"

const _geist = Geist({ subsets: ["latin"] })
const _geistMono = Geist_Mono({ subsets: ["latin"] })

// <CHANGE> Updated metadata for Master Dashboard
export const metadata: Metadata = {
title: "Master Dashboard - AI Vibe Coding Test",
description: "Admin dashboard for AI Vibe Coding Test platform",
Expand All @@ -34,23 +25,23 @@ export const metadata: Metadata = {
},
}

export default function RootLayout({
export default function MasterLayout({
children,
}: Readonly<{
children: React.ReactNode
children: ReactNode
}>) {
return (
<div className="flex min-h-screen bg-[#F5F5F5]">
{/* 왼쪽 고정 사이드바 */}
<Sidebar />
<div className="flex h-screen w-full overflow-hidden" style={{ maxWidth: "1920px" }}>
<div className="fixed left-0 top-0 z-30 h-screen" style={{ width: "240px" }}>
<Sidebar />
</div>

{/* 오른쪽 영역(상단바 + 페이지 내용) */}
<div className="flex-1 ml-[0px] flex flex-col">
<TopNavBar />
<main className="mt-[0px] min-h-[calc(100vh-80px)] overflow-y-auto">
{children}
</main>
<div
className="ml-[240px] flex h-screen flex-1 flex-col"
style={{ backgroundColor: "#F9FAFB" }}
>
<main className="flex-1 overflow-y-auto">{children}</main>
</div>
</div>
);
)
}
35 changes: 12 additions & 23 deletions app/master/test-sessions/[ID]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
"use client";
"use client"

import { useRouter, useParams } from "next/navigation";
import TestSessionDetailsContent from "@/components/test-session-details-content";
import { useParams, useRouter } from "next/navigation"
import TestSessionDetailsContent from "@/components/test-session-details-content"
import { parseExamIdParam } from "@/lib/master-test-sessions"

export default function Page() {
const router = useRouter();
const params = useParams<{ id: string }>();
const sessionId = params?.id;

// 임시 더미 데이터 (나중에 실제 API 연동 시 여기만 교체)
const session = {
id: Number(sessionId),
sessionId: `SESSION-${sessionId}`, // ➜ Session ID
createdBy: "Master Admin", // ➜ Created By
createdAt: "2025-12-05 10:00", // ➜ Created At
status: "Completed", // ➜ Status (Active / Completed 등)
participants: 48, // ➜ Participants
};
const router = useRouter()
const params = useParams<{ ID?: string; id?: string }>()
const examId = parseExamIdParam(params?.ID ?? params?.id)

return (
<main className="mt-[0px] min-h-[calc(100vh-80px)] overflow-y-auto py-6 px-8">
<TestSessionDetailsContent
session={session}
onBack={() => router.push("/master/test-sessions")}
/>
</main>
);
<TestSessionDetailsContent
examId={examId}
onBack={() => router.push("/master/test-sessions")}
/>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"use client"

import { useParams, useRouter, useSearchParams } from "next/navigation"
import { ParticipantEvaluationContent } from "@/components/participant-evaluation-content"
import { parseExamIdParam } from "@/lib/master-test-sessions"

export default function MasterParticipantEvaluationPage() {
const router = useRouter()
const params = useParams<{ ID?: string; id?: string; participantId: string }>()
const searchParams = useSearchParams()

const examId = parseExamIdParam(params?.ID ?? params?.id)
const participantId = String(params?.participantId ?? "")
const participantName = searchParams.get("participantName") ?? undefined

const handleBack = () => {
if (examId != null) {
router.push(`/master/test-sessions/${examId}`)
} else {
router.push("/master/test-sessions")
}
}

if (examId == null || !participantId.trim()) {
return (
<div className="flex flex-1 items-center justify-center p-8">
<p className="text-sm text-[#6B7280]">세션 또는 참가자 정보를 찾을 수 없습니다.</p>
</div>
)
}

return (
<ParticipantEvaluationContent
examId={examId}
participantId={participantId}
participantName={participantName}
backLabel="테스트 세션 상세로 돌아가기"
onBack={handleBack}
/>
)
}
107 changes: 107 additions & 0 deletions app/test/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,114 @@
"use client";

import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import UserTestScreen from "@/components/user-test-screen"
import { useExamSessionStore } from "@/lib/stores/exam-session-store";
import { getActiveSession, getActiveSessionByExam } from "@/lib/api/exams";

export default function TestPage() {
const router = useRouter();
const [isRestoring, setIsRestoring] = useState(true);
const [restoreError, setRestoreError] = useState<string | null>(null);
const examId = useExamSessionStore((state) => state.examId);
const participantId = useExamSessionStore((state) => state.participantId);

useEffect(() => {
let cancelled = false;
let redirectTimeoutId: ReturnType<typeof setTimeout> | undefined;

const scheduleRedirect = () => {
if (redirectTimeoutId !== undefined) {
clearTimeout(redirectTimeoutId);
}
redirectTimeoutId = setTimeout(() => {
if (!cancelled) {
router.replace("/");
}
}, 1200);
};

const restoreSession = async () => {
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms));

// 시험 시작 직후(관리자 start 직후)에는 서버가 아직 "RUNNING/active-session"으로
// 판단되기 전에 FE가 먼저 조회할 수 있어 404(NO_ACTIVE_SESSION)가 일시적으로 발생할 수 있다.
// 이 경우 즉시 entry로 튕기지 말고 짧게 재시도 후 실패 시에만 리다이렉트한다.
const maxAttempts = 6; // 총 5~6초 내 재시도
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
if (cancelled) return;

try {
const currentExamId = useExamSessionStore.getState().examId;
const activeSession = currentExamId
? await getActiveSessionByExam(currentExamId)
: await getActiveSession();
if (cancelled) return;

if (activeSession) {
const current = useExamSessionStore.getState();
useExamSessionStore.setState({
examId: activeSession.examId,
participantId: activeSession.participantId ?? current.participantId,
examParticipantId: activeSession.examParticipantId,
tokenLimit: activeSession.tokenLimit,
});
return;
}

if (attempt === maxAttempts) {
setRestoreError("활성 시험 세션이 없습니다. 다시 입장해주세요.");
scheduleRedirect();
return;
}

await sleep(300 + attempt * 250);
if (cancelled) return;
} catch (error: any) {
if (cancelled) return;
// 인증 실패(쿠키 누락/만료)는 재시도해도 의미 없으므로 즉시 리다이렉트
if (error?.status === 401) {
setRestoreError("인증이 필요합니다. 다시 입장해주세요.");
scheduleRedirect();
return;
}

console.error("[TestPage] active session restore failed:", error);

if (attempt === maxAttempts) {
setRestoreError("세션 복구에 실패했습니다. 다시 입장해주세요.");
scheduleRedirect();
return;
}

await sleep(300 + attempt * 250);
if (cancelled) return;
}
}
};

void restoreSession().finally(() => {
if (!cancelled) setIsRestoring(false);
});
return () => {
cancelled = true;
if (redirectTimeoutId !== undefined) {
clearTimeout(redirectTimeoutId);
}
};
}, [router]);

if (isRestoring || !examId || !participantId) {
return (
<div className="min-h-screen w-full bg-[#F5F5F5] flex items-center justify-center">
<div className="text-center">
<p className="text-base font-medium text-[#1F2937]">
{restoreError ?? "시험 세션을 복구하는 중입니다..."}
</p>
</div>
</div>
);
}

return <UserTestScreen />
}
Loading
Loading