Skip to content

feat: blocks widget v61 + OS widget#547

Draft
jvsena42 wants to merge 4 commits intofeat/headlines-v61from
feat/blocks-v61
Draft

feat: blocks widget v61 + OS widget#547
jvsena42 wants to merge 4 commits intofeat/headlines-v61from
feat/blocks-v61

Conversation

@jvsena42
Copy link
Copy Markdown
Member

@jvsena42 jvsena42 commented May 7, 2026

This PR:

  1. Redesigns the in-app Bitcoin Blocks widget to match Figma v61.
  2. Adds a native iOS Home Screen Bitcoin Blocks widget supporting Small and Medium families.
  3. Restructures the Blocks edit screen and adds a v61 preview screen.
  4. Reduces the Blocks option set to seven fields (Block, Time, Date, Transactions, Size, Fees, Source) and adds Fees fetched from mempool.space.

Description

The in-app Bitcoin Blocks widget gets the v61 layout: a vertical list of icon + label + value rows where each icon is rendered in brand orange. The compact (small) variant drops the label column and only renders icon + value rows so the small card stays readable.

The option set drops weight, difficulty, hash, and merkleRoot and adds a new fees field that surfaces total block fees. Defaults are now Block, Time, Date, and Transactions. BlocksWidgetOptions keeps a custom Codable shim so existing on-disk preferences from older builds decode without losing the four still-supported fields. The mempool fetcher moves to /api/v1/block/{hash} so it can read extras.totalFees.

A new Bitcoin Blocks home-screen widget ships as BitkitBlocksWidget, supporting .systemSmall and .systemMedium families. Both sizes cap rendering at four rows using the same default-priority logic — Block, Time, Date, Transactions take precedence; Size, Fees, and Source fill any remaining slot only when one of the defaults is toggled off. The widget mirrors the in-app options through the existing group.bitkit App Group via a new BlocksHomeScreenWidgetOptionsStore, and the timeline provider refreshes every ~15 minutes (with cache fallback when the network call fails). Rendering honors widgetRenderingMode so the widget reads correctly in full-color, accented (Liquid Glass / StandBy), and lock-screen modes.

The edit screen is restructured into a single DATA section, with each row showing the brand-orange field icon next to its label and live value. The WidgetEditView now treats .blocks like .price — the navigation bar shows the widget name and the description block is hidden.

The preview screen is rewritten to mirror the price/headlines preview: description, "Widget Settings" cell, Compact↔Wide carousel, size label and dot indicator, and Save Widget / Delete buttons.

While in there: copied the seven Blocks-widget icons (cube, clock, calendar, arrow-up-down, file-text, coins, globe) into the widget extension's asset catalog so the home-screen widget can render them, and updated WidgetsBackupConverter to map the Android showFees preference into the new iOS field.

Mirrors the v61 redesign shipped on Android in bitkit-android#922.

Linked Issues/Tasks

N/A

Screenshot / Video

Simulator.Screen.Recording.-.iPhone.16.-.2026-05-07.at.16.01.54.mp4

QA Notes

Manual Tests

  • 1. Wallet home → in-app Bitcoin Blocks widget renders v61 layout: icon + label + value rows in brand orange.
  • 2a. Widget feed → Bitcoin Blocks → preview: centered "Bitcoin Blocks" top bar (no menu/drawer button), description, "Widget Settings" cell, Compact↔Wide carousel, size label, dot indicator, Save Widget button.
    • 2b. Preview → swipe carousel: size label flips between Small and Wide.
    • 2c. If widget already saved: Delete and Save Widget buttons both appear.
  • 3a. Preview → Widget Settings → edit screen: centered "Bitcoin Blocks" top bar (no menu/drawer button, no description block), DATA section header, seven toggle rows in order Block / Time / Date / Transactions / Size / Fees / Source, each with brand-orange icon + label + live value.
    • 3b. Toggle defaults off → Reset enabled, Preview disabled when all toggles are off.
    • 3c. Toggle Fees on → save → in-app widget shows the Fees row with the live value.
  • 4. Home screen long-press → + → search "Bitkit": Bitcoin Blocks appears with Small and Medium previews (no Large).
  • 5a. Add Blocks at Medium → wide layout renders only the four highest-priority enabled rows (Block, Time, Date, Transactions by default).
    • 5b. Toggle Time off + Size on → Medium shows Block, Date, Transactions, Size (defaults still take priority, Size fills the remaining slot).
  • 6a. Add Blocks at Small → compact layout renders icon + value rows, capped at 4 with the same priority logic.
    • 6b. Toggle Date off + Fees on + Source on → Small shows Block, Time, Transactions, Fees (Source dropped because the cap is 4 and Fees is declared first among extras).
  • 7. Edit toggles in app → home-screen widget reloads within ~1s and reflects new toggles (verify on Medium and Small).

@jvsena42 jvsena42 self-assigned this May 7, 2026
jvsena42 added 2 commits May 7, 2026 10:59
# Conflicts:
#	Bitkit/ViewModels/WidgetsViewModel.swift
#	Bitkit/Views/Widgets/WidgetEditLogic.swift
#	Bitkit/Views/Widgets/WidgetEditView.swift
@jvsena42
Copy link
Copy Markdown
Member Author

jvsena42 commented May 7, 2026

feature implemented, pending a code cleanup

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