-
Notifications
You must be signed in to change notification settings - Fork 3
fix(GiniInternalPaymentSDK): Done button and landscape scroll for documentCollection #1179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zladzeyka
wants to merge
12
commits into
release/liquid_glass_health_sdk
Choose a base branch
from
fix/HEAL-508_done_btn
base: release/liquid_glass_health_sdk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4ace4df
feat(GiniInternalPaymentSDK): Add Liquid Glass Done button for decima…
zladzeyka 470c278
fix(GiniInternalPaymentSDK): Fix Done button position and scroll in l…
zladzeyka b75b103
fix(GiniInternalPaymentSDK): Restore full-width Done button for lands…
zladzeyka e7be6d0
fix(GiniInternalPaymentSDK): Fix landscape scroll, keyboard avoidance…
zladzeyka 9a9a40e
fix(GiniInternalPaymentSDK): Restore Liquid Glass Done button for she…
zladzeyka de33245
refactor(GiniInternalPaymentSDK): Clean up PR review findings
zladzeyka fdf798d
Merge remote-tracking branch 'origin/release/liquid_glass_health_sdk'…
zladzeyka 6476851
fix(GiniInternalPaymentSDK): Fix scroll guard and iOS 26 toolbar deta…
zladzeyka 82451a6
refactor(GiniInternalPaymentSDK): Extract keyboard handlers and scrol…
zladzeyka 0d3c1da
fix(GiniInternalPaymentSDK): Fix Done button alignment and constraint…
zladzeyka b4c6cb0
fix(GiniInternalPaymentSDK): Address Copilot review — doc style and t…
zladzeyka f760fe4
style(GiniInternalPaymentSDK): convert declaration comments to /** */…
zladzeyka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...InternalPaymentSDK/Sources/GiniInternalPaymentSDK/Extensions/Transaction+Extensions.swift
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| // | ||
| // Transaction+Extensions.swift | ||
| // | ||
| // Copyright © 2026 Gini GmbH. All rights reserved. | ||
| // | ||
|
|
||
| import SwiftUI | ||
|
|
||
| extension Transaction { | ||
| // Disables ambient UIKit animation inheritance (e.g. keyboard CATransaction). | ||
| static var withoutAnimation: Transaction { | ||
| var transaction = Transaction() | ||
| transaction.disablesAnimations = true | ||
| return transaction | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,18 +39,11 @@ final class PaymentReviewObservableModel: ObservableObject { | |
| model.strings.invoiceImageAccessibilityLabel | ||
| } | ||
|
|
||
| /** | ||
| Reflects whether the amount field inside the payment information form is currently focused. | ||
| Changes trigger a re-render of `PaymentReviewContentView` so the landscape Done toolbar | ||
| can appear or disappear in sync with keyboard focus. | ||
| */ | ||
| // Reflects amount-field focus so PaymentReviewContentView re-renders the landscape toolbar. | ||
| var isAmountFieldFocused: Bool { | ||
| paymentInformationObservableModel.isAmountFieldFocused | ||
| } | ||
|
zladzeyka marked this conversation as resolved.
Outdated
|
||
|
|
||
| /** | ||
| The localized title for the keyboard Done button. | ||
| */ | ||
| var keyboardDoneButtonTitle: String { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] Can we please add the doc comment back |
||
| containerViewModel.strings.keyboardDoneButtonTitle | ||
| } | ||
|
|
@@ -70,19 +63,14 @@ final class PaymentReviewObservableModel: ObservableObject { | |
| model.delegate?.trackOnPaymentReviewCloseKeyboardClicked() | ||
| } | ||
|
|
||
| /** | ||
| Validates the amount field as if it had just lost focus. | ||
| Called explicitly by the landscape Done button, which resigns first responder via | ||
| UIKit rather than setting `focusedField = nil`. SwiftUI's `@FocusState` update from | ||
| a UIKit `resignFirstResponder` call is not guaranteed to be synchronous, so relying | ||
| solely on `onChange(of: focusedField)` to trigger validation can cause the error | ||
| message to appear only on the second Done press. Calling this directly — mirroring | ||
| what the portrait Done button does — ensures validation runs immediately. | ||
| */ | ||
| // Validates the amount field as if it just lost focus. | ||
| // Called by the landscape Done button which resigns first responder via UIKit — SwiftUI's | ||
| // @FocusState update is not guaranteed synchronous, so validation would otherwise fire | ||
| // only on the second Done press. | ||
| func validateAmountFieldOnKeyboardDismiss() { | ||
|
zladzeyka marked this conversation as resolved.
Outdated
|
||
| paymentInformationObservableModel.handleAmountFocusChange(isFocused: false) | ||
| } | ||
|
|
||
| @Published private var showBanner: Bool | ||
|
|
||
| @Published var cellViewModels: [PageCollectionCellViewModel] = [] | ||
|
|
@@ -209,8 +197,8 @@ final class PaymentReviewObservableModel: ObservableObject { | |
| } | ||
|
|
||
| private func setupBindings() { | ||
| // Forward `isAmountFieldFocused` changes from the inner observable model so that | ||
| // `PaymentReviewContentView` re-renders when the amount field gains or loses focus. | ||
| // Forward isAmountFieldFocused changes so PaymentReviewContentView re-renders | ||
| // its landscape keyboard toolbar when the amount field gains or loses focus. | ||
| paymentInformationObservableModel.$isAmountFieldFocused | ||
| .sink { [weak self] _ in self?.objectWillChange.send() } | ||
| .store(in: &cancellables) | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.