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(ui): Support free-scroll and auto-scroll for the installer logs (#1736) #1836

Merged
merged 2 commits into from Apr 4, 2024

Conversation

Domenic-MZS
Copy link
Contributor

@Domenic-MZS Domenic-MZS commented Apr 4, 2024

πŸ”§πŸŽ¨ UI Fix: Enhance Installer Logs Autoscroll Feature (#1736)

This PR fixes #1736, reported by @KobeW50

Overview

The installer logs' functionality has been enhanced by introducing a dynamic auto-scroll feature, Allowing free scrolling when the user pans the scroll. However, if the user scrolls down to the bottom or hits the auto-scroll-button it will lock in-place again improving the user experience/curiosity during the installation processes.

  • Issue: The Installer Logs always scrolls down on any log update disturbing the user reading experience (being a sh* annoying imo xD).
  • Context: The current functionality lacks dynamic autoscroll behavior, forcing a repaint, auto-scrolling to then afterwards (after 1 sec of the listeners notification - yup, a magic number).
  • Related Solutions: Similar to Discord's autoscroll behavior, the enhancement should allow the user to freely scroll.
  • Impact: Significantly improves user experience during installation processes.

πŸ““ Description

This PR introduces dynamic autoscroll behavior to the installer logs. The autoscroll feature listens for user pan interactions, allowing for intelligent autoscroll control/toggle. Users can detach autoscroll by start dragging out or holding, and it can reattach the tail (follow) by clicking the "go to bottom" FAB button or manually scrolling to the bottom (anchor point sweet point at 95%).

✍🏼 Changes Made

  • Added dynamic auto-scroll feature to installer logs on user interactions.
  • Enhance the scroll to bottom function to synchronize with the engine repaints by using the WidgetsBinding callback
  • Add FAB button to automatically reattach the auto-scroll.
Technical overview
  • Wrapped the CustomScroll of the logs with a NotificationListener to handle scroll events for detach and conditional attach the auto scroll
  • Wrapped the CustomScroll with a Stack to display on top the Scroll2Bottom button
  • Added 3 flags for handling needed states (to avoid bugs)
    • _isAutoScrollEnabled: flag to automatically call scroll to bottom on incoming data
    • _isAutoScrolling: flag to lock the current scroll configuration like a loading or busy state until scrolled
    • showAutoScrollButton: flag to render the Scroll to bottom FAB button on the stacked screen
    • Wrap the animate to bottom scroll to be executed only after a frame is render - to avoid visual inconsistencies and enhance the framerate

🦯 Testing

  • Update Tests (ToDo - Not Found nor needed for now...)
  • Compile/Build code
    • 🐞 Tested with Stable Flutter v3.19.3 and dart 3.3.1.
    • System: Linux archlinux 6.7.9-arch1-1 GNU/Linux

πŸ“‹ Notes & References

πŸ”¬ Reviewers

N/A (any mod is ok)


πŸ‘Ύ Feedback, changes, or suggestions are welcome! ✌🏼 πŸ–οΈ now a πŸ• emoji too...

Note: @validcube i'm on the "pretty" PR's party too πŸŽ‰ !!

This commit enhances the installer log functionality by adding dynamic
autoscroll behavior. The scroll listens for user's pan interactions,
allowing for intelligent autoscroll control.

Users can detach autoscroll by dragging out or holding, and reattach the
tail (follow) by clicking the "go to bottom" FAB button or scrolling to
the bottom, similar to Discord's behavior.

 This enhancement greatly improves user experience during installation
processes.
This commit fixes the issue where the auto scroll button toggles
immediately after scrolling even when it's within the anchor point, by
updating the auto scroll button visibility only after the user stops
interacting with the scroll.
@validcube
Copy link
Member

πŸ™ I can safely retire now

@validcube validcube requested review from validcube and BenjaminHalko and removed request for BenjaminHalko April 4, 2024 01:50
@validcube validcube changed the title Feat/patch free scroll feat: Patch free scroll Apr 4, 2024
@Domenic-MZS Domenic-MZS changed the title feat: Patch free scroll fix(ui): support free-scroll and auto-scroll for the installer logs (#1736) Apr 4, 2024
Copy link
Sponsor Member

@BenjaminHalko BenjaminHalko left a comment

Choose a reason for hiding this comment

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

LGTM!

@validcube
Copy link
Member

validcube commented Apr 4, 2024

πŸ₯ž LGTM!

  • Reviewer note: Limited to no testing done, due to availability issue.

Additional note: Your PR is approved by me.

@validcube validcube changed the title fix(ui): support free-scroll and auto-scroll for the installer logs (#1736) fix(ui): Support free-scroll and auto-scroll for the installer logs (#1736) Apr 4, 2024
@validcube validcube merged commit 025ff52 into ReVanced:dev Apr 4, 2024
1 check passed
@validcube validcube linked an issue Apr 4, 2024 that may be closed by this pull request
3 tasks
github-actions bot pushed a commit that referenced this pull request Apr 4, 2024
## [1.19.4-dev.7](v1.19.4-dev.6...v1.19.4-dev.7) (2024-04-04)

### Bug Fixes

* **ui:** Support free-scroll and auto-scroll for the installer logs ([#1736](#1736)) ([#1836](#1836)) ([025ff52](025ff52))
@Domenic-MZS
Copy link
Contributor Author

Wow, that was blazingly fast πŸ”₯ thanks @oSumAtrIX, @validcube, and @BenjaminHalko !!

github-actions bot pushed a commit that referenced this pull request Apr 5, 2024
# [1.20.0](v1.19.3...v1.20.0) (2024-04-05)

### Bug Fixes

* disable proguard obfuscation ([401646a](401646a))
* Do not crash when selecting an APK from storage ([#1768](#1768)) ([8564c1a](8564c1a))
* Don't translation ReVanced repository ([c265794](c265794))
* Ensure safe area usage in Changelogs Modal Bottom Sheet ([#1772](#1772)) ([c981cb4](c981cb4))
* Pre-releases changelog being shown ([#1767](#1767)) ([add49e1](add49e1))
* Replace Spacer with Expanded to avoid overflow ([#1791](#1791)) ([6f70a07](6f70a07))
* Set text colour on dropdown menu for Custom Value ([966796d](966796d)), closes [#1584](#1584)
* **ui:** Support free-scroll and auto-scroll for the installer logs ([#1736](#1736)) ([#1836](#1836)) ([025ff52](025ff52))

### Features

* Improve language update settings ([#1838](#1838)) ([f9e6ef3](f9e6ef3))
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.

feat: Allow free scrolling in patching screen
3 participants