Spaces:
Sleeping
Sleeping
Fix public challenge catalog and topbar actions
Browse filesFiles changed (4)
1132 unmodified lines11331134113511361137113811391140114111421143114411451146114711481149115011511132 unmodified linesmanifest["workspace_id"] = session.workspace_idsession.challenge_timer_minutes = timer_minutessession.chat_messages_per_student = payload.chat_messages_per_studentif payload.visibility == "public":try:transition_result = transition_challenge_round(str(manifest["round_id"]),_course_id(),actor,"open",)if not transition_result.get("updated"):raise ChallengeRoundStoreError("Public round could not be opened")except ChallengeRoundStoreError as exc:logger.warning("Public round could not be opened after publish: %s", type(exc).__name__)raise HTTPException(status_code=503, detail="Challenge was published but could not be opened") from excwith session.thread_lock:session.published_round = dict(manifest)_persist_challenge_progress(session)1132 unmodified lines1133113411351136113711381132 unmodified linesmanifest["workspace_id"] = session.workspace_idsession.challenge_timer_minutes = timer_minutessession.chat_messages_per_student = payload.chat_messages_per_studentwith session.thread_lock:session.published_round = dict(manifest)_persist_challenge_progress(session)
269 unmodified lines270271272273274275269 unmodified linesmocks.courseAccessRequests.mockResolvedValue({ requests: [{ request_id: "request-1", auth_provider: "google", provider_user_id: "student-1", display_name: "New instructor", reason: "I teach this course", requested_at: "2026-01-01T10:00:00Z" }] });render(<App />);const repositoryInput = await screen.findByRole("textbox", { name: /public github repository/i });expect((repositoryInput as HTMLInputElement).value).toBe("https://github.com/acme/approved");await user.clear(repositoryInput);269 unmodified lines270271272273274275276277278269 unmodified linesmocks.courseAccessRequests.mockResolvedValue({ requests: [{ request_id: "request-1", auth_provider: "google", provider_user_id: "student-1", display_name: "New instructor", reason: "I teach this course", requested_at: "2026-01-01T10:00:00Z" }] });render(<App />);expect(await screen.findByRole("button", { name: "Open public challenges" })).toBeTruthy();expect((await screen.findByRole("button", { name: "Instructor access requests" })).textContent).toContain("1");const repositoryInput = await screen.findByRole("textbox", { name: /public github repository/i });expect((repositoryInput as HTMLInputElement).value).toBe("https://github.com/acme/approved");await user.clear(repositoryInput);
30 unmodified lines313233343536147 unmodified lines184185186187188189190191192798 unmodified lines99199299399499599699730 unmodified linesUpload,Undo2,UserPlus,XCircle,} from "lucide-react";import { api, waitForChallenge, waitForJob } from "./api";147 unmodified linesif (nextSession.authenticated && nextSession.role === "instructor" && !nextSession.workspace_id) {void handleLoadInstructorDashboard();}if (nextSession.authenticated && !nextSession.workspace_id) {void loadStudentHistorySummary();void handleLoadPublicChallenges();}if (nextSession.submission_locked && nextSession.last_submission_result) {setSubmission(nextSession.last_submission_result);798 unmodified lines<header className="topbar"><div className="brand-lockup"><span className="brand-mark"><Code2 size={18} /></span><span>FIELDNOTES <i>/ CODE LAB</i></span></div><div className="topbar-context"><span>DEBUGGING WORKSHOP</span>{challenge && <><ChevronRight size={14} /><span className="context-repo">{challenge.repo_url.split("/").slice(-1)[0]}</span></>}</div><div className="user-menu"><span className="user-avatar">{(identity.display_name || identity.username).charAt(0).toUpperCase()}</span><span className="user-name">{identity.display_name || identity.username}</span><button className="icon-button" onClick={() => void handleLoadHistory()} aria-label="Challenge history" title="Challenge history"><History size={17} /></button><button className="icon-button" onClick={() => void handleLogout()} aria-label="Sign out" title="Sign out"><LogOut size={17} /></button></div></header>{error && <div className="global-notice notice-error" role="alert"><AlertCircle size={17} />{error}<button className="notice-dismiss" onClick={() => setError("")} aria-label="Dismiss"><XCircle size={16} /></button></div>}30 unmodified lines31323334353637147 unmodified lines185186187188189190191192193194195798 unmodified lines994995996997998999100030 unmodified linesUpload,Undo2,UserPlus,Globe2,XCircle,} from "lucide-react";import { api, waitForChallenge, waitForJob } from "./api";147 unmodified linesif (nextSession.authenticated && nextSession.role === "instructor" && !nextSession.workspace_id) {void handleLoadInstructorDashboard();}if (nextSession.authenticated) {void handleLoadPublicChallenges();}if (nextSession.authenticated && !nextSession.workspace_id) {void loadStudentHistorySummary();}if (nextSession.submission_locked && nextSession.last_submission_result) {setSubmission(nextSession.last_submission_result);798 unmodified lines<header className="topbar"><div className="brand-lockup"><span className="brand-mark"><Code2 size={18} /></span><span>FIELDNOTES <i>/ CODE LAB</i></span></div><div className="topbar-context"><span>DEBUGGING WORKSHOP</span>{challenge && <><ChevronRight size={14} /><span className="context-repo">{challenge.repo_url.split("/").slice(-1)[0]}</span></>}</div><div className="user-menu"><button className="icon-button topbar-badge-button" onClick={() => { setPage("setup"); void handleLoadPublicChallenges(); }} aria-label="Open public challenges" title="Public challenges"><Globe2 size={17} /></button>{session.is_course_admin && <button className="icon-button topbar-badge-button" onClick={() => { setPage("setup"); void handleLoadCourseAccess(); }} aria-label="Instructor access requests" title="Instructor access requests"><UserPlus size={17} />{courseAccessRequests.length > 0 && <span className="topbar-badge">{courseAccessRequests.length}</span>}</button>}<span className="user-avatar">{(identity.display_name || identity.username).charAt(0).toUpperCase()}</span><span className="user-name">{identity.display_name || identity.username}</span><button className="icon-button" onClick={() => void handleLoadHistory()} aria-label="Challenge history" title="Challenge history"><History size={17} /></button><button className="icon-button" onClick={() => void handleLogout()} aria-label="Sign out" title="Sign out"><LogOut size={17} /></button></div></header>{error && <div className="global-notice notice-error" role="alert"><AlertCircle size={17} />{error}<button className="notice-dismiss" onClick={() => setError("")} aria-label="Dismiss"><XCircle size={16} /></button></div>}
96 unmodified lines97989910010110296 unmodified lines.user-name { max-width: 150px; overflow: hidden; color: #4a5a68; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid transparent; border-radius: 6px; color: #617282; background: transparent; }.icon-button:hover { border-color: var(--line); color: var(--coral); background: #fff; }.global-notice { position: fixed; z-index: 30; top: 70px; right: 24px; left: 24px; max-width: 850px; margin: auto; box-shadow: 0 6px 24px #17243618; }.keyless-notice { display: grid; width: min(calc(100% - 48px), 1480px); max-width: 1480px; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; margin: 14px auto; padding: 14px 16px; box-shadow: 0 4px 16px #1724360d; }.keyless-notice-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #e8cf98; border-radius: 8px; color: #885d1b; background: #fff8e9; }96 unmodified lines97989910010110210310496 unmodified lines.user-name { max-width: 150px; overflow: hidden; color: #4a5a68; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.icon-button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid transparent; border-radius: 6px; color: #617282; background: transparent; }.icon-button:hover { border-color: var(--line); color: var(--coral); background: #fff; }.topbar-badge-button { position: relative; }.topbar-badge { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 999px; padding: 0 3px; color: #fff; background: var(--coral); font-size: 9px; font-weight: 700; line-height: 1; }.global-notice { position: fixed; z-index: 30; top: 70px; right: 24px; left: 24px; max-width: 850px; margin: auto; box-shadow: 0 6px 24px #17243618; }.keyless-notice { display: grid; width: min(calc(100% - 48px), 1480px); max-width: 1480px; align-items: center; grid-template-columns: auto minmax(0, 1fr) auto; gap: 13px; margin: 14px auto; padding: 14px 16px; box-shadow: 0 4px 16px #1724360d; }.keyless-notice-icon { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #e8cf98; border-radius: 8px; color: #885d1b; background: #fff8e9; }
backend/app.py-13
frontend/src/App.test.tsx+3
frontend/src/App.tsx+5-2
frontend/src/styles.css+2