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

[FR] indicator when scroll is locked #10

Closed
huyz opened this issue Jul 14, 2024 · 12 comments
Closed

[FR] indicator when scroll is locked #10

huyz opened this issue Jul 14, 2024 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@huyz
Copy link

huyz commented Jul 14, 2024

Right now, I can't tell if the scroll is locked or not.
Also, when scroll is locked, the bottom menu still stays l Lock scroll for some time. I guess it would be better if it said l Unlock scroll

@xavierog
Copy link
Owner

Right now, I can't tell if the scroll is locked or not.

This is briefly documented:

The main scrollbar handle turns green to indicate that the lock is enabled and automatic scrolling is disengaged.

Also, when scroll is locked, the bottom menu still stays l Lock scroll for some time. I guess it would be better if it said l Unlock scroll

Yes, that makes sense. I think the Textual framework recently introduced a way to implement that. I will have a look at it.

@xavierog xavierog self-assigned this Jul 14, 2024
@huyz
Copy link
Author

huyz commented Jul 14, 2024

This is briefly documented:

Oops, yeah it might be time for me to read your entire docs now that I'm using moulti regularly.

@huyz
Copy link
Author

huyz commented Jul 14, 2024

The main scrollbar handle turns green to indicate that the lock is enabled and automatic scrolling is disengaged.

I think I would have noticed the color changing if it weren't green. Orange or Red or Yellow would jump out more since in my Ansible output, almost everything looks green

@xavierog
Copy link
Owner

I think I would have noticed the color changing if it weren't green. Orange or Red or Yellow would jump out more since in my Ansible output, almost everything looks green

I am notoriously bad at picking suitable colors, so I am willing to change it if you can suggest a better alternative.

In the meantime, you can customise this color through Textual CSS:

  1. Store this snippet in a text file wherever you want:
    $scrollbar_custom_color: #ff0000;
    StepContainer.prevent_programmatic_scrolling {
        scrollbar-color: $scrollbar_custom_color;
        scrollbar-color-active: $scrollbar_custom_color;
        scrollbar-color-hover: $scrollbar_custom_color;
    }
  2. set the environment variable MOULTI_CUSTOM_CSS:
    export MOULTI_CUSTOM_CSS=/absolute/path/to/that/file.css
  3. Run moulti as usual:
    moulti run ansible-playbook your-playbook.yaml

@xavierog xavierog added the enhancement New feature or request label Jul 17, 2024
@xavierog
Copy link
Owner

I think the Textual framework recently introduced a way to implement that. I will have a look at it.

Actually, there is a technical limitation -- I am confident it will be solved at some point in the future but in the meantime, Lock scroll will remain Lock scroll.

@huyz: did my previous comment help re: the scrollbar color?

@huyz
Copy link
Author

huyz commented Jul 20, 2024

@xavierog Yes, colors help.

I'm still testing but here's what I'm playing with:

$step_default: #64B5F6;
$step_success: #C5E1A5;
$step_warning: #FFD54F;
$step_error: #E57373;

AbstractStep {
  background: $step_default;
  &.success { background: $step_success; }
  &.warning { background: $step_warning; }
  &.error { background: $step_error; }
}

$scrollbar_custom_color: #AB47BC;

StepContainer.prevent_programmatic_scrolling {
    scrollbar-color: $scrollbar_custom_color;
    scrollbar-color-active: $scrollbar_custom_color;
    scrollbar-color-hover: $scrollbar_custom_color;
}

screenshot 2024-07-20T061935Z@2x

@huyz huyz closed this as completed Jul 20, 2024
@huyz huyz changed the title [feat] indicator when scroll is locked [FR] indicator when scroll is locked Jul 27, 2024
@xavierog
Copy link
Owner

xavierog commented Aug 9, 2024

I think the Textual framework recently introduced a way to implement that. I will have a look at it.

Actually, there is a technical limitation -- I am confident it will be solved at some point in the future but in the meantime, Lock scroll will remain Lock scroll.

Textual 0.76 removed that limitation, so this issue can be reopened.

@xavierog xavierog reopened this Aug 9, 2024
@xavierog
Copy link
Owner

xavierog commented Aug 9, 2024

Also, when scroll is locked, the bottom menu still stays l Lock scroll for some time. I guess it would be better if it said l Unlock scroll

@huyz: this has been fixed in the devel branch.

@huyz
Copy link
Author

huyz commented Aug 9, 2024

Strange, it doesn't seem to work for me. It stays at l Lock scroll

@xavierog
Copy link
Owner

xavierog commented Aug 9, 2024

Strange, it doesn't seem to work for me. It stays at l Lock scroll

Can you ensure you run Moulti along with Textual 0.76.0? I have bumped the requirements from 0.53.0 to 0.76.0.

@huyz
Copy link
Author

huyz commented Aug 9, 2024

Ah yes, my bad. It works!

@xavierog
Copy link
Owner

Fixed in 1.15.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants