refactor: share in-app & OS widget content#557
Merged
Conversation
pwltr
requested changes
May 20, 2026
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
re-drafted to sync with target branch. Github is not displaying the update button for some reason |
3374163 to
78b5f58
Compare
Member
Author
|
Tests after rebase and implement the space-between logic for news and blocks iphone16-home-widgets.mp4iphone16-in-app-widgets.mp4iphoneSE-home-widgets.mp4iphone-se-in-app-widgets.mp4 |
pwltr
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
widgetRenderingMode.Description
Before this PR, only the Weather widget shared its SwiftUI content between the app and the WidgetKit extension. Blocks, Price, News, and Facts each kept a second, hand-written copy of their layout inside
BitkitWidget/, and the two copies had already drifted (different fonts vs. text components, spacing, and colors). Each widget now has one content view per layout (wide + compact) underBitkit/Components/Widgets/, reused by the in-app feed, the carousel preview, and the home-screen widget.Colors are centralized in a new
WidgetPalettedriven bywidgetRenderingMode: full color maps to the dark-theme palette, while accented/monochrome Smart Stack rendering falls back to system colors with a transparent background. Outside a widget the mode defaults to full color, so the in-app widgets keep their current appearance. This also fixes the Weather widget, which previously hard-coded white text and rendered illegibly in tinted stacks.The shared content views render inner content only; the card background, padding, and corner radius are applied by the caller —
BaseWidgetin the feed, the preview card in the carousel, or.containerBackgroundon the home screen. The Bitcoin Facts badge and the Price chart became rendering-mode-aware so both targets share one implementation, and the Blocks row spacing now usesViewThatFitsso it tightens automatically on iPhone SE instead of clipping. Localization keys are shared between the in-app and home-screen widgets and synced with bitkit-android.Net change removes roughly 600 lines of duplicated view code.
Linked Issues/Tasks
N/A
Screenshot / Video
iphone-16-home-widgets.mp4
SE-home-widgets.mp4
iphone-16-in-app-widgets.mp4
iphone-SE-in-app-widgets.mp4
QA Notes
Manual Tests
regression:edit options → preview and feed reflect the changes.Automated Checks
xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit -destination 'platform=iOS Simulator,name=iPhone 16' build— app +BitkitWidgetExtensioncompile and link clean. Use a concrete arm64 simulator; thegeneric/platform=iOS Simulatordestination trips the pre-existing x86_64 link gap in the unrelatedBitkitNotificationtarget.changelog.d/next/*-widget-v61.added.mdon the base branch.