Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(suite-native): show content in the bottom screen inset #17415

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

yanascz
Copy link
Contributor

@yanascz yanascz commented Mar 5, 2025

  • allow content to be displayed in the bottom screen inset
  • adjust screen content wrapper to avoid scrolling glitches
  • adjust bottom padding on some screens accordingly

Screenshots:

image

@yanascz yanascz added the mobile Suite Lite issues and PRs label Mar 5, 2025
@yanascz yanascz self-assigned this Mar 5, 2025
@yanascz yanascz requested a review from a team as a code owner March 5, 2025 11:13
Copy link

coderabbitai bot commented Mar 5, 2025

Walkthrough

The changes update several UI components across different modules. In one screen, the removal of the isScrollable property on the Screen component reverts control to its default scroll handling. Another screen modification removes a dependency on external spacing utilities by eliminating bottom padding in the style definition. Updates in the navigation component include altering style type definitions: properties related to bottom padding are removed, the isScrollable flag is replaced by a new applyBottomInset property in the content style, and a new footer style is introduced. Additionally, the KeyboardAwareScrollView behavior is adjusted by changing its contentInsetAdjustmentBehavior from "automatic" to "never", altering inset adjustments when the keyboard appears. Finally, the vertical padding in a transactions list component is narrowed to just top padding. No public API declarations have been modified in these changes.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bbf3b3 and 870a1df.

📒 Files selected for processing (5)
  • suite-native/module-accounts-management/src/screens/AccountDetailContentScreen.tsx (0 hunks)
  • suite-native/module-onboarding/src/screens/WelcomeScreen.tsx (1 hunks)
  • suite-native/navigation/src/components/Screen.tsx (3 hunks)
  • suite-native/navigation/src/components/ScreenContentWrapper.tsx (1 hunks)
  • suite-native/transactions/src/components/TransactionsList/TransactionList.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • suite-native/module-accounts-management/src/screens/AccountDetailContentScreen.tsx
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: EAS Update
  • GitHub Check: prepare_android_test_app
  • GitHub Check: Setup and Cache Dependencies
  • GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (10)
suite-native/module-onboarding/src/screens/WelcomeScreen.tsx (1)

29-31: Style refactoring to improve bottom inset handling

The removal of bottom padding from buttonWrapperStyle aligns with the PR's objective to display content in the bottom screen inset. This change works in conjunction with the updated Screen component which now manages bottom insets more effectively.

suite-native/navigation/src/components/Screen.tsx (6)

33-51: Clean-up of unnecessary style properties

Good refactoring of the screen container style by removing unused properties related to bottom padding. This simplification makes the code more maintainable.


53-68: Improved control over bottom inset padding

Excellent enhancement to the screen content style by introducing the applyBottomInset flag that conditionally applies the bottom safe area inset. This provides more precise control over the layout and addresses the core objective of this PR.


70-75: Good addition of footer styling with inset support

The new screenFooterStyle properly applies bottom insets when needed, providing a consistent visual appearance. This is a valuable addition that complements the other changes.


99-100: Better logic for determining when to apply bottom insets

This condition appropriately considers the tab bar context, user setting, and keyboard visibility to decide when to apply bottom insets. Good approach that handles different UI states.


125-130: Proper style application to content with conditional bottom inset

The update to apply bottom inset to content only when there's no footer is logical and ensures correct spacing hierarchy throughout the screen.


135-141: Improved footer handling with keyboard-aware sticky view

Excellent implementation of the KeyboardStickyView for the footer that properly respects safe area insets. This will ensure that interactive elements remain accessible when the keyboard is shown.

suite-native/transactions/src/components/TransactionsList/TransactionList.tsx (1)

69-71: Removed bottom padding for better inset handling

Good change to only apply top padding instead of vertical padding, aligning with the PR's objective of displaying content in the bottom screen inset. This allows the bottom inset to be managed by the Screen component instead.

suite-native/navigation/src/components/ScreenContentWrapper.tsx (2)

40-40: Important scroll behavior change to prevent glitches

Changing contentInsetAdjustmentBehavior from "automatic" to "never" is a key fix that prevents scrolling glitches. This ensures that the custom bottom inset handling in the Screen component works correctly without conflict from the system's automatic adjustments.

This change is essential as it prevents double-adjustment of insets which can cause visual issues when scrolling, especially when the keyboard appears or disappears.


32-49:

❓ Verification inconclusive

Verify scrolling behavior across different devices and orientations

The changes to the scroll view behavior look good, but it's worth testing on various device sizes and orientations to ensure consistent behavior throughout the app.


🏁 Script executed:

#!/bin/bash
# Check if there are any similar components in the app that might need the same fix

# Look for other KeyboardAwareScrollView instances that might need updating
echo "Searching for other KeyboardAwareScrollView instances with contentInsetAdjustmentBehavior..."
rg "KeyboardAwareScrollView.*contentInsetAdjustmentBehavior.*automatic" --type tsx

Length of output: 307


Verify scrolling behavior across different devices and orientations

The changes to the scroll view behavior look correct. However, please ensure that you manually test the scrolling on different device sizes and orientations. In addition, to maintain consistency across the app, double-check for any other instances of KeyboardAwareScrollView in your .tsx files with the following command:

rg "KeyboardAwareScrollView.*contentInsetAdjustmentBehavior.*automatic" -g "*.tsx"
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Mar 5, 2025

🚀 Expo preview is ready!

  • Project → trezor-suite-preview
  • Platforms → android, ios
  • Scheme → trezorsuitelite
  • Runtime Version → 26
  • More info

Learn more about 𝝠 Expo Github Action

@yanascz yanascz merged commit 9e34543 into develop Mar 7, 2025
18 checks passed
@yanascz yanascz deleted the fix/native/screen-bottom-inset branch March 7, 2025 12:56
@STew790
Copy link
Contributor

STew790 commented Mar 17, 2025

QA OK
OK on iOS, followup for Android here.

Info
25.3.1 78ce09c

@STew790 STew790 added the QA OK Issue passed QA without any blocker label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Suite Lite issues and PRs QA OK Issue passed QA without any blocker
Projects
Status: ✅ Approved
Development

Successfully merging this pull request may close these issues.

3 participants