Conversation
…lements The rest of donation-form lands under src/elements/ia-donation-form/: the form, controller, header, summary, total amount, badged input, payment selector and contact form as ia-donation-* elements, the three modal contents under modals/, and the payment flow handlers with the donation flow modal manager under flow-handlers/. The icon-* packages become SVGs, masked for the monochrome ones and plain <img> for the brand logos. The controller gets a story wired to the Braintree sandbox with a demo endpoint manager and buttons for the modals. The story renders in the light DOM, since Braintree and PayPal find their containers with document.querySelector, and only loads the third-party scripts once you press "Connect to the sandbox", so the demo page and its test stay off the network. Beyond the move: the payment selector's PayPal cover is a real button with an aria-label like the other providers, the brand logos have alt text, and the collapse rule only hides the provider buttons so the cover survives being pressed with an invalid amount. The upsell thank-you logs and calls donationSuccessful once instead of twice. The credit card container lost its duplicate class attribute so the hidden class applies. The controller no longer replaces a consumer-supplied paymentClients when environment is set in a later update. The form defaults donationInfo to the standard selection so the header renders without one. The PayPal button render reads the funding constants off window.paypal defensively. TYD is TWD, the confirm modal's currencyType defaults to USD, the hosted field placeholders go through msg(), and a Google Pay billing name is trimmed before the first/last split. The form's theming variables are --ia-donation-form-* and the base font size flows down to the section and edit elements from the form's host. modal-manager and analytics-manager are npm dependencies. Tests move to Vitest, with a mock modal manager element and mock flow handlers under test-helpers/. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf
jbuckner
added this pull request to stack #101
September 15, 2026 06:00
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## WEBDEV-9053-migrate-payment-layer #105 +/- ##
=====================================================================
- Coverage 87.86% 82.06% -5.80%
=====================================================================
Files 100 125 +25
Lines 3114 4071 +957
Branches 611 755 +144
=====================================================================
+ Hits 2736 3341 +605
- Misses 212 522 +310
- Partials 166 208 +42 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The modal-manager element paints its backdrop whenever it's in the DOM, so the demo page was covered by a black layer that swallowed every click on every story. The host is expected to hide it, as its README says. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf
The demo derives the sidebar entry and the anchor from the story's file name, so ia-donation-form-story.ts showed up as <ia-donation-form> while the card inside said <ia-donation-form-controller>. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WEBDEV-9054. Stacked on #103. Last of the five in WEBDEV-8602.
Everything left in
donation-form: the form, controller, header, summary, total amount, badged input, payment selector and contact form asia-donation-*elements, the three modal contents, and the payment flow handlers with the donation flow modal manager. It all lands undersrc/elements/ia-donation-form/. Theicon-*packages become SVGs (masked for the monochrome ones, plain<img>for the brand logos). The controller gets a story against the Braintree sandbox, with a demo endpoint manager, an analytics readout and buttons to pop the upsell and confirmation modals. The story renders in the light DOM (Braintree and PayPal find their containers withdocument.querySelector) and only loads the third-party scripts after you press "Connect to the sandbox", so the all-elements demo page andapp-root.test.tsdon't reach out to Braintree, PayPal, Google or reCAPTCHA on their own.What changed beyond the move:
<button>. It was a<div>with a click handler, so it had no keyboard access or accessible name. It has anaria-labellike the other provider buttons now, and the brand logos carryalttext.paymentClientsyou hand it. It built its own on everyenvironmentchange, replacing yours ifenvironmentlanded in a later update. It only rebuilds the set it created itself now.donationInfo. Without one the header's edit-donation element threw on render. It uses the same default selection as the controller.<button>, the "collapse the other providers" rule caught it too, so one press with a bad amount hid the cover and the next click reached PayPal's real button. The rule only collapses the provider buttons now, with a test.showThankYouModalloggedDonated-X-upselland calleddonationSuccessfultwice on the upsell path. Once now.classattributes, so thehiddenone was dropped by the parser.TYDisTWDin the currency symbols, the confirm modal'scurrencyTypedefaults toUSDrather than$, the hosted field placeholders go throughmsg(), and a Google Pay billing name is trimmed before the first/last split so the surname doesn't keep a leading space.window.paypal.FUNDINGdefensively. Only the Venmo exclusion needs it, and the script isn't there in tests.--ia-donation-form-*(text, background, badge, payment option and selected option colors, donate button, base font size). The base font size flows down from the form's host to the section and edit elements.AnalyticsManagerInterfacefrom@internetarchive/analytics-manager, and the modals through@internetarchive/modal-manager. Both are regular dependencies, as decided for the stack.Tests moved from web-test-runner to Vitest, 109 of them, with a
test-mock-modal-managerelement and mock flow handlers undertest-helpers/. Two contact form tests now assert what the browser actually does onreportValidity(): it focuses the first invalid field, and focusing a field clears its error mark.Verified locally: build, full suite 900 passing, eslint and prettier clean, no circular dependencies.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf