Skip to content

[energy-only] add splash screen for energy-only routing#25

Merged
divazbozz merged 6 commits intomainfrom
david/moe-196-web-component-energy-only-routing-splash-screen
Feb 13, 2026
Merged

[energy-only] add splash screen for energy-only routing#25
divazbozz merged 6 commits intomainfrom
david/moe-196-web-component-energy-only-routing-splash-screen

Conversation

@divazbozz
Copy link
Contributor

@divazbozz divazbozz commented Feb 12, 2026

Summary

  • Adds is-energy-only attribute to bpc-address-search web component
  • When set, passes is_energy_only to the address-router API and shows a 3-second branded splash modal before redirecting to the checkout page

Rollout & followup

  • the energy-only will only be set behind our REP-only website which is not live

  • design is working on a better splash screen

  • I will work on refactoring the state a bit in the followup so that the representation is better, instead of 3 separate state variable

Test plan

  • Run npm run dev with is-energy-only="true" on the first address search instance
  • Enter an address → verify splash modal appears for ~3s then console logs redirect URL

see workflow below

  • redirect pop in after the splash duration 3 sec
Screen.Recording.2026-02-12.at.4.55.43.PM.mov

🤖 Generated with Claude Code


Open with Devin

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 4 additional findings in Devin Review.

Open in Devin Review

"Content-Type": "application/json",
},
body: JSON.stringify({ selection, confirmAddress }),
body: JSON.stringify({ selection, confirm_address: confirmAddress, is_energy_only: isEnergyOnly }),

Choose a reason for hiding this comment

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

🔴 Breaking API change: confirmAddress renamed to confirm_address in request body

The JSON body field confirmAddress was renamed to confirm_address as a side-effect of this PR. This changes the API contract for all address searches, not just energy-only ones.

Root Cause

Previously at src/address-search/fetch.ts:15, the body was:

body: JSON.stringify({ selection, confirmAddress })

This PR changed it to:

body: JSON.stringify({ selection, confirm_address: confirmAddress, is_energy_only: isEnergyOnly })

The confirmAddress field was renamed to confirm_address (snake_case). If the server-side API expects confirmAddress (camelCase), this will silently break the confirm-address functionality for all users — the server will never see the confirmAddress field and will treat every request as if confirmAddress is false/undefined.

This affects the multiple-address selection flow where confirmAddress: false is explicitly sent (src/address-search/element.tsx:206) and the initial address search where confirmAddress: true is sent (src/address-search/element.tsx:233). If the server doesn't recognize confirm_address, the address confirmation logic will be broken.

Impact: All address searches may have broken confirm-address behavior, potentially causing incorrect routing or infinite loops in the address selection flow.

Suggested change
body: JSON.stringify({ selection, confirm_address: confirmAddress, is_energy_only: isEnergyOnly }),
body: JSON.stringify({ selection, confirmAddress, is_energy_only: isEnergyOnly }),
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

backend has been updated

@divazbozz divazbozz force-pushed the david/moe-196-web-component-energy-only-routing-splash-screen branch 2 times, most recently from 455a3c2 to d408e88 Compare February 12, 2026 22:54
@divazbozz divazbozz requested a review from bkobelan February 12, 2026 22:56
@divazbozz
Copy link
Contributor Author

we are doing refactor first, converting to draft until that lands

@divazbozz divazbozz marked this pull request as draft February 13, 2026 01:58
divazbozz and others added 4 commits February 13, 2026 11:10
When is-energy-only="true" is set on the web component, show a 3-second
branded splash modal before redirecting to the checkout page. This gives
the backend hydration workflow time to complete.

- Add is-energy-only attribute to bpc-address-search element
- Pass is_energy_only through to address-router POST body
- Create EnergyOnlySplashModal with spinning battery SVG and timed redirect
- Fold splash into SelectionModal routing (alongside address/utility modals)
- Add PostHog tracking for splash shown/redirect/dismissed events

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@divazbozz divazbozz force-pushed the david/moe-196-web-component-energy-only-routing-splash-screen branch from fde47a9 to eee9b1b Compare February 13, 2026 17:31
@divazbozz divazbozz marked this pull request as ready for review February 13, 2026 17:34
@divazbozz divazbozz requested a review from bkobelan February 13, 2026 17:35
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 5 additional findings in Devin Review.

Open in Devin Review

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Open in Devin Review

@divazbozz divazbozz merged commit 4df932f into main Feb 13, 2026
1 check passed
@divazbozz divazbozz deleted the david/moe-196-web-component-energy-only-routing-splash-screen branch February 13, 2026 18:33
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