Skip to content

fix: auto-navigate to product form after barcode scan#4

Merged
BEKO2210 merged 1 commit intomainfrom
claude/restore-github-actions-workflow-oueZr
Mar 8, 2026
Merged

fix: auto-navigate to product form after barcode scan#4
BEKO2210 merged 1 commit intomainfrom
claude/restore-github-actions-workflow-oueZr

Conversation

@BEKO2210
Copy link
Copy Markdown
Owner

@BEKO2210 BEKO2210 commented Mar 8, 2026

After scanning a barcode, the app now automatically navigates to the "Add Product" form with scanned data (name, barcode) pre-filled. This eliminates the intermediate card that kept jumping/flickering due to multiple scan callbacks, making the flow much smoother.

https://claude.ai/code/session_018567acDi8JQ3BHH8BxYX5b

After scanning a barcode, the app now automatically navigates to the
"Add Product" form with scanned data (name, barcode) pre-filled.
This eliminates the intermediate card that kept jumping/flickering
due to multiple scan callbacks, making the flow much smoother.

https://claude.ai/code/session_018567acDi8JQ3BHH8BxYX5b
@BEKO2210 BEKO2210 merged commit ab609db into main Mar 8, 2026
3 checks passed
@BEKO2210 BEKO2210 deleted the claude/restore-github-actions-workflow-oueZr branch March 8, 2026 14:50
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: f905645b2f

ℹ️ 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 on lines 83 to +85
const product = await lookupBarcode(barcode);
if (product) {
setState({
type: 'found',
barcode,
name: product.name,
imageUrl: product.imageUrl,
});
} else {
setState({ type: 'not_found', barcode });
}
// Navigate to form with whatever data we got
navigateToAddWithScan({
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 Cancel pending lookup before forcing page navigation

After a scan succeeds, this callback always calls navigateToAddWithScan when lookupBarcode resolves, even if the user has already left the scanner (e.g., via the bottom navigation while the loading state is visible). In that case the delayed async completion will unexpectedly yank them back to the add form, which is a regression from the previous local-state-only flow; guard this with an unmounted/cancelled flag before navigating.

Useful? React with 👍 / 👎.

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