Skip to content

feat(web): graceful error and loading states for billing/offers surfaces#1267

Merged
brendan-kellam merged 2 commits into
v5from
brendan/upsell-error-states-SOU-1271
Jun 3, 2026
Merged

feat(web): graceful error and loading states for billing/offers surfaces#1267
brendan-kellam merged 2 commits into
v5from
brendan/upsell-error-states-SOU-1271

Conversation

@brendan-kellam
Copy link
Copy Markdown
Contributor

Fixes SOU-1271

Summary

When the offers/pricing fetch from the deployments server fails, several billing surfaces previously rendered nothing (return null) or silently dismissed themselves, leaving users with a blank area or a vanished dialog. This PR replaces those with recoverable, role-aware error states and tidies the loading UX.

Changes

  • Onboarding trial step (trialStep.tsx): on error, reframe the copy to "You're all set" and add a View pricing link instead of a bare Continue button.
  • Upsell dialog & panel (upsellDialog.tsx): introduce a shared UpsellLoadError fallback used by both UpsellDialog and UpsellPanel:
    • Something went wrong heading + generic "We couldn't reach Sourcebot's deployments server" copy (no longer presumes the user came for pricing).
    • Try again (retry via react-query refetch) and a Status page link (status.sourcebot.dev), which is resilient to the very failure that triggered the state.
    • Role-aware: owners get an actionable outbound-access hint naming deployments.sourcebot.dev plus a Learn more link to the service-ping docs; members are routed to contact their org admin.
    • The dialog now keeps itself open with this error state (built-in close button remains the dismiss affordance) rather than toasting and auto-closing.
  • Loading state (upsellDialog.tsx + the five entitlement-message wrappers): add a loadingVariant prop to UpsellPanel. Full-area, centered feature gates (chat, MCP, analytics, account/workspace Ask connectors) now render a centered spinner; the in-flow license-settings card keeps its layout-matching skeleton.

Test plan

  • Block outbound access to deployments.sourcebot.dev (or otherwise force the offers fetch to fail) and verify the error state renders on: the onboarding trial step, the upsell dialog, and each feature-gate page.
  • Confirm owner vs member see the role-appropriate copy.
  • Confirm Try again refetches and Status page / Learn more open the right URLs.
  • Confirm feature gates show a spinner while loading and the license card shows a skeleton.

🤖 Generated with Claude Code

Replace silent `null` returns with recoverable error states when the offers
fetch fails, across onboarding, the upsell dialog/panel, and feature gates:

- Onboarding trial step: reframe the error copy and add a "View pricing" link.
- UpsellDialog / UpsellPanel: shared UpsellLoadError fallback with a retry,
  Status page link, and role-aware copy (owners get an outbound-access hint to
  deployments.sourcebot.dev + Learn more; members are routed to their admin).
- UpsellPanel: add a `loadingVariant` prop so full-area feature gates render a
  centered spinner while the in-flow license card keeps its skeleton.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4696eee0-3607-4b26-a839-4360a0b7c7c7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch brendan/upsell-error-states-SOU-1271

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

@brendan-kellam your pull request is missing a changelog!

@brendan-kellam brendan-kellam merged commit e93d8d8 into v5 Jun 3, 2026
3 checks passed
@brendan-kellam brendan-kellam deleted the brendan/upsell-error-states-SOU-1271 branch June 3, 2026 03:29
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.

1 participant