Skip to content

Fix boot UI overlap && optimize GIF memory management#405

Merged
lihuanhuan merged 4 commits intoOneKeyHQ:mainfrom
lihuanhuan:pro_main
Dec 31, 2025
Merged

Fix boot UI overlap && optimize GIF memory management#405
lihuanhuan merged 4 commits intoOneKeyHQ:mainfrom
lihuanhuan:pro_main

Conversation

@lihuanhuan
Copy link
Contributor

@lihuanhuan lihuanhuan commented Dec 30, 2025

Summary by CodeRabbit

  • Improvements

    • Enhanced progress bar UI state management during bootloader operations and data transfers for better visual feedback.
    • Refined bootloader navigation controls for improved user interaction.
  • Bug Fixes

    • Corrected rectangle drawing calculations on display for accurate rendering.
  • Chores

    • Updated firmware build identifier naming scheme.
    • Updated vendor dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@lihuanhuan lihuanhuan requested a review from a team as a code owner December 30, 2025 09:20
@revan-zhang
Copy link
Contributor

revan-zhang commented Dec 30, 2025

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

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Walkthrough

Firmware build naming updated for Bitcoin-only mode. Progress bar visibility tracking refactored across bootloader and EMMC modules. Bootloader navigation input scheme changed from PREVIOUS/RESTART to CANCEL/CONFIRM. LCD rectangle boundary computation adjusted for inclusive bounds. LVGL submodule version updated.

Changes

Cohort / File(s) Summary
Build Configuration
core/Makefile
Bitcoin-only firmware build suffix changed from "-Stable-bc-only-..." to "-Stable-btc-...". Added endif to close conditional block.
Bootloader UI Progress Bar Management
core/embed/bootloader/bootui.c, core/embed/bootloader/bootui.h
Introduced persistent ui_progress_bar_visible flag and ui_progress_bar_visible_clear() function. Progress bar marked visible on prepare, conditionally faded in on first update. Page 2 navigation now uses INPUT_CANCEL/INPUT_CONFIRM instead of INPUT_PREVIOUS/INPUT_RESTART.
Bootloader Main
core/embed/bootloader/main.c
Removed call to ui_progress_bar_visible_clear() in long-press bootloader home page return path.
EMMC Wrapper
core/embed/emmc_wrapper/emmc_commands.c, core/embed/emmc_wrapper/emmc_commands.h
Replaced global ui_progress_bar_visible state with new static helpers ui_progress_bar_handle_update() and ui_progress_bar_handle_clear(). Simplified progress handling in EmmcFileRead/Write by caching last value and using constant title. Removed public declarations for obsolete visibility tracking.
Display Driver
core/embed/extmod/modtrezorui/mipi_lcd.c
fb_fill_rect boundary calculation changed to inclusive bounds (end_x/end_y minus 1), with corresponding adjustments to clamping and offset computations.
Dependencies
vendor/lvgl_mp
Submodule reference updated to new commit hash.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'boot UI overlap' and 'GIF memory management', but the changeset focuses on progress bar UI state management, bootloader navigation, LCD rendering bounds, and build naming. Update title to reflect actual changes: progress bar visibility refactoring, bootloader input handling, or firmware build naming updates.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.67% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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: 1

🧹 Nitpick comments (1)
core/embed/emmc_wrapper/emmc_commands.c (1)

30-40: Duplicate code in branches.

Both branches call ui_screen_progress_bar_update with the same arguments.

Proposed simplification
-    if ( percentage < 100 )
-    {
-        ui_screen_progress_bar_update(progress_title, NULL, percentage);
-    }
-    else
-    {
-        ui_screen_progress_bar_update(progress_title, NULL, percentage);
+    ui_screen_progress_bar_update(progress_title, NULL, percentage);
+    if ( percentage >= 100 )
+    {
         ui_fadeout();
         ui_bootloader_first(NULL);
         ui_fadein();
     }
📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 659efd6 and 0128641.

📒 Files selected for processing (8)
  • core/Makefile
  • core/embed/bootloader/bootui.c
  • core/embed/bootloader/bootui.h
  • core/embed/bootloader/main.c
  • core/embed/emmc_wrapper/emmc_commands.c
  • core/embed/emmc_wrapper/emmc_commands.h
  • core/embed/extmod/modtrezorui/mipi_lcd.c
  • vendor/lvgl_mp
💤 Files with no reviewable changes (2)
  • core/embed/emmc_wrapper/emmc_commands.h
  • core/embed/bootloader/main.c
🧰 Additional context used
🧬 Code graph analysis (2)
core/embed/bootloader/bootui.h (1)
core/embed/bootloader/bootui.c (1)
  • ui_progress_bar_visible_clear (410-410)
core/embed/emmc_wrapper/emmc_commands.c (2)
core/embed/bootloader/bootui.c (5)
  • ui_screen_progress_bar_update (386-408)
  • ui_fadeout (543-546)
  • ui_bootloader_first (983-1042)
  • ui_fadein (541-541)
  • ui_progress_bar_visible_clear (410-410)
core/embed/extmod/modtrezorui/display.c (1)
  • display_clear (170-172)
⏰ 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: Defs check
  • GitHub Check: Style check
🔇 Additional comments (12)
vendor/lvgl_mp (1)

1-1: Verify the LVGL submodule commit and its changes.

Confirm the submodule commit is valid and aligns with the PR objectives (UI overlap fix, GIF memory optimization). Document what changed between the two commits.

core/embed/bootloader/bootui.h (1)

58-58: LGTM!

Declaration matches the implementation.

core/Makefile (1)

57-58: LGTM!

Shorter suffix. Cleaner.

core/embed/extmod/modtrezorui/mipi_lcd.c (1)

480-481: LGTM!

Offset now reflects actual drawn width after clamping.

core/embed/emmc_wrapper/emmc_commands.c (2)

1735-1744: LGTM!

Progress handling is now encapsulated.


1845-1854: LGTM!

Same pattern as read handler.

core/embed/bootloader/bootui.c (6)

363-364: LGTM!

Static state flag for progress visibility.


375-384: LGTM!

Sets visible flag and renders initial state.


386-408: LGTM!

Visibility check prevents redundant fade transitions.


410-411: LGTM!

Simple and clear.


988-989: LGTM!

Resets progress state on first screen.


1311-1318: LGTM!

Input scheme now uses Cancel/Confirm. Consistent with button labels in ui_bootloader_device_test at line 1252.

@lihuanhuan lihuanhuan merged commit 1232a43 into OneKeyHQ:main Dec 31, 2025
9 checks passed
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

Comments