Skip to content

Multi Product Insert on Stock-Movements and Image Prompts#2

Merged
lexmarcos merged 35 commits into
mainfrom
indexdb
May 21, 2026
Merged

Multi Product Insert on Stock-Movements and Image Prompts#2
lexmarcos merged 35 commits into
mainfrom
indexdb

Conversation

@lexmarcos
Copy link
Copy Markdown
Owner

No description provided.

lexmarcos added 30 commits May 12, 2026 21:30
- 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.
@lexmarcos lexmarcos requested a review from Copilot May 21, 2026 14:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread components/product/image-dropzone.tsx Outdated
Comment on lines +341 to +342
if (file) void handleFile(file);
setShowRemovalIndicator(false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +177 to +180
return useForm<ProductPromptGenerateFormData>({
resolver: zodResolver(productPromptGenerateSchema),
defaultValues: buildGeneratePromptDefaults(latestBatch),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@lexmarcos lexmarcos merged commit 7f8b7a1 into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants