insights-correlations (#22)
Some checks failed
CI / Check / Test (push) Has been cancelled

Reviewed-on: #22
This commit was merged in pull request #22.
This commit is contained in:
2026-10-12 18:56:55 +00:00
parent 4d221e60de
commit e303ae7f08
139 changed files with 2371 additions and 696 deletions

View File

@@ -8,6 +8,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover
import { Calendar } from "@/components/ui/calendar"
import { StarRating } from "@/components/star-rating"
import { WatchMediumPicker } from "@/components/watch-medium-picker"
import { withPickedDay } from "@/lib/date"
type ReviewFormFieldsProps = {
rating: number
@@ -55,7 +56,7 @@ export function ReviewFormFields({
mode="single"
fixedWeeks
selected={watchedAt}
onSelect={(d) => d && onWatchedAtChange(d)}
onSelect={(d) => d && onWatchedAtChange(withPickedDay(watchedAt, d))}
disabled={(d) => d > new Date()}
autoFocus
/>

View File

@@ -12,7 +12,7 @@ import { Trash2 } from "lucide-react"
import { toast } from "sonner"
import { posterUrl } from "@/lib/api/client"
import { hapticMedium } from "@/lib/haptics"
import { parseLocalDate, formatLocalDateTime } from "@/lib/date"
import { formatWatchedAt, isDateOnly, parseWatchedAt } from "@/lib/date"
import type { EditReviewRequest } from "@/features/diary"
import type { MovieDto, ReviewDto } from "@/lib/api/common"
@@ -77,7 +77,7 @@ function LogMode({ open, onOpenChange }: { open: boolean; onOpenChange: (open: b
manual_director: movie.director,
rating,
comment: comment || undefined,
watched_at: watchedAt.toISOString().replace("Z", "").split(".")[0]!,
watched_at: formatWatchedAt(watchedAt),
watch_medium: watchMedium,
},
{
@@ -145,7 +145,7 @@ function EditMode({
const { t } = useTranslation()
const [rating, setRating] = useState(review.rating)
const [comment, setComment] = useState(review.comment ?? "")
const [watchedAt, setWatchedAt] = useState<Date>(() => parseLocalDate(review.watched_at))
const [watchedAt, setWatchedAt] = useState<Date>(() => parseWatchedAt(review.watched_at))
const [dateChanged, setDateChanged] = useState(false)
const [watchMedium, setWatchMedium] = useState<string | undefined>(review.watch_medium)
const [confirmDelete, setConfirmDelete] = useState(false)
@@ -164,7 +164,7 @@ function EditMode({
if (rating !== review.rating) data.rating = rating
const newComment = comment || null
if (newComment !== (review.comment ?? null)) data.comment = newComment
if (dateChanged) data.watched_at = formatLocalDateTime(watchedAt)
if (dateChanged) data.watched_at = formatWatchedAt(watchedAt, isDateOnly(review.watched_at))
if (watchMedium !== review.watch_medium) data.watch_medium = watchMedium ?? null
if (Object.keys(data).length === 0) {