-
Notifications
You must be signed in to change notification settings - Fork 5
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
Optimize home page sliding animations & improve user guide module animation effects #275
Conversation
WalkthroughThis pull request updates the Changes
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Definitions (1)core/src/trezor/lvglui/scrs/homescreen.py (6)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (12)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)
439-453
: Position calculation needs debugging removal.- print(current_y + y_offset)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
core/src/trezor/lvglui/scrs/homescreen.py
(9 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
core/src/trezor/lvglui/scrs/homescreen.py (4)
core/src/storage/device.py (1)
get_homescreen
(890-898)core/src/trezor/lvglui/scrs/common.py (5)
AnimScreen
(56-204)load_screen
(187-195)load_screen
(331-341)_load_scr
(163-177)_load_scr
(318-321)core/src/trezor/lvglui/scrs/bootscreen.py (1)
load_screen
(30-33)core/src/trezor/lvglui/scrs/initscreen.py (1)
_load_scr
(44-45)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Defs check
- GitHub Check: Style check
- GitHub Check: Gen check
🔇 Additional comments (8)
core/src/trezor/lvglui/scrs/homescreen.py (8)
51-52
: Animation timings reduced.Reduced APP_DRAWER_UP_TIME from 50 to 10 and APP_DRAWER_DOWN_TIME from 150 to 50. Faster animations, better responsiveness.
135-135
: AppDrawer hidden by default.
140-152
: Improved visibility management.
176-176
: Fixed app drawer visibility.
224-224
: Changed initial position.Initial position set to (0,0) instead of off-screen.
376-378
: Animation parameters optimized.Animation now uses linear path for smoother movements.
Also applies to: 383-383, 388-391
5333-5339
: New AnimScreen-based UserGuide class.
5398-5404
: New AnimScreen-based BaseTutorial class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)
439-452
: Position threshold for animations is very small.2px threshold might cause excessive updates.
- position_threshold = 2 + position_threshold = 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)
📒 Files selected for processing (1)
core/src/trezor/lvglui/scrs/homescreen.py
(9 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
core/src/trezor/lvglui/scrs/homescreen.py (4)
core/src/storage/device.py (1)
get_homescreen
(890-898)core/src/trezor/lvglui/scrs/common.py (5)
AnimScreen
(56-204)load_screen
(187-195)load_screen
(331-341)_load_scr
(163-177)_load_scr
(318-321)core/src/trezor/lvglui/scrs/bootscreen.py (1)
load_screen
(30-33)core/src/trezor/lvglui/scrs/initscreen.py (1)
_load_scr
(44-45)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Gen check
- GitHub Check: Defs check
- GitHub Check: Style check
🔇 Additional comments (8)
core/src/trezor/lvglui/scrs/homescreen.py (8)
140-152
: Good visibility management improvement.
376-378
: Animation path changed to linear.Also applies to: 383-383
388-391
: Matching animation path for dismiss.
5332-5395
: New AnimScreen class implementation looks good.
5397-5460
: BaseTutorial mirrors UserGuide structure.
5462-5542
: SecurityProtection follows consistent pattern.
51-52
:❓ Verification inconclusive
Animation timings are very short.
10ms and 50ms might be too quick for smooth animations.
🏁 Script executed:
#!/bin/bash # Check for other animation timings in the codebase for comparison rg --type py "TIME\s*=\s*\d+" | grep -v APP_DRAWERLength of output: 961
Animation timings in homescreen might be too short.
- In
core/src/trezor/lvglui/scrs/homescreen.py
(lines 51–52),APP_DRAWER_UP_TIME
is 10 andAPP_DRAWER_DOWN_TIME
is 50.- Other modules use timings between 20 and 150.
Verify if these low values are intended.
224-224
:✅ Verification successful
Verify other positioning references for consistency.
🏁 Script executed:
#!/bin/bash # Find other instances where app drawer position is set or referenced rg "apps\.(set_pos|get_pos)" --type pyLength of output: 40
🏁 Script executed:
#!/bin/bash echo "Searching for all occurrences of 'set_pos(' in Python files:" rg "set_pos(" --type py echo "----------------------" echo "Searching for all occurrences of 'get_pos(' in Python files:" rg "get_pos(" --type pyLength of output: 634
🏁 Script executed:
#!/bin/bash echo "Searching for occurrences of 'set_pos(' with escaped parentheses:" rg "set_pos\(" --type py echo "----------------------" echo "Searching for occurrences of 'get_pos(' with escaped parentheses:" rg "get_pos\(" --type pyLength of output: 1510
Positioning references are consistent.
- The usage in
homescreen.py
at line 224 aligns with similar calls in other files.- No discrepancy found.
Summary by CodeRabbit
New Features
Refactor
Version Update