-
Notifications
You must be signed in to change notification settings - Fork 0
strict: enable noUncheckedIndexedAccess and fix type-safety issues #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
dc15c76
451697d
6f88306
0626a1f
365a90e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ import { useState } from "react" | |
| import { Button } from "@/components/ui/button" | ||
| import { Slider } from "@/components/ui/slider" | ||
| import { cn } from "@/lib/utils" | ||
| import { updateTodayEntry } from "@/lib/store" | ||
| import { updateTodayEntry } from "@/lib/store/actions" | ||
| import { type SleepQuality } from "@/lib/domain/entry" | ||
|
|
||
| const SLEEP_OPTIONS: { value: SleepQuality; label: string; glyph: string }[] = [ | ||
|
|
@@ -73,7 +73,7 @@ export function StepSleep({ onNext, onBack }: StepSleepProps) { | |
| max={12} | ||
| step={0.5} | ||
| value={[hours]} | ||
| onValueChange={([v]) => setHours(v)} | ||
| onValueChange={([v]) => setHours(v ?? 8)} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift Use The handler still updates local component state directly in As per coding guidelines, " 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| className="py-1" | ||
| /> | ||
| <div className="flex justify-between text-xs text-muted-foreground"> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major | 🏗️ Heavy lift
Route slider updates through store actions instead of component state setters.
This still mutates component state directly in a
.tsxcomponent. Move this throughlib/store/actionsper project rule.As per coding guidelines, "
**/*.{tsx,jsx}: Mutate state only vialib/store/actions— never usesetStatedirectly in components".🤖 Prompt for AI Agents
Source: Coding guidelines