From 27f509ccf4fbfeaa1bc2580ae2251461dc44ebfa Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 6 Mar 2026 02:16:59 +0900 Subject: feat(frontend): remove standalone submissions page Submission history is now shown inline on the play screen, making the dedicated /golf/:gameId/submissions page redundant. --- frontend/app/App.tsx | 8 -- frontend/app/pages/DashboardPage.tsx | 5 -- frontend/app/pages/SubmissionsPage.test.tsx | 17 ---- frontend/app/pages/SubmissionsPage.tsx | 126 ---------------------------- 4 files changed, 156 deletions(-) delete mode 100644 frontend/app/pages/SubmissionsPage.test.tsx delete mode 100644 frontend/app/pages/SubmissionsPage.tsx diff --git a/frontend/app/App.tsx b/frontend/app/App.tsx index 31adc28..762dab6 100644 --- a/frontend/app/App.tsx +++ b/frontend/app/App.tsx @@ -8,7 +8,6 @@ import GolfProblemPreviewPage from "./pages/GolfProblemPreviewPage"; import GolfWatchPage from "./pages/GolfWatchPage"; import IndexPage from "./pages/IndexPage"; import LoginPage from "./pages/LoginPage"; -import SubmissionsPage from "./pages/SubmissionsPage"; import TournamentPage from "./pages/TournamentPage"; export default function App() { @@ -42,13 +41,6 @@ export default function App() { )} - - {(params) => ( - - - - )} - {(params) => } diff --git a/frontend/app/pages/DashboardPage.tsx b/frontend/app/pages/DashboardPage.tsx index 8f40f22..54bfdd6 100644 --- a/frontend/app/pages/DashboardPage.tsx +++ b/frontend/app/pages/DashboardPage.tsx @@ -87,11 +87,6 @@ export default function DashboardPage() { 観戦 - {isLoggedIn && ( - - 提出履歴 - - )} ))} diff --git a/frontend/app/pages/SubmissionsPage.test.tsx b/frontend/app/pages/SubmissionsPage.test.tsx deleted file mode 100644 index f01f4c9..0000000 --- a/frontend/app/pages/SubmissionsPage.test.tsx +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @vitest-environment jsdom - */ -import { cleanup, render, screen } from "@testing-library/react"; -import { afterEach, describe, expect, test } from "vitest"; -import SubmissionsPage from "./SubmissionsPage"; - -afterEach(() => { - cleanup(); -}); - -describe("SubmissionsPage", () => { - test("shows loading state initially", () => { - render(); - expect(screen.getByText("Loading...")).toBeDefined(); - }); -}); diff --git a/frontend/app/pages/SubmissionsPage.tsx b/frontend/app/pages/SubmissionsPage.tsx deleted file mode 100644 index 1f55aa8..0000000 --- a/frontend/app/pages/SubmissionsPage.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import { useEffect, useState } from "react"; -import { createApiClient } from "../api/client"; -import type { components } from "../api/schema"; -import BorderedContainerWithCaption from "../components/BorderedContainerWithCaption"; -import NavigateLink from "../components/NavigateLink"; -import SubmitStatusLabel from "../components/SubmitStatusLabel"; -import { APP_NAME } from "../config"; -import { usePageTitle } from "../hooks/usePageTitle"; - -type Submission = components["schemas"]["Submission"]; - -export default function SubmissionsPage({ gameId }: { gameId: string }) { - usePageTitle(`Submissions | ${APP_NAME}`); - - const [submissions, setSubmissions] = useState([]); - const [loading, setLoading] = useState(true); - const [expandedId, setExpandedId] = useState(null); - - const numericGameId = Number(gameId); - - useEffect(() => { - const apiClient = createApiClient(); - apiClient - .getGamePlaySubmissions(numericGameId) - .then(({ submissions }) => setSubmissions(submissions)) - .catch(() => {}) - .finally(() => setLoading(false)); - }, [numericGameId]); - - if (loading) { - return ( -
-

Loading...

-
- ); - } - - return ( -
- -
- {submissions.length === 0 ? ( -

提出履歴はありません

- ) : ( -
    - {submissions.map((s) => ( -
  • -
    -
    - - - {s.code_size} - - bytes - - -
    -
    - - {formatDate(s.created_at)} - - -
    -
    - {expandedId === s.submission_id && ( -
    -											{s.code}
    -										
    - )} -
  • - ))} -
- )} -
-
- 対戦に戻る - ダッシュボードに戻る -
- ); -} - -function StatusBadge({ - status, -}: { - status: components["schemas"]["ExecutionStatus"]; -}) { - const colorClass = - status === "success" - ? "bg-green-100 text-green-800" - : status === "running" - ? "bg-yellow-100 text-yellow-800" - : status === "none" - ? "bg-gray-100 text-gray-800" - : "bg-red-100 text-red-800"; - - return ( - - - - ); -} - -function formatDate(unixTimestamp: number): string { - const date = new Date(unixTimestamp * 1000); - return date.toLocaleString("ja-JP", { - month: "2-digit", - day: "2-digit", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - }); -} -- cgit v1.3.1