diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78f64f0e..b8510694 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,9 @@ on: push: branches: - "*" + pull_request: + branches: + - "*" workflow_dispatch: jobs: diff --git a/src/atoms/atoms.ts b/src/atoms/atoms.ts index c94be51b..1bdea6d0 100644 --- a/src/atoms/atoms.ts +++ b/src/atoms/atoms.ts @@ -179,8 +179,14 @@ function tabValue( } // Puzzles -export const hidePuzzleRatingAtom = atomWithStorage("hide-puzzle-rating", false); -export const progressivePuzzlesAtom = atomWithStorage("progressive-puzzles", false); +export const hidePuzzleRatingAtom = atomWithStorage( + "hide-puzzle-rating", + false, +); +export const progressivePuzzlesAtom = atomWithStorage( + "progressive-puzzles", + false, +); // Per tab settings diff --git a/src/components/common/ChallengeHistory.tsx b/src/components/common/ChallengeHistory.tsx index a1098211..029a68b0 100644 --- a/src/components/common/ChallengeHistory.tsx +++ b/src/components/common/ChallengeHistory.tsx @@ -1,9 +1,9 @@ +import { hidePuzzleRatingAtom } from "@/atoms/atoms"; import { Completion } from "@/utils/puzzles"; import { ActionIcon, Group, Stack, Text } from "@mantine/core"; import { IconCheck, IconDots, IconX } from "@tabler/icons-react"; -import { match } from "ts-pattern"; -import { hidePuzzleRatingAtom } from "@/atoms/atoms"; import { useAtomValue } from "jotai"; +import { match } from "ts-pattern"; type Challenge = { completion: Completion; @@ -19,7 +19,6 @@ function ChallengeHistory({ select: (i: number) => void; current: number; }) { - const hideRating = useAtomValue(hidePuzzleRatingAtom); return ( @@ -72,7 +71,7 @@ function ChallengeHistory({ - {hideRating ? '?' : p.label} + {hideRating ? "?" : p.label} )) diff --git a/src/components/puzzles/Puzzles.tsx b/src/components/puzzles/Puzzles.tsx index 7e693a4c..3ee36acb 100644 --- a/src/components/puzzles/Puzzles.tsx +++ b/src/components/puzzles/Puzzles.tsx @@ -1,10 +1,10 @@ import { activeTabAtom, currentPuzzleAtom, - selectedPuzzleDbAtom, - tabsAtom, hidePuzzleRatingAtom, progressivePuzzlesAtom, + selectedPuzzleDbAtom, + tabsAtom, } from "@/atoms/atoms"; import { commands } from "@/bindings"; import { unwrap } from "@/utils/invoke"; @@ -151,10 +151,11 @@ function Puzzles({ id }: { id: string }) { Puzzle Rating - {(puzzles[currentPuzzle]?.completion === "incomplete") - ? hideRating ? '?' : puzzles[currentPuzzle]?.rating - : puzzles[currentPuzzle]?.rating - } + {puzzles[currentPuzzle]?.completion === "incomplete" + ? hideRating + ? "?" + : puzzles[currentPuzzle]?.rating + : puzzles[currentPuzzle]?.rating} {averageWonRating && (