Skip to content

feat: calculator v61 redesign#554

Open
ovitrif wants to merge 5 commits into
masterfrom
feat/calculator-widget-v61
Open

feat: calculator v61 redesign#554
ovitrif wants to merge 5 commits into
masterfrom
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. Ports the Android calculator polish from synonymdev/bitkit-android#942, including outside-tap dismissal, long-press backspace clear, stable placeholder/cursor behavior, first-position layout handling, and focused-widget scroll locking.
  3. Keeps the Calculator OS widget out of scope for now, matching the Android PR decision; the iOS OS widget work is preserved on ovi/calculator-os-widget-v61-backup-ios.
  4. Adds Calculator preview carousel support plus focused formatter/input coverage for grouping, decimal placeholders, localized decimal entry, clearing, and BTC supply limits.

Linked Issues/Tasks

Related: synonymdev/bitkit-android#942

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: black Bitkit number pad opens, tab bar hides, lower widgets disappear, and the focused layout settles without a jump.
  • 4. Home → Calculator widget → Bitcoin row → enter 1: modern Bitcoin uses space grouping and fiat conversion updates.
  • 5. Home → Calculator widget → active Bitcoin row → long-press backspace: the active input clears.
  • 6. 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.
  • 7. Home → Calculator widget → active number pad → tap Suggestions, Price/Blocks, or topbar outside the calculator: first outside interaction hides the number pad without triggering the underlying widget action.
  • 8. Home → Calculator widget → active number pad → drag/scroll widget list: the number pad hides and the list does not scroll underneath it.
  • 9. Home → widget edit → move Calculator to first, middle, and last positions → focus/dismiss in each position: focused calculator and number pad settle consistently with no lower widgets visible while focused.
  • 10. regression: Settings → General → Default Unit → switch Modern/Classic → Home → Calculator widget: Bitcoin amount is preserved while denomination formatting changes.
  • 11. iOS Home Screen → add Bitkit widget: Calculator is not offered as an OS widget in this PR.

Automated Checks

  • Unit tests added: BitkitTests/CalculatorWidgetTests.swift covers calculator grouping, decimal placeholder behavior, number-pad delete/clear, decimal caps, localized comma input normalization, localized decimal key handling, fiat-only persistence, symbol shortening, classic BTC-to-sats conversion, and classic BTC max-supply rejection.
  • Local: swiftformat passed for changed Swift files.
  • Local: node scripts/validate-translations.js passed with 0 errors.
  • Local: git diff --check passed.
  • Local: xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit -configuration Debug -destination 'platform=iOS Simulator,name=iPhone Air,OS=26.4' -derivedDataPath build/CalculatorWidgetTests -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 11 tests and 0 failures.
  • CI triage: reviewed failed local E2E artifacts from run 26181335863; edit-mode widget root identifiers now yield to child action buttons so the default-widget delete flow can find them.
  • Local iPhone Air simulator smoke on iOS 26.4: xcrun simctl launch 90203221-2CC7-46AA-8370-759E31ED06FC to.bitkit passed after the replay, and a screenshot confirmed Home rendered with the regtest wallet state.
  • Local connected iPhone Air device check: xcodebuild ... -destination 'id=00008150-001C691C2604401C' ... build passed; after removing the known static LDKNodeFFI.framework device install stub, xcrun devicectl device install app ... Bitkit.app installed successfully. Launch was blocked by the physical device lock screen, so no on-device runtime smoke was observed.

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 Outdated
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
@ovitrif ovitrif changed the title feat: calculator v61 redesign & os widget feat: calculator v61 redesign May 20, 2026
@ovitrif ovitrif force-pushed the feat/calculator-widget-v61 branch from 122da44 to 87b302a Compare May 20, 2026 18:01
@ovitrif ovitrif changed the base branch from feat/os-widgets to master May 20, 2026 18:01
@ovitrif ovitrif marked this pull request as ready for review May 20, 2026 18:02
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: 87b302a6fc

ℹ️ 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
Comment thread Bitkit/Views/Widgets/CalculatorWidgetPreviewView.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: 038338ec9e

ℹ️ 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/Models/CalculatorWidgetData.swift
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: d007e0500d

ℹ️ 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
@pwltr
Copy link
Copy Markdown
Contributor

pwltr commented May 21, 2026

Tested on iPhone 17 simulator and iPhone SE on-device:

It basically only works when the calculator widget is at the very top. In every other case the widget is behind the custom keyboard, even when there would be enough space it "pulls" it down again behind the number pad. Also, I found myself repeatedly in a state where I could not scroll back up to the home screen again.

Simulator.Screen.Recording.-.iPhone.17.-.2026-05-21.at.16.46.09.mov

I'm wondering what is the reasoning for moving away from the on-screen keyboard? Also not clear how this would look for with small variant in the next iteration.

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.

3 participants