Conversation
…ized module-level loader in SalesChart
…ncy formatting across product details
…uctured component layout
- Refactor stock movement draft handling to use IndexedDB for persistence. - Introduce schema versioning for drafts to ensure compatibility. - Enhance draft reading and writing functions with error handling. - Update hooks to manage draft state and hydration more effectively. - Add tests for draft storage functionality, including schema validation and error scenarios. - Modify UI components to reflect changes in draft management and user notifications.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 373906f888
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (file) void handleFile(file); | ||
| setShowRemovalIndicator(false); |
There was a problem hiding this comment.
Preserve removal state when replace dialog is cancelled
When the user removes an existing product image and then opens the replace picker, cancelling the file dialog still clears showRemovalIndicator unconditionally. In edit mode this makes the UI look like the current image is restored, but the parent removeCurrentImage flag remains true (set by onRemoveImage), so saving can delete the image unexpectedly. Only clear the removal indicator after a file is actually selected.
Useful? React with 👍 / 👎.
| return useForm<ProductPromptGenerateFormData>({ | ||
| resolver: zodResolver(productPromptGenerateSchema), | ||
| defaultValues: buildGeneratePromptDefaults(latestBatch), | ||
| }); |
There was a problem hiding this comment.
Reset prompt form after batch pricing data loads
This form uses defaultValues from latestBatch, but latestBatch is derived from SWR-loaded batches and typically becomes available after the first render. React Hook Form does not re-apply defaultValues on prop changes, so normalPriceCents stays unset instead of being prefilled from the latest batch, forcing manual entry and breaking the intended autofill flow. Add a reset/setValue effect when latestBatch changes.
Useful? React with 👍 / 👎.
No description provided.