-
Notifications
You must be signed in to change notification settings - Fork 0
Fixups! #32
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
Fixups! #32
Changes from all commits
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 | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,17 @@ interface BookStickerInstructionProps { | |||||||||||||||
| code: string | ||||||||||||||||
| coverUrl?: string | ||||||||||||||||
| className?: string | ||||||||||||||||
| animationSpeedMultiplier?: number | ||||||||||||||||
|
||||||||||||||||
| animationSpeedMultiplier?: number |
Copilot
AI
Dec 28, 2025
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.
The comment states "~0.5s if base is 2.5" but the actual calculation is 2.5 * 0.3 = 0.75 seconds, not 0.5 seconds. Update the comment to reflect the correct value.
| openDelay: ANIMATION_BASE_DURATION_S * 0.3, // ~0.5s if base is 2.5 | |
| openDelay: ANIMATION_BASE_DURATION_S * 0.3, // ~0.75s if base is 2.5 |
Copilot
AI
Dec 28, 2025
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.
Two unused state variables are declared: aspectRatio (line 90) and dynamicAspectRatio (line 93). The setDynamicAspectRatio is called in the image onLoad handler but the value is never read. Either use these variables to control the aspect ratio of the container or image, or remove them entirely.
| const [aspectRatio, setAspectRatio] = useState(1 / 1.3) | |
| // Refined plan: Use a ref or state for style. | |
| const [dynamicAspectRatio, setDynamicAspectRatio] = useState(1.3) | |
| // Refined plan: Use a ref or state for style. | |
| const [, setDynamicAspectRatio] = useState(1.3) |
Copilot
AI
Dec 28, 2025
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.
The class combination w-auto with aspect-[0.66] creates a conflict. The aspect-[0.66] utility requires a width to calculate height (or vice versa), but w-auto means the width is determined by content. With a fixed height of h-[275px], the aspect ratio class won't work as intended. Consider using only h-[275px] and removing both w-auto and aspect-[0.66], or restructure to use aspect ratio with a defined width.
| <div className="relative w-auto h-[275px] mt-4 mb-2 max-w-[300px] aspect-[0.66]"> | |
| <div className="relative h-[275px] mt-4 mb-2 max-w-[300px] aspect-[0.66]"> |
Copilot
AI
Dec 28, 2025
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.
The class aspect-2/3 is not a standard Tailwind CSS class. Tailwind uses bracket notation for arbitrary aspect ratios. Change this to aspect-[2/3] to properly apply the 2:3 aspect ratio.
| className="h-full opacity-90 mix-blend-overlay aspect-2/3" | |
| className="h-full opacity-90 mix-blend-overlay aspect-[2/3]" |
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.
The removal of the "Register another book" button leaves the
resetStatefunction (defined at line 137) unused and orphaned. Users who want to register multiple books in one session now must close and reopen the drawer, but the generated code and selected book will persist since there's no effect that resets state when the drawer closes. Consider either: 1) Adding a useEffect to reset state when the drawer closes (whenopenchanges to false), or 2) Keeping a reset button if the expected UX is to allow registering multiple books without closing the drawer.