Skip to content

Conversation

@somebodyLi
Copy link
Contributor

@somebodyLi somebodyLi commented Jul 18, 2025

Summary by CodeRabbit

  • New Features

    • Added haptic feedback (vibration) on specific keyboard interactions for enhanced tactile response.
    • Introduced an optional app guide display on the homescreen.
  • Improvements

    • PIN verification and unlock functions now consistently return detailed results, improving reliability across PIN-related flows.
    • User-facing string translations in recovery flows now use a more concise alias for improved readability.
    • Transaction confirmation titles in Ethereum now adapt based on transaction value for clearer user prompts.
    • Device storage and serial number retrieval functions now always return a string, never None.
    • Homescreen setup now optionally displays the app guide based on user settings.
    • Share recovery screens updated to handle multiple share groups with improved progress tracking.
  • Bug Fixes

    • Simplified and standardized PIN result handling throughout the app for greater consistency.
  • Chores

    • Internal module imports and structure updated for maintainability.
    • Removed deprecated helper functions and unused conditional logic for cleaner codebase.

@somebodyLi somebodyLi requested a review from a team as a code owner July 18, 2025 08:56
@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

The changes update PIN verification to always return a tuple, refactor related logic, and add a trezor.config wrapper module. Haptic feedback is added to keyboard components. The homescreen setup now optionally shows an app guide. Some imports and return types are adjusted for clarity and consistency.

Changes

Files/Group Change Summary
core/embed/extmod/modtrezorconfig/modtrezorconfig.c Updated check_pin return type annotation from bool to tuple[bool, int].
core/src/trezor/config.py (new) Added wrapper module for PIN functions; always returns tuple; adds vibration on error.
core/src/all_modules.py Added trezor.config import.
core/src/trezor/init.py Removed import of trezorconfig as config.
core/src/apps/base.py Added show_app_guide parameter to set_homescreen; triggers app guide if set.
core/src/session.py Calls set_homescreen(show_app_guide=...); removes old app guide scheduling logic.
core/src/apps/common/request_pin.py Simplified PIN result unpacking; always expects tuple; passes auto_vibrate explicitly.
core/src/apps/management/change_pin.py Simplified PIN result unpacking; always expects tuple.
core/src/apps/management/change_wipe_code.py Uses first element of PIN check result tuple for validity.
core/src/apps/management/recovery_device/init.py Uses _ alias for translations; simplifies PIN result unpacking.
core/src/trezor/lvglui/scrs/components/keyboard.py Adds vibration on specific keyboard events/buttons.
core/src/trezor/lvglui/scrs/template.py Changes event handler to use nav_btn instead of select_btn for Turbo screen.
core/src/trezor/ui/layouts/lvgl/init.py Removes vibration on PIN request subprompt.
core/src/storage/device.py Ensures get_storage and get_serial never return None; returns empty string if unset.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between bff1a66 and 669a9a4.

⛔ Files ignored due to path filters (1)
  • core/mocks/generated/trezorconfig.pyi is excluded by !**/generated/**
📒 Files selected for processing (18)
  • core/embed/extmod/modtrezorconfig/modtrezorconfig.c (1 hunks)
  • core/src/all_modules.py (1 hunks)
  • core/src/apps/base.py (2 hunks)
  • core/src/apps/common/request_pin.py (3 hunks)
  • core/src/apps/ethereum/layout.py (1 hunks)
  • core/src/apps/ethereum/onekey/sign_tx.py (1 hunks)
  • core/src/apps/management/change_pin.py (2 hunks)
  • core/src/apps/management/change_wipe_code.py (1 hunks)
  • core/src/apps/management/recovery_device/__init__.py (4 hunks)
  • core/src/apps/management/recovery_device/homescreen.py (3 hunks)
  • core/src/session.py (1 hunks)
  • core/src/storage/device.py (2 hunks)
  • core/src/trezor/__init__.py (0 hunks)
  • core/src/trezor/config.py (1 hunks)
  • core/src/trezor/lvglui/scrs/components/keyboard.py (6 hunks)
  • core/src/trezor/lvglui/scrs/template.py (3 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (0 hunks)
  • core/src/trezor/utils.py (1 hunks)
💤 Files with no reviewable changes (2)
  • core/src/trezor/init.py
  • core/src/trezor/ui/layouts/lvgl/init.py
✅ Files skipped from review due to trivial changes (1)
  • core/src/trezor/utils.py
🚧 Files skipped from review as they are similar to previous changes (13)
  • core/src/all_modules.py
  • core/src/apps/ethereum/onekey/sign_tx.py
  • core/src/apps/management/change_wipe_code.py
  • core/src/apps/management/change_pin.py
  • core/src/apps/base.py
  • core/src/session.py
  • core/src/storage/device.py
  • core/src/apps/management/recovery_device/init.py
  • core/src/apps/common/request_pin.py
  • core/src/trezor/config.py
  • core/src/trezor/lvglui/scrs/template.py
  • core/embed/extmod/modtrezorconfig/modtrezorconfig.c
  • core/src/trezor/lvglui/scrs/components/keyboard.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
core/src/apps/management/recovery_device/homescreen.py (2)
core/src/trezor/wire/__init__.py (1)
  • GenericContext (71-87)
core/src/trezor/ui/layouts/tt/__init__.py (1)
  • show_success (469-487)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Gen check
  • GitHub Check: Defs check
🔇 Additional comments (4)
core/src/apps/management/recovery_device/homescreen.py (3)

326-326: LGTM - proper group index parameter passing


349-351: LGTM - clean function signature update


370-382: LGTM - correct group-specific indexing

core/src/apps/ethereum/layout.py (1)

618-618: Can't locate confirm_safe_tx.
Please verify the UI handles raw gas token addresses correctly.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in 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.

@revan-zhang
Copy link
Contributor

revan-zhang commented Jul 18, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@somebodyLi somebodyLi enabled auto-merge (squash) July 18, 2025 09:09
@somebodyLi somebodyLi merged commit dfcaec7 into main Jul 18, 2025
9 checks passed
@somebodyLi somebodyLi deleted the fix/misc branch July 18, 2025 09:15
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.

5 participants