Skip to content

fix(core): misc fix#356

Merged
somebodyLi merged 1 commit intomainfrom
fix/misc
Jul 16, 2025
Merged

fix(core): misc fix#356
somebodyLi merged 1 commit intomainfrom
fix/misc

Conversation

@somebodyLi
Copy link
Copy Markdown
Contributor

@somebodyLi somebodyLi commented Jul 16, 2025

  1. update i18n items
  2. fix typos
  3. add a transition page to reduce the long black screen time after entering the passphrase
  4. fix the crash issue caused by memory fragmentation when there are a large number of registered Fido passkeys

Summary by CodeRabbit

  • New Features

    • Added explicit vendor labeling for Bitcoin-only firmware in device features.
  • Improvements

    • Simplified and unified share-related messages across all supported languages, making them clearer and more concise.
    • Backup share subtitles now use color-coded formatting for better readability.
    • PIN timeout screen displays a cleaner message, removing unnecessary text.
  • Bug Fixes

    • Corrected typos in operation-related parameters and variables for transaction confirmation screens.
  • User Interface

    • Improved memory management and performance in passkey credential lists.
    • Subtitle labels in mnemonic display now support color formatting.
    • Navigation and content area adjustments are now conditional based on button presence.
  • Style

    • Standardized import statements and naming conventions for improved code clarity.

@somebodyLi somebodyLi requested a review from a team as a code owner July 16, 2025 06:48
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 16, 2025

Walkthrough

This update changes translation strings for share-related subtitles in multiple languages, updates variable names for consistency, adjusts list handling in credential management, and tweaks UI behaviors. It also adds a new constant for Bitcoin-only firmware, updates import styles, and simplifies PIN timeout logic.

Changes

Files/Groups Change Summary
core/src/apps/base.py Added FW_VENDOR_BTC_ONLY constant; updated get_features() to set fw_vendor for Bitcoin-only mode.
core/src/apps/common/seed.py Updated import style; added popup display before seed derivation in a specific code path.
core/src/trezor/lvglui/i18n/keys.py Replaced a share instruction title key with a simpler subtitle key.
core/src/trezor/lvglui/i18n/locales/{de,en,es,fr,it,ja,ko,pt_br,ru,zh_cn,zh_hk}.py Updated translation strings for share subtitles in all listed languages.
core/src/trezor/lvglui/scrs/common.py Made content area height adjustment conditional on presence of certain buttons.
core/src/trezor/lvglui/scrs/homescreen.py Switched to fixed-size lists and added garbage collection in credential management methods; added pyright suppressions.
core/src/trezor/lvglui/scrs/lockscreen.py Changed device import to alias; updated all references accordingly.
core/src/trezor/lvglui/scrs/reset_device.py Enabled recoloring for subtitle label in MnemonicDisplay.
core/src/trezor/lvglui/scrs/template.py Fixed typo: renamed opeartion to operation; changed default animation direction and destroy delay.
core/src/trezor/pin.py Removed unused variables and imports; simplified message handling in show_pin_timeout.
core/src/trezor/ui/layouts/lvgl/init.py Renamed function parameter opeartion to operation for consistency.
core/src/trezor/ui/layouts/lvgl/reset.py Changed share subtitle construction to use two translated strings with embedded color markup.

📜 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 524c419 and cd162e5.

📒 Files selected for processing (22)
  • core/src/apps/base.py (2 hunks)
  • core/src/apps/common/seed.py (2 hunks)
  • core/src/trezor/lvglui/i18n/keys.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/de.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/en.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/es.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/fr.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/it.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/ja.py (3 hunks)
  • core/src/trezor/lvglui/i18n/locales/ko.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/pt_br.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/ru.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/zh_cn.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/zh_hk.py (1 hunks)
  • core/src/trezor/lvglui/scrs/common.py (2 hunks)
  • core/src/trezor/lvglui/scrs/homescreen.py (4 hunks)
  • core/src/trezor/lvglui/scrs/lockscreen.py (4 hunks)
  • core/src/trezor/lvglui/scrs/reset_device.py (1 hunks)
  • core/src/trezor/lvglui/scrs/template.py (7 hunks)
  • core/src/trezor/pin.py (2 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (2 hunks)
  • core/src/trezor/ui/layouts/lvgl/reset.py (1 hunks)
✅ Files skipped from review due to trivial changes (6)
  • core/src/trezor/lvglui/i18n/locales/de.py
  • core/src/trezor/lvglui/i18n/locales/pt_br.py
  • core/src/trezor/lvglui/i18n/locales/fr.py
  • core/src/trezor/ui/layouts/lvgl/init.py
  • core/src/trezor/lvglui/i18n/locales/zh_hk.py
  • core/src/trezor/lvglui/i18n/locales/ja.py
🚧 Files skipped from review as they are similar to previous changes (16)
  • core/src/trezor/lvglui/scrs/reset_device.py
  • core/src/trezor/lvglui/i18n/locales/ru.py
  • core/src/trezor/lvglui/scrs/lockscreen.py
  • core/src/trezor/lvglui/i18n/locales/en.py
  • core/src/trezor/lvglui/i18n/locales/it.py
  • core/src/trezor/lvglui/i18n/locales/es.py
  • core/src/apps/common/seed.py
  • core/src/trezor/lvglui/i18n/locales/zh_cn.py
  • core/src/trezor/lvglui/scrs/common.py
  • core/src/trezor/ui/layouts/lvgl/reset.py
  • core/src/trezor/lvglui/i18n/locales/ko.py
  • core/src/apps/base.py
  • core/src/trezor/lvglui/scrs/template.py
  • core/src/trezor/lvglui/i18n/keys.py
  • core/src/trezor/pin.py
  • core/src/trezor/lvglui/scrs/homescreen.py
⏰ 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: Gen check
  • GitHub Check: Style check
  • GitHub Check: Defs check
✨ 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
Copy Markdown
Contributor

revan-zhang commented Jul 16, 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)

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🔭 Outside diff range comments (1)
core/src/trezor/lvglui/scrs/template.py (1)

1056-1092: Operation value misclassified

CREATE (2) is shown as DELEGATECALL. Wrong label.

♻️ Duplicate comments (1)
core/src/trezor/lvglui/scrs/template.py (1)

5484-5533: Duplicate: operation value misclassified

🧹 Nitpick comments (5)
core/src/trezor/lvglui/i18n/locales/ja.py (1)

947-947: Politeness level reduced.

Removing "ください" makes the text less polite in Japanese. Consider keeping it for better user experience.

core/src/trezor/ui/layouts/lvgl/reset.py (1)

50-50: Long line hurts readability. Extract color constant.

The line is complex with nested formatting. Move #00FF33 to a constant.

-        subtitle = f"{_(i18n_keys.SUBTITLE__DEVICE_BACKUP_MANUAL_BACKUP).format(word_cnt)} #00FF33 {_(i18n_keys.SUBTITLE__THIS_IS_SHARE_STR_OF_STR).format(num1=share_index + 1, num2=share_count)}#"
+        COLOR_GREEN = "#00FF33"
+        manual_backup_text = _(i18n_keys.SUBTITLE__DEVICE_BACKUP_MANUAL_BACKUP).format(word_cnt)
+        share_info_text = _(i18n_keys.SUBTITLE__THIS_IS_SHARE_STR_OF_STR).format(num1=share_index + 1, num2=share_count)
+        subtitle = f"{manual_backup_text} {COLOR_GREEN} {share_info_text}#"
core/src/trezor/lvglui/i18n/locales/pt_br.py (1)

1019-1021: Lowercase “ação”.

Use lowercase to keep sentence-case style.

core/src/trezor/lvglui/i18n/locales/ko.py (1)

1019-1021: Grammar mismatch.

Add “개” after {num2} for natural counting.

core/src/trezor/lvglui/scrs/lockscreen.py (1)

25-27: Shadowing warning.

Local variable lockscreen shadows the module name, hurts clarity. Rename.

📜 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 e421c66 and aa86656.

📒 Files selected for processing (22)
  • core/src/apps/base.py (2 hunks)
  • core/src/apps/common/seed.py (2 hunks)
  • core/src/trezor/lvglui/i18n/keys.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/de.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/en.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/es.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/fr.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/it.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/ja.py (3 hunks)
  • core/src/trezor/lvglui/i18n/locales/ko.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/pt_br.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/ru.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/zh_cn.py (1 hunks)
  • core/src/trezor/lvglui/i18n/locales/zh_hk.py (1 hunks)
  • core/src/trezor/lvglui/scrs/common.py (2 hunks)
  • core/src/trezor/lvglui/scrs/homescreen.py (4 hunks)
  • core/src/trezor/lvglui/scrs/lockscreen.py (4 hunks)
  • core/src/trezor/lvglui/scrs/reset_device.py (1 hunks)
  • core/src/trezor/lvglui/scrs/template.py (7 hunks)
  • core/src/trezor/pin.py (2 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (2 hunks)
  • core/src/trezor/ui/layouts/lvgl/reset.py (1 hunks)
👮 Files not reviewed due to content moderation or server errors (3)
  • core/src/trezor/lvglui/i18n/keys.py
  • core/src/trezor/lvglui/scrs/reset_device.py
  • core/src/trezor/lvglui/i18n/locales/es.py
🧰 Additional context used
🧬 Code Graph Analysis (3)
core/src/trezor/lvglui/scrs/lockscreen.py (1)
core/src/storage/device.py (4)
  • get_homescreen (916-924)
  • has_prompted_fingerprint (579-585)
  • set_fingerprint_prompted (588-591)
  • is_tap_awake_enabled (621-629)
core/src/apps/common/seed.py (2)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)
  • show_popup (1166-1183)
core/src/trezor/lvglui/i18n/__init__.py (1)
  • gettext (31-32)
core/src/trezor/lvglui/scrs/template.py (6)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)
  • confirm_text (884-907)
core/src/trezor/lvglui/scrs/common.py (2)
  • show_unload_anim (692-697)
  • destroy (621-625)
core/src/trezor/lvglui/scrs/fingerprints.py (5)
  • show_unload_anim (118-119)
  • show_unload_anim (234-235)
  • show_unload_anim (400-407)
  • show_unload_anim (608-613)
  • show_unload_anim (642-643)
core/src/trezor/lvglui/scrs/app_passkeys.py (2)
  • show_unload_anim (286-287)
  • show_unload_anim (315-316)
core/src/trezor/lvglui/scrs/homescreen.py (1)
  • destroy (2169-2170)
core/src/trezor/lvglui/scrs/ble.py (1)
  • destroy (38-43)
⏰ 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: Gen check
  • GitHub Check: Style check
  • GitHub Check: Defs check
🔇 Additional comments (22)
core/src/apps/base.py (2)

31-31: LGTM!

Clear constant definition.


105-105: LGTM!

Proper usage of the constant.

core/src/trezor/lvglui/scrs/homescreen.py (7)

552-553: Multiple pyright suppressions indicate type checking issues.

The # pyright: off comments are used repeatedly. This suggests broader type inference problems.


555-560: List assignment pattern is correct.

The indexed assignment approach properly replaces dynamic appending.


563-564: Manual garbage collection may impact performance.

The explicit gc.collect() calls could cause performance hiccups.


567-572: List assignment pattern is correct.

The indexed assignment for UI elements follows the same pattern correctly.


592-592: List initialization is consistent.

The fixed-size list initialization matches the optimization pattern.


638-645: Pyright suppression without clear justification.

The type checking suppression around list operations needs verification.


662-670: Pyright suppression around workflow call.

The type checking suppression around workflow.spawn seems unnecessary.

core/src/trezor/lvglui/i18n/locales/en.py (1)

1020-1020: Clear and concise.

core/src/trezor/lvglui/i18n/locales/ru.py (1)

1020-1020: Good translation.

core/src/trezor/lvglui/scrs/common.py (2)

542-543: Code looks good

Conditional styling logic is clean and consistent.


558-559: Code looks good

Conditional styling logic is clean and consistent.

core/src/trezor/lvglui/i18n/locales/de.py (1)

1020-1020: Translation looks good

German text is clear and properly formatted.

core/src/trezor/lvglui/i18n/locales/it.py (1)

1020-1020: Translation looks good

Italian text is clear and properly formatted.

core/src/trezor/lvglui/i18n/locales/zh_cn.py (1)

1020-1020: Translation looks correct.

The simplified Chinese text accurately conveys "This is the {num1}th share, out of {num2} shares."

core/src/trezor/lvglui/i18n/locales/ja.py (1)

897-897: Translations look good.

The text simplifications maintain clarity and correct grammar in Japanese.

Also applies to: 1020-1020

core/src/apps/common/seed.py (2)

3-4: Import style improved.

Explicit alias imports are clearer than grouped imports.


89-92: UI feedback added correctly.

The popup provides useful feedback during seed derivation. The 1000ms timeout is appropriate for a brief "Please wait" message.

core/src/trezor/pin.py (2)

26-26: Parameter correctly marked as unused.

The underscore prefix indicates the parameter is unused, which is good practice.


48-48: Message handling simplified.

Setting empty string for "read fp data" removes the localized message. This might affect user experience if the message was meaningful.

core/src/trezor/ui/layouts/lvgl/__init__.py (1)

2653-2692: Ignore rename warning
No “opeartion=” occurrences found.

Likely an incorrect or invalid review comment.

Comment thread core/src/trezor/lvglui/i18n/locales/zh_hk.py
Comment thread core/src/trezor/lvglui/i18n/locales/fr.py Outdated
1. update i18n items
2. fix typos
3. add a transition page to reduce the long black screen time after entering the passphrase
4. fix the crash issue caused by memory fragmentation when there are a large number of registered Fido passkeys
@somebodyLi somebodyLi merged commit 564500f into main Jul 16, 2025
9 checks passed
@somebodyLi somebodyLi deleted the fix/misc branch July 16, 2025 08:26
guowei0105 pushed a commit to guowei0105/firmware-pro-public that referenced this pull request Jul 17, 2025
1. update i18n items
2. fix typos
3. add a transition page to reduce the long black screen time after entering the passphrase
4. fix the crash issue caused by memory fragmentation when there are a large number of registered Fido passkeys
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.

4 participants