Skip to content

WEBDEV-9052: Migrate edit-donation into elements - #100

Open
jbuckner wants to merge 1 commit into
WEBDEV-9051-migrate-donation-form-modelsfrom
WEBDEV-9052-migrate-edit-donation
Open

jbuckner wants to merge 1 commit into
WEBDEV-9051-migrate-donation-form-modelsfrom
WEBDEV-9052-migrate-edit-donation

Conversation

@jbuckner

@jbuckner jbuckner commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

WEBDEV-9052. Stacked on #98. Third of the five in WEBDEV-8602.

donation-form-edit-donation moves over as ia-donation-edit-donation, with its story and tests on Vitest. The petabox banner uses this one standalone, so it has its own catalog entry.

What changed beyond the move:

  • It renders ia-donation-section for its two steps instead of donation-form-section, and the enums are as const objects plus a type.
  • CSS variables move to --ia-donation-edit-* (button colors, border, gap, font sizes, custom amount width, input border, badge and background pass-throughs to the sections). Everything is sized off a 10px base font size variable, which is also handed to the sections so the whole thing scales together. The two layout variables the element sets on its own host from the number of amounts are renamed too (--ia-donation-edit-amount-column-count, --ia-donation-edit-custom-amount-col-span). The old --editFormTextColor pass-through is gone, the section reads --ia-theme-primary-text-color directly.
  • Strings go through msg(), and the custom amount text field has an aria-label, it only had the visible "Custom: $" text beside it before.
  • currency.js is a new dependency, for the amount formatting.
  • One inherited bug fixed. With customAmountMode="hide", the "is the donor typing in the custom field" check compared null to null and came out true, so a preset set programmatically (say the banner switching amounts) could leave nothing selected until the donor clicked. Guarded on the field existing, with a test that fails on the old code.

Verified locally: build, full suite 706 passing, eslint and prettier clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf

The edit-donation package from iaux-donation-form lands as
ia-donation-edit-donation under src/elements/ia-donation-form/form-elements/,
rendering ia-donation-section for its two steps. The petabox banner uses it
on its own, so it gets its own story.

Enums become as-const objects plus a type. CSS variables move to
--ia-donation-edit-*, sized off a 10px base font size that is passed through
to the sections. The strings go through msg(), the custom amount field gets
an accessible name, and currency.js becomes a dependency.

One inherited bug fixed: with the custom amount hidden, the "is the donor
typing in the custom field" check compared null to null and came out true,
so a preset set programmatically could end up with nothing selected. Guarded
on the field existing, with a test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnX6VHo3EJRzcKfhzBChCf
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-100/

Built to branch ghpages at 2026-09-15 00:01 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@jbuckner
jbuckner added this pull request to stack #101 September 15, 2026 00:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.83%. Comparing base (799d264) to head (8744ccc).

Files with missing lines Patch % Lines
...on-form/form-elements/ia-donation-edit-donation.ts 92.09% 6 Missing and 8 partials ⚠️
...m/form-elements/ia-donation-edit-donation-story.ts 61.53% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##           WEBDEV-9051-migrate-donation-form-models     #100      +/-   ##
============================================================================
+ Coverage                                     86.58%   86.83%   +0.25%     
============================================================================
  Files                                            76       78       +2     
  Lines                                          2340     2530     +190     
  Branches                                        501      548      +47     
============================================================================
+ Hits                                           2026     2197     +171     
- Misses                                          168      178      +10     
- Partials                                        146      155       +9     

☔ View full report in Codecov by Harness.
📢 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.

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