fix: limit blocks widget to 4 fields#956
Draft
jvsena42 wants to merge 1 commit into
Draft
Conversation
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.
Fixes #948
This PR:
Description
Following up on the Blocks widget edit settings, the field selection is now capped at four. An already-selected field can always be turned off, but a fifth selection is ignored once the limit is reached. The section header now reads "DATA (MAX 4)", and the existing Preview and Reset actions are unchanged.
The "Source" field has been removed everywhere — from the in-app edit/preview screens, the home-screen widget configuration, and the rendered cards — and its data is no longer fetched or stored. The mempool.space attribution now lives in the widget description text instead of a toggleable row.
The row-building logic, which was previously duplicated across the in-app wide and compact cards and the home-screen wide and compact layouts, plus repeated as hardcoded toggle rows in both edit screens, is now driven by a single ordered set of fields (Block, Time, Date, Transactions, Size, Fees). Each ViewModel exposes one toggle entry point that enforces the limit, and legacy preferences imported from the React Native app (which had no cap and more fields) are capped on migration.
This mirrors the already-merged iOS v61 implementation.
Preview
os-widget.webm
in-app-widget.webm
QA Notes
Manual Tests
Automated Checks
limitedToMaxmigration cap inapp/src/test/java/to/bitkit/models/widget/BlocksWidgetFieldTest.kt.app/src/androidTest/java/to/bitkit/ui/screens/widgets/blocks/BlockCardTest.kt.compileDevDebugKotlin,testDevDebugUnitTest,detekt, andcompileDevDebugAndroidTestKotlinall pass.