Skip to content

VNEXT-83184: Redesign checkout coupon UI - #1439

Open
abansal2-godaddy wants to merge 6 commits into
godaddy:mainfrom
abansal2-godaddy:VNEXT-83184
Open

VNEXT-83184: Redesign checkout coupon UI#1439
abansal2-godaddy wants to merge 6 commits into
godaddy:mainfrom
abansal2-godaddy:VNEXT-83184

Conversation

@abansal2-godaddy

@abansal2-godaddy abansal2-godaddy commented Aug 24, 2026

Copy link
Copy Markdown

Summary

Implements VNEXT-83184: redesign the checkout coupon / promotion code UI (default → filled → success → error).

Where this lives: @godaddy/react DiscountStandalone (used by Bruce when enablePromotionCodes is on). Copy keys are in @godaddy/localizations (enUs only; GOLF for other locales).

Why a new layout (not a small tweak)

Old UI was four separate pieces wired side-by-side:

Old piece Old look
DiscountInput Standalone text field
DiscountApplyButton Separate button next to the field
DiscountErrorList Large bordered destructive alert with a bullet list
Discounts + DiscountTag Small chip tags (code + X only — no amount)

New design from the ticket is a different composition:

  1. Label: Have a coupon code?
  2. One combined bordered row — input + Apply (or clear control when there is an error)
  3. Compact helper text under the field for errors (not the alert panel)
  4. Full-width green success bar — check + code + – $amount + remove

That is why markup for the field is inlined in DiscountStandalone, and applied coupons use a dedicated DiscountAppliedBar, instead of stretching the old input / button / chip APIs into a shape they were not built for.

Why those imports were removed from DiscountStandalone

They were removed from this checkout path only because the redesigned states no longer use those components:

Removed import Why it no longer fits this path
DiscountInput Input must sit inside the shared bordered row with Apply/clear, not as its own Input wrapper
DiscountApplyButton Apply is inside that same row; enabled/disabled styling is tied to field focus/value/error states
DiscountErrorList Spec is a short helper line under the field, not a destructive alert box
Discounts / DiscountTag Spec needs formatted amount + full-width success bar; chips only showed the code

Follow-up (not blocking this PR): the old discount-input, discount-apply-button, discount-error-list, discount-tag, and discounts files are still in the package and still exported. They are unused by DiscountStandalone. We can delete them or evolve them in place in a cleanup PR once we confirm nothing else imports them.

What changed in this PR

  • discount-standalone.tsx — new combined field + error helper; wires success via DiscountAppliedBar
  • New discount-applied-bar.tsx — success-state row (code + amount + remove)
  • enUs.tshaveACouponCode, invalid, removeCoupon
  • Unit tests updated for the new copy / success rendering
  • Changeset → patch for @godaddy/react + @godaddy/localizations

Jira

https://godaddy-corp.atlassian.net/browse/VNEXT-83184

Test plan

  • Discount / coupon unit tests pass locally
  • After Version Packages publish + Bruce dep bump: on dev or test checkout, verify default / filled / success / error in order summary
  • Applied bar shows formatted amount; remove clears the code
  • Invalid code shows compact helper under the field (not the old alert box)
  • Empty Apply stays disabled

abansal2-godaddy and others added 2 commits August 24, 2026 13:30
Implement combined coupon input states (default, filled, success, error)
in DiscountStandalone, add DiscountAppliedBar, and extend enUs discounts
strings for GOLF to translate into other locales.

Co-authored-by: Cursor <cursoragent@cursor.com>
Versioning can be handled in the release workflow; the coupon redesign does not need a local changeset.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abansal2-godaddy
abansal2-godaddy requested a review from a team as a code owner August 24, 2026 08:10
@changeset-bot

changeset-bot Bot commented Aug 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 51c4f09

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

This PR includes changesets to release 3 packages
Name Type
@godaddy/localizations Patch
@godaddy/react Patch
nextjs Patch

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

Bump @godaddy/react and @godaddy/localizations so the Version Packages workflow can publish after merge.

Co-authored-by: Cursor <cursoragent@cursor.com>
@abansal2-godaddy
abansal2-godaddy marked this pull request as draft August 24, 2026 09:44
abansal2-godaddy and others added 2 commits August 24, 2026 15:19
Clarify in DiscountStandalone and DiscountAppliedBar that the redesign cannot reuse the old input/button/chip composition, so those imports were dropped from this path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the explanation in the PR description and review comments instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

@abansal2-godaddy abansal2-godaddy left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Reviewer notes (also in the PR description): why the layout changed, and why the old discount imports were dropped from — without leaving that rationale in the source files.

import { eventIds } from '@/tracking/events';
import { TrackingEventType, track } from '@/tracking/track';
import { Discounts } from './discounts';
import type { DiscountFormProps } from './types';

@abansal2-godaddy abansal2-godaddy Aug 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Why these imports changed / why the old ones are gone from this file

Previously this file composed:

  • DiscountInput
  • DiscountApplyButton
  • DiscountErrorList
  • Discounts / DiscountTag

Those matched the old UX (separate input + button, large alert errors, chip tags with code only).

VNEXT-83184 needs a different UX, so those imports were removed from this path:

  • Input + Apply (or clear) must live in one bordered row → not standalone DiscountInput / DiscountApplyButton
  • Errors are a short helper under the field → not DiscountErrorList
  • Success needs code + formatted amount + remove in a full-width bar → not chip DiscountTags

The old modules are still in the package/exported for now; they just are not used by DiscountStandalone anymore. Cleanup can be a follow-up.

Comment on lines +261 to +270
<div className='flex flex-col gap-1.5'>
<div
className={cn(
'flex h-14 items-center justify-between rounded-md border bg-white py-2 pl-4 pr-2',
hasError
? 'border-[#EF4444]'
: isFocused || hasInputValue
? 'border-[#2563EB]'
: 'border-[#D1D5DB]'
)}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Why the layout is inlined here

This combined bordered row (input + Apply, border color by default/filled/error) is the core of the redesign. Wiring the old separate input/button components into this shell would mean rewriting their APIs anyway, so the field markup lives here and keeps the four visual states in one place.

inputInMinorUnits = true,
onRemove,
isRemoving,
}: DiscountAppliedBarProps) {

@abansal2-godaddy abansal2-godaddy Aug 24, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Why a new DiscountAppliedBar instead of tweaking DiscountTag

DiscountTag is a small chip (tag icon + code + X) and has no amount. The success state in the design is a full-width green bar: check + code + – $amount + remove.

That is a different component shape, so we added this bar for DiscountStandalone rather than overloading the chip. DiscountTag / Discounts remain in the package unused by this path until a cleanup PR.

@abansal2-godaddy
abansal2-godaddy marked this pull request as ready for review August 24, 2026 09:53
@abansal2-godaddy

Copy link
Copy Markdown
Author

Reviewer note: layout vs old imports

Details are on the Files changed tab (inline comments) and in the updated PR description.

Short version

  • New design is a combined input+Apply row, compact error helper, and a success bar with amount — not the old separate input/button/alert/chip composition.
  • That is why DiscountStandalone dropped DiscountInput / DiscountApplyButton / DiscountErrorList / Discounts / DiscountTag and why DiscountAppliedBar was added.
  • Rationale is documented in the PR only (not as source comments).

…c intact.

Preserve the original code collection and handlers; limit the change to the new coupon UI, amount lookup for the success bar, and error helper copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
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