feat(vue-starter-template): enhance BaseButton and checkout flow #2563
Open
Maciej D (mdanilowicz) wants to merge 1 commit into
Open
feat(vue-starter-template): enhance BaseButton and checkout flow #2563Maciej D (mdanilowicz) wants to merge 1 commit into
Maciej D (mdanilowicz) wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the Vue starter template’s checkout UX by adding a “placing order” loading state that blocks interactions during order submission, reducing duplicate submissions and improving user feedback.
Changes:
- Added
isPlacingOrderstate to the checkout page to guard against duplicate order placement and show a loading overlay. - Extended
FormBaseButton(BaseButton.vue) withloading/disabledprops and a built-in spinner. - Added
checkout.placingOrderi18n strings for en-GB, de-DE, and pl-PL.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/vue-starter-template/app/pages/checkout/index.vue | Adds “placing order” state, disables the order button, and shows blocking overlays during submission. |
| templates/vue-starter-template/app/components/form/BaseButton.vue | Adds loading/disabled props and renders a spinner while loading. |
| templates/vue-starter-template/i18n/en-GB/checkout.json | Adds placingOrder translation string. |
| templates/vue-starter-template/i18n/de-DE/checkout.json | Adds placingOrder translation string. |
| templates/vue-starter-template/i18n/pl-PL/checkout.json | Adds placingOrder translation string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
34
to
+39
| <button | ||
| :class="[variantClasses[variant], sizeClasses[size]]" | ||
| class="px-4 rounded inline-flex justify-center items-center gap-1 disabled:bg-surface-surface-disabled disabled:bg-text-bg-surface-surface-disabled" | ||
| class="px-4 rounded inline-flex justify-center items-center gap-2 disabled:cursor-not-allowed disabled:opacity-70 disabled:bg-surface-surface-disabled disabled:bg-text-bg-surface-surface-disabled" | ||
| :type="type" | ||
| :disabled="disabled || loading" | ||
| :aria-busy="loading" |
Comment on lines
+140
to
+146
| <div class="w-1/2 relative"> | ||
| <div | ||
| v-if="isPlacingOrder" | ||
| class="absolute inset-0 z-10 flex items-center justify-center bg-surface-surface/70 backdrop-blur-[1px] cursor-wait" | ||
| role="status" | ||
| :aria-label="$t('checkout.placingOrder')" | ||
| > |
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.
closes #2562
This pull request adds a loading state to the order placement flow in the Vue starter template, improving user feedback and preventing duplicate order submissions. The main changes include updating the
BaseButtoncomponent to support loading and disabled states, integrating a loading indicator and overlay into the checkout page, and adding new i18n strings for the loading state.Checkout process improvements:
isPlacingOrderstate incheckout/index.vueto prevent duplicate order submissions and display a loading overlay while an order is being placed. The order button is now disabled and shows a spinner and loading text during this process. [1] [2] [3]Component updates:
BaseButton.vueto supportloadinganddisabledprops, display a spinner when loading, and update button accessibility attributes accordingly. [1] [2]Internationalization:
placingOrderstring tocheckout.jsonin English, German, and Polish locales for improved localization of the loading state. [1] [2] [3]