Skip to content

Codex-generated pull request#5

Open
Mqhele-dot wants to merge 1 commit into
cursor/project-codespace-compatibility-b14cfrom
codex/fix-incomplete-sections-and-loading-issues
Open

Codex-generated pull request#5
Mqhele-dot wants to merge 1 commit into
cursor/project-codespace-compatibility-b14cfrom
codex/fix-incomplete-sections-and-loading-issues

Conversation

@Mqhele-dot
Copy link
Copy Markdown
Owner

@Mqhele-dot Mqhele-dot commented Feb 16, 2026

Codex generated this pull request, but encountered an unexpected error after generation. This is a placeholder PR message.


Codex Task


Note

Medium Risk
Moderate risk because it changes how several pages unwrap/validate API responses (including sending cookies) and alters the operational inventory payload to always include a numeric price, which can affect downstream UI calculations and auth-dependent endpoints.

Overview
Improves robustness of dashboard/report data loading by introducing a shared unwrapApiData helper to handle { ok, data, error } API envelopes and updating several fetch calls to use credentials: "include".

Hardens report rendering/calculations by normalizing inventory stats to numbers, guarding list endpoints as arrays, and coercing price/quantity to numbers when computing values; the inventory report preview/footer now always reflects the current inventory feed instead of falling back to stats.

Tightens warehouse create/edit UX by removing form submit handlers, adding explicit required-name validation with trimmed input, and switching submit buttons to explicit click actions. On the server, listOperationalInventory now selects i.price and normalizes it to a numeric price in the returned items.

Written by Cursor Bugbot for commit bbe3541. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on March 8

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

throw new Error(envelope.error?.message || "Request failed");
}
return raw as T;
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Duplicate unwrapApiData function across two pages

Low Severity

The unwrapApiData function is identically copy-pasted into both dashboard.tsx and reports.tsx as a component-scoped helper. No shared utility exists for this pattern in client/src/lib or elsewhere. Extracting it to a shared module would reduce maintenance burden and ensure consistent envelope-unwrapping behavior across all pages.

Additional Locations (1)

Fix in Cursor Fix in Web

{safeInventoryItems.length > 0
? `${safeInventoryItems.length} items • Total Value: ${formatCurrency(calculateTotalValue(safeInventoryItems))}`
: `${stats?.totalItems || 0} items • Total Value: ${formatCurrency(stats?.inventoryValue || 0)}`}
{`${safeInventoryItems.length} items • Total Value: ${formatCurrency(calculateTotalValue(safeInventoryItems))}`}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Report preview lost stats fallback during loading

Medium Severity

The report preview header and footer previously fell back to stats?.totalItems and stats?.inventoryValue when safeInventoryItems was empty (e.g., during loading or on fetch error). The new code always shows safeInventoryItems.length and calculateTotalValue(safeInventoryItems), which displays "0 items • Total Value: $0.00" whenever inventory items haven't loaded yet, even if stats are already available.

Additional Locations (1)

Fix in Cursor Fix in Web

Cancel
</Button>
<Button type="submit" disabled={createWarehouse.isPending}>
<Button type="button" onClick={handleCreateSubmit} disabled={createWarehouse.isPending}>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warehouse forms no longer submit on Enter key

Medium Severity

Both the create and edit warehouse forms replaced onSubmit handlers and type="submit" buttons with <form noValidate> (no onSubmit) and type="button" buttons with onClick. This removes the standard Enter-key-to-submit behavior. Users pressing Enter in any text input will no longer trigger handleCreateSubmit or handleEditSubmit, breaking a common form interaction pattern.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant