Skip to content

Commit

Permalink
fix: improve UIs
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Sep 17, 2024
1 parent d4a64b9 commit c8e2769
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATABASE_URL="file:./mount/prod.sqlite3?connection_limit=1"

NEXT_PUBLIC_BASE_URL="http://localhost:8080"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"prepare": "husky || true",
"prettify": "prettier --cache --color --write \"**/{.*/,}*.{cjs,css,cts,htm,html,js,json,json5,jsonc,jsx,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}\" \"!**/test-fixtures/**\"",
"start": "wb start",
"start-prod": "wb start --mode staging",
"start-stg": "wb start --mode staging",
"test": "wb test",
"test/ci-setup": "wb prisma reset",
"typecheck": "wb typecheck"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const CheckpointProblem: React.FC<CheckpointProblemProps> = ({
</VStack>
<VStack align="center">
<Box textAlign="center" w="100%">
赤線で囲われた時点の実行結果
赤線で囲われた行の実行後の結果(注意:実行前ではなく実行後!)
</Box>
<Box>
<TurtleGraphics
Expand All @@ -135,18 +135,20 @@ export const CheckpointProblem: React.FC<CheckpointProblemProps> = ({
/>
</Box>
</VStack>
<VStack>
<Box>青色のハイライト時点の実行結果</Box>
<Box>
<TurtleGraphics
ref={turtleGraphicsRef}
beforeTraceItem={beforeCheckpointTraceItem}
currentTraceItem={currentCheckpointTraceItem}
isEnableOperation={false}
problem={problem}
/>
</Box>
</VStack>
{problem.sidToLineIndex.get(beforeCheckpointTraceItem.sid) && (
<VStack>
<Box>青色のハイライト行の実行後の結果(注意:実行前ではなく実行後!)</Box>
<Box>
<TurtleGraphics
ref={turtleGraphicsRef}
beforeTraceItem={beforeCheckpointTraceItem}
currentTraceItem={currentCheckpointTraceItem}
isEnableOperation={false}
problem={problem}
/>
</Box>
</VStack>
)}
</VStack>
<VStack align="end" minW="50%" overflow="hidden">
<HStack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const StepProblem: React.FC<StepProblemProps> = ({
</VStack>
<VStack align="center">
<Box textAlign="center" w="100%">
赤線で囲われた時点の実行結果
赤線で囲われた行の実行後の結果(注意:実行前ではなく実行後!)
</Box>
<Box>
<TurtleGraphics
Expand All @@ -123,18 +123,20 @@ export const StepProblem: React.FC<StepProblemProps> = ({
/>
</Box>
</VStack>
<VStack>
<Box>青色のハイライト時点の実行結果</Box>
<Box>
<TurtleGraphics
ref={turtleGraphicsRef}
beforeTraceItem={beforeCheckpointTraceItem}
currentTraceItem={currentCheckpointTraceItem}
isEnableOperation={false}
problem={problem}
/>
</Box>
</VStack>
{problem.sidToLineIndex.get(beforeCheckpointTraceItem.sid) && (
<VStack>
<Box>青色のハイライト行の実行後の結果(注意:実行前ではなく実行後!)</Box>
<Box>
<TurtleGraphics
ref={turtleGraphicsRef}
beforeTraceItem={beforeCheckpointTraceItem}
currentTraceItem={currentCheckpointTraceItem}
isEnableOperation={false}
problem={problem}
/>
</Box>
</VStack>
)}
</VStack>
<VStack align="end" minW="50%" overflow="hidden">
<HStack>
Expand Down
2 changes: 2 additions & 0 deletions src/app/(withAuth)/courses/[courseId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const CoursePage: NextPage<{ params: { courseId: CourseId } }> = async ({ params
const courseId = params.courseId;
const userCompletedProblems = await fetchUserCompletedProblems(user.id, courseId);
const userProblemSessions = await fetchUserProblemSessionsWithUserAnswer(user.id);
console.log('userCompletedProblems:', userCompletedProblems);
console.log('userProblemSessions:', userProblemSessions);

return (
<Course
Expand Down
5 changes: 5 additions & 0 deletions src/infrastructures/trpcBackend/routers/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { revalidatePath } from 'next/cache';
import { z } from 'zod';

import { upsertUserProblemSession } from '../../../utils/upsertUserProblemSession';
Expand Down Expand Up @@ -67,6 +68,8 @@ export const backendRouter = router({
},
data,
});
revalidatePath('/courses', 'layout');
console.log('revalidatePath()');
return userProblemSession;
}),
createUserCompletedProblem: procedure
Expand All @@ -88,6 +91,8 @@ export const backendRouter = router({
languageId: input.languageId,
},
});
revalidatePath('/courses', 'layout');
console.log('revalidatePath()');
}),
createUserAnswer: procedure
.use(authorize)
Expand Down

0 comments on commit c8e2769

Please sign in to comment.