Skip to content

fix: align widget preview defaults with ios#990

Merged
ovitrif merged 3 commits into
masterfrom
fix/widget-preview-defaults
Jun 5, 2026
Merged

fix: align widget preview defaults with ios#990
ovitrif merged 3 commits into
masterfrom
fix/widget-preview-defaults

Conversation

@piotr-iohk

@piotr-iohk piotr-iohk commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #985 review feedback from @piotr-iohk.

This PR:

  1. Defaults the widget preview size carousel to compact for not-yet-saved widgets, matching iOS.
  2. Preserves add-widgets list scroll position when navigating back from a widget preview.
  3. Aligns the compact price widget pair-row test tag with iOS so shared E2E assertions keep working.

Description

Addresses post-merge review notes on #985:

  • Default preview size: Android previously opened price and news on wide while iOS always proposes compact for new widgets. The preview draft now starts on compact when the widget is not saved yet, while still restoring the persisted size for saved widgets.
  • Scroll position: Returning from a preview to the add-widgets gallery no longer resets scroll to the top.
  • Price test tag: Compact price cards now expose PriceWidgetRow-{pair} like iOS, so widgets E2E does not need size-specific assertions.

Preview

Screen.Recording.2026-06-05.at.08.57.24.mov

QA Notes

Manual Tests

  • 1. Add Widgets → scroll down → open Facts preview → back: list stays at the same scroll position.
  • 2a. Add Widgets → open Price (not on home) preview: size carousel starts on Small.
    • 2b. Swipe to Wide → Save: home shows wide price layout.
  • 3. Open preview for an already-saved wide Price widget: carousel opens on Wide.
  • 4. regression: widgets E2E @widgets_1 still passes after rebuilding the E2E APK.

Automated Checks

  • Unit tests added: cover preview draft defaulting and persisted-size behavior in app/src/test/java/to/bitkit/ui/screens/widgets/WidgetSizeDraftTest.kt.
  • Unit tests unchanged: existing WidgetSizeTest suite still passes.
  • E2E: widgets suite passes locally with rebuilt APK.
  • CI: standard compile, unit test, and detekt checks run by the PR bot.

Made with Cursor

@piotr-iohk piotr-iohk requested review from jvsena42 and ovitrif June 5, 2026 07:07
Co-authored-by: Cursor <cursoragent@cursor.com>

@ovitrif ovitrif left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tAck

@ovitrif ovitrif added this to the 2.3.0 milestone Jun 5, 2026
@ovitrif ovitrif enabled auto-merge June 5, 2026 08:02
@ovitrif ovitrif merged commit b93967d into master Jun 5, 2026
17 checks passed
@ovitrif ovitrif deleted the fix/widget-preview-defaults branch June 5, 2026 08:05
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