Skip to content

[Swift] Stop emitting ec_color_scheme query param#96

Open
Juanita-Dash wants to merge 1 commit into
mainfrom
swift/remove-ec-color-scheme
Open

[Swift] Stop emitting ec_color_scheme query param#96
Juanita-Dash wants to merge 1 commit into
mainfrom
swift/remove-ec-color-scheme

Conversation

@Juanita-Dash
Copy link
Copy Markdown
Contributor

@Juanita-Dash Juanita-Dash commented May 13, 2026

Part of https://github.com/shop/issues-checkout-kit/issues/906.
This recent PR appended ec_color_scheme to the checkout URL but a decision has been made to no longer have this query param. This PR strips ec_color_scheme emission from the Swift kit:

  • CheckoutProtocol.url(for:): drop the colorScheme parameter and the
    ec_color_scheme queryItem; ec_version still emitted
  • CheckoutViewController.init and ShopifyCheckoutKit.preload/present:
    drop the colorScheme argument at the 4 call sites
  • Adds CheckoutProtocolURLTests.swift to bring Swift coverage to parity with the Android kit's existing UriExtensionsTest

Android equivalent landed in #95.

🤖 Generated with Claude Code

@Juanita-Dash Juanita-Dash requested a review from a team as a code owner May 13, 2026 18:29
@Juanita-Dash Juanita-Dash self-assigned this May 13, 2026
Copy link
Copy Markdown

@toneymathews toneymathews left a comment

Choose a reason for hiding this comment

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

leaving one question, lgtm otherwise

var onFailAction: ((CheckoutError) -> Void)?

public init(checkout url: URL) {
checkoutURL = CheckoutProtocol.url(for: url, colorScheme: ShopifyCheckoutKit.configuration.colorScheme.rawValue)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need to remove it on the configuration object itself?

@Juanita-Dash Juanita-Dash force-pushed the swift/remove-ec-color-scheme branch from bf9bf8a to 782815b Compare May 13, 2026 19:06
@Juanita-Dash Juanita-Dash requested review from a team, kiftio and markmur May 13, 2026 19:20
Comment on lines +42 to +46
@Test func doesNotEmitEcColorScheme() {
let result = CheckoutProtocol.url(for: baseURL)
let names = queryItems(result).map(\.name)
#expect(names.contains("ec_color_scheme") == false)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No need for this test since the app code doesn't actually include the param - even conditionally

Part of shop/issues-checkout-kit#906.
The Checkout Kits will no longer thread color scheme through ECP. This PR strips ec_color_scheme emission from the Swift kit:

- CheckoutProtocol.url(for:): drop the colorScheme parameter and the
  ec_color_scheme queryItem; ec_version still emitted
- CheckoutViewController.init and ShopifyCheckoutKit.preload/present:
  drop the colorScheme argument at the 4 call sites

CheckoutProtocol.url(for:colorScheme:) is public but PR #65 has not yet
been released (no 3.8.0 tag), so removing the parameter outright is safe.
Android equivalent landed in #95.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Juanita-Dash Juanita-Dash force-pushed the swift/remove-ec-color-scheme branch from 782815b to 4778478 Compare May 14, 2026 13:48
@Juanita-Dash Juanita-Dash requested review from a team and markmur May 14, 2026 13:51
@Juanita-Dash Juanita-Dash added the #gsd:50662 Rebase Checkout Kit on UCP label May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants