Skip to content

feat: calculator v61 redesign & os widget#554

Draft
ovitrif wants to merge 7 commits into
feat/os-widgetsfrom
feat/calculator-widget-v61
Draft

feat: calculator v61 redesign & os widget#554
ovitrif wants to merge 7 commits into
feat/os-widgetsfrom
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 Bitcoin Calculator widget with the v6.1 two-row card treatment and Bitkit number pad interaction.
  2. Adds the native iOS Home Screen Calculator widget in small and medium sizes, backed by App Group mirrored calculator values and currency settings.
  3. Adds the Calculator preview carousel and focused formatter/input coverage, including a crash fix found during simulator validation.

Mirrors the Calculator app and OS widget work from synonymdev/bitkit-android#942.

Linked Issues/Tasks

N/A

Screenshot / Video

Not attached in this pass.

QA Notes

Manual Tests

  • 1. Widgets → Bitcoin Calculator: small and wide previews render the v6.1 two-row calculator card.
  • 2. Widgets → Bitcoin Calculator → Save Widget → Home: Calculator appears in the widget list with the persisted Bitcoin and fiat values.
  • 3. Home → Calculator widget → tap Bitcoin row: standard black Bitkit number pad opens, tab bar hides, modern Bitcoin uses space grouping, and fiat conversion updates after number input.
  • 4. Home → Calculator widget → tap fiat row → enter 1, decimal, 0: one-decimal input shows the dimmed trailing zero placeholder in the fixed input position without cursor spacing/jump, and Bitcoin conversion updates.
  • 5. Home → Calculator widget → active number pad → drag/scroll widget list, tap Price/Blocks outside the calculator, or tap topbar: number pad hides and the widget list does not scroll underneath it.
  • 6. regression: Settings → General → Default Unit → switch Modern/Classic → Home → Calculator widget: Bitcoin amount is preserved while denomination formatting changes.
  • 7. iOS Home Screen → add Bitkit Calculator small widget: two read-only rows render without trailing labels.
  • 8. iOS Home Screen → add Bitkit Calculator medium widget: two read-only rows render with Bitcoin and fiat labels.
  • 9. iOS 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 simulator validation completed on iPhone 16 Pro iOS 18.5 with the provided regtest restore path: restored wallet, opened Widgets → Bitcoin Calculator, verified preview render, saved the widget, opened the Home Calculator number pad, and confirmed 1 updated 10 000 / $6.66 to 100 001 / $66.59.
  • Runtime crash found and fixed during validation: the previous grouped formatter recursed through a private joined(separator:) helper and crashed when opening the Calculator preview; 76f4cc34 replaces it with direct left-to-right grouping.
  • Local: swiftformat passed for changed Swift files.
  • Local: node scripts/validate-translations.js passed with 0 errors.
  • Local: xcodebuild ... -only-testing:BitkitTests/CalculatorWidgetTests build-for-testing passed.
  • Local: removed the known static LDKNodeFFI.framework simulator install stub from DerivedData, then xcodebuild test-without-building ... -only-testing:BitkitTests/CalculatorWidgetTests passed with 7 tests and 0 failures.
  • Local: XcodeBuildMCP build_sim for Bitkit Debug on iPhone 16 Pro iOS 18.5 passed, including the Widget extension target; remaining warnings are pre-existing PubkyImage.swift Swift 6 async lock/unlock warnings.
  • Local QA follow-up on iPhone 17 Pro iOS 26.3.1: verified the black shared number pad surface, calculator lift above the pad with a clean header, scroll attempts dismiss the pad instead of scrolling underneath it, outside widget taps dismiss the pad, HeaderMenu dismisses the pad and opens the drawer, and 1.0 renders as continuous 1.00 with the placeholder zero fixed in place.
  • Local QA follow-up from Simulator 2026-05-18 005849.mp4: matched the Android bitkit-android-5 focus fix by truncating focused widgets after Calculator, hiding Add Widget while focused, anchoring the first-position Calculator with measured top padding, and removing broad implicit focus animations that caused layout jumps.
  • Bot review fix: disabled WidgetKit content margins for the Calculator widget so the medium two-row layout has enough vertical space inside the actual Home Screen widget frame.
  • Local: XcodeBuildMCP build_run_sim for Bitkit Debug on iPhone 17 Pro iOS 26.3.1 passed after the QA fixes.
  • Local: XcodeBuildMCP test_sim -only-testing:BitkitTests/CalculatorWidgetTests passed with 7 tests and 0 failures after the QA fixes.
  • CI: Run Tests, build-local, and build-staging passed; e2e jobs were still running when last checked.

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".

Comment thread BitkitWidget/CalculatorHomeScreenWidget.swift Outdated
@ovitrif ovitrif marked this pull request as draft May 17, 2026 14:53
@ovitrif ovitrif changed the title feat: calculator widget v61 + OS widget feat: calculator v61 redesign & os widget May 17, 2026
@ovitrif ovitrif self-assigned this May 17, 2026
@ovitrif ovitrif added this to the 2.3.0 milestone May 17, 2026
@ovitrif ovitrif marked this pull request as ready for review May 17, 2026 17:32
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: 76f4cc3403

ℹ️ 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".

Comment thread Bitkit/Components/Widgets/CalculatorWidget.swift Outdated
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: 2f07d5c702

ℹ️ 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".

Comment thread Bitkit/Components/Widgets/CalculatorWidget.swift
@piotr-iohk
Copy link
Copy Markdown
Collaborator

Notes from testing:

1.
As far as in-app widget It would be nice if tapping outside closed the keyboard. This is the case on Android and it is an intuitive UX. On iOS it is basically not possible to close the keyboard other than going out from Widgets screen.

Screen.Recording.2026-05-18.at.12.41.59.mov

2.
As far as Calculator OS widget, same comment as in case of Andorid: synonymdev/bitkit-android#942 (comment)

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: 3c462f2f9a

ℹ️ 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".

Comment thread BitkitWidget/CalculatorHomeScreenWidget.swift
Base automatically changed from feat/facts-v61 to feat/os-widgets May 18, 2026 12:49
@ovitrif ovitrif marked this pull request as draft May 18, 2026 13:14
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.

2 participants