Skip to content

ProductDoctor: Reassure users about what was just verified, given the active stock availability mode#6546

Open
mirekm wants to merge 2 commits intofix/new-availability-logicfrom
fix/availability-doctor-copy-pass
Open

ProductDoctor: Reassure users about what was just verified, given the active stock availability mode#6546
mirekm wants to merge 2 commits intofix/new-availability-logicfrom
fix/availability-doctor-copy-pass

Conversation

@mirekm
Copy link
Copy Markdown
Member

@mirekm mirekm commented Apr 29, 2026

Builds on #6545 Adds a mode-aware reassurance line under the verification badge so "Purchasable" unambiguously reflects the shop's stock-availability mode. Tightens noWarehouses / warehouseNotInZone descriptions that became misleading after #6545

@mirekm mirekm requested review from a team, Copilot and stmpn April 29, 2026 12:12
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 29, 2026

🦋 Changeset detected

Latest commit: 419353a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mirekm mirekm changed the base branch from main to fix/new-availability-logic April 29, 2026 12:13
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.65%. Comparing base (aa224ec) to head (419353a).

Files with missing lines Patch % Lines
...ucts/components/ProductDoctor/AvailabilityCard.tsx 81.81% 1 Missing and 1 partial ⚠️
...mponents/ProductDoctor/AvailabilityChannelItem.tsx 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           fix/new-availability-logic    #6546      +/-   ##
==============================================================
+ Coverage                       48.63%   48.65%   +0.02%     
==============================================================
  Files                            2591     2591              
  Lines                           46143    46153      +10     
  Branches                        10598    10882     +284     
==============================================================
+ Hits                            22441    22456      +15     
+ Misses                          23322    23316       -6     
- Partials                          380      381       +1     
Flag Coverage Δ
storybook 43.85% <ø> (ø)
units 44.32% <76.92%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR extends ProductDoctor’s availability diagnostics and public API verification UI to be aware of Saleor’s stock availability mode (Shop.useLegacyShippingZoneStockAvailability, Saleor 3.23+), so diagnostics severity/copy and the verification reassurance are unambiguous in both legacy (shipping-zone-gated) and direct (warehouse↔channel-gated) modes.

Changes:

  • Extend the diagnostics GraphQL query + hook result to include useLegacyShippingZoneStockAvailability, and thread it into availability checks and UI.
  • Adjust shipping/warehouse diagnostics behavior and copy based on the active mode; add a new “stock outside channel warehouses” advisory.
  • Update ProductDoctor UI to (a) avoid promoting info-level advisories to “Issues” in channel headers and (b) show mode-aware reassurance under the public API verification badge; add UI tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/products/queries.ts Adds shop.useLegacyShippingZoneStockAvailability to diagnostics query.
src/products/components/ProductDoctor/utils/types.ts Extends DiagnosticsResult with the mode flag for UI consumers.
src/products/components/ProductDoctor/utils/availabilityChecks.ts Adds mode-aware logic for shipping/warehouse checks and a new “stock outside channel warehouses” info check.
src/products/components/ProductDoctor/utils/availabilityChecks.test.ts Adds/updates test coverage for mode-specific behavior and new check.
src/products/components/ProductDoctor/primitives.tsx Adds test IDs/attrs to IssueBadge.
src/products/components/ProductDoctor/messages.ts Updates/extends i18n strings for mode-aware copy and reassurance.
src/products/components/ProductDoctor/hooks/useProductAvailabilityDiagnostics.ts Plumbs the mode flag from query → checks → hook result.
src/products/components/ProductDoctor/hooks/useProductAvailabilityDiagnostics.test.tsx Tests the mode-flag plumbing and fallback behavior.
src/products/components/ProductDoctor/AvailabilityChannelItem.tsx Treats info issues as non-blocking for header state; adds mode-aware verification badge props and info visuals.
src/products/components/ProductDoctor/AvailabilityCard.tsx Adds a stock-availability mode indicator + mode-aware reassurance line rendering; refactors badge rendering.
src/products/components/ProductDoctor/AvailabilityCard.test.tsx Adds UI tests for mode indicator, severity gating, and reassurance text.
src/graphql/types.generated.ts Regenerates types for the updated diagnostics query.
src/graphql/hooks.generated.ts Regenerates query document for the updated diagnostics query.
locale/defaultMessages.json Adds/removes message IDs to match updated i18n messages.
.changeset/tender-impalas-tickle.md Patch changeset for adding mode support.
.changeset/curly-doves-dance.md Patch changeset for UI reassurance + copy tightening.
Comments suppressed due to low confidence (1)

src/products/components/ProductDoctor/AvailabilityCard.tsx:466

  • StockAvailabilityModeIndicator uses a plain <Box> as the Tooltip.Trigger, which is not keyboard-focusable by default. To keep the tooltip accessible (keyboard + screen readers), consider rendering the trigger as a semantic button (e.g. as="button", type="button") and adding an aria-label (there are several examples in the codebase such as SearchTooltip).
    <Tooltip>
      <Tooltip.Trigger>
        <Box
          display="flex"
          alignItems="center"
          gap={2}
          __cursor="help"
          data-test-id="stock-availability-mode-indicator"
          data-test-mode={useLegacyShippingZoneStockAvailability ? "legacy" : "direct"}
        >
          <Layers size={14} color="var(--mu-colors-text-default2)" />
          <Text size={2} color="default2">
            {intl.formatMessage(labelMessage)}
          </Text>
        </Box>

@mirekm mirekm changed the title Reassure users about what was just verified, given the active stock availability mode ProductDoctor: Reassure users about what was just verified, given the active stock availability mode Apr 29, 2026
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