Skip to content

feat: calculator widget v61 + OS widget#554

Open
ovitrif wants to merge 1 commit into
feat/facts-v61from
feat/calculator-widget-v61
Open

feat: calculator widget v61 + OS widget#554
ovitrif wants to merge 1 commit into
feat/facts-v61from
feat/calculator-widget-v61

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 16, 2026

Description

This PR:

  1. Refreshes the in-app Calculator widget with the v6.1 row/card treatment and Bitkit number pad flow.
  2. Adds a native iOS Home Screen Calculator widget for small and medium families, backed by App Group mirrored calculator values and currency settings.
  3. Adds the Calculator v61 preview carousel, focused formatter/input coverage, and the user-facing changelog fragment.

Mirrors the v61 calculator app and OS widget work from bitkit-android#942.

Linked Issues/Tasks

N/A

Screenshot / Video

VIDEO_1

QA Notes

Manual Tests

  • 1. Widgets → Bitcoin Calculator: small and wide previews render the v6.1 two-row calculator card.
  • 2. Home → Calculator widget → tap Bitcoin row: Bitkit number pad opens, modern Bitcoin uses space grouping, invalid input flashes the pressed key red, and fiat conversion updates.
  • 3. Home → Calculator widget → tap fiat row: Bitkit number pad opens, fiat grouping uses commas, one-decimal input shows the dimmed trailing zero placeholder, and Bitcoin conversion updates.
  • 4. regression: Settings → General → Default Unit → switch Modern/Classic: Calculator preserves the Bitcoin amount while changing denomination formatting.
  • 5. Home Screen → add Bitkit Calculator small widget: two read-only rows render without trailing labels.
  • 6. Home Screen → add Bitkit Calculator medium widget: two read-only rows render with Bitcoin and fiat labels.
  • 7. Home Screen → tap Calculator OS widget: Bitkit opens without auto-focusing calculator input.

Automated Checks

  • Unit tests added: BitkitTests/CalculatorWidgetTests.swift covers calculator grouping, decimal placeholder behavior, number-pad delete/decimal caps, localized comma input normalization, symbol shortening, and classic BTC-to-sats conversion.
  • Local: swiftformat Bitkit/Models/CalculatorWidgetData.swift Bitkit/Services/Widgets/CalculatorHomeScreenWidgetOptionsStore.swift Bitkit/Components/Widgets/CalculatorWidget.swift Bitkit/Components/NumberPad.swift Bitkit/Views/Widgets/CalculatorWidgetPreviewView.swift BitkitWidget/CalculatorHomeScreenWidget.swift BitkitTests/CalculatorWidgetTests.swift Bitkit/Models/Currency.swift Bitkit/MainNavView.swift BitkitWidget/BitkitWidget.swift
  • Local: node scripts/validate-translations.js
  • Local: xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 16 Pro,OS=18.5' build
  • Local: xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit -configuration Debug -destination 'platform=iOS Simulator,id=8E6C558B-8483-4237-920D-C16B69D61B51,arch=arm64' -only-testing:BitkitTests/CalculatorWidgetTests build-for-testing
  • Local simulator launch: installed the built app on iPhone 16 Pro iOS 18.5 after removing the known static LDKNodeFFI.framework build artifact stub from DerivedData, then launched to.bitkit successfully.
  • Attempted: xcodebuild ... -only-testing:BitkitTests/CalculatorWidgetTests test compiled but could not execute because simulator app installation failed on the existing LDKNodeFFI.framework static-framework bundle stub.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c2d065d16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

CalculatorHomeScreenWidgetEntryView(entry: entry)
}
.configurationDisplayName("widgets__calculator__name")
.description("widgets__calculator__description")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Use a static calculator widget description

The home-screen widget gallery cannot perform the app's t(..., variables:) substitution here, but widgets__calculator__description is the in-app string that contains {fiatSymbol}. As a result, when users add the new Calculator OS widget from the iOS widget gallery, the description is shown with the literal {fiatSymbol} placeholder instead of a real currency symbol or generic text.

Useful? React with 👍 / 👎.

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