Athou / commafeed

Google Reader inspired self-hosted personal RSS reader.
https://www.commafeed.com
Apache License 2.0
2.82k stars 377 forks source link

3.6.0 smooth scrolling with hotkey is not smooth #1087

Open poblabs opened 1 year ago

poblabs commented 1 year ago

I am a long time user of self-hosted Commafeed 2.6.0 and I'm testing out 3.6.0 and the smooth scrolling is not smooth when using a hotkey. It's pretty choppy.

I noticed it happens more when there are a lot of unread articles. Right now I have 120 unread articles, and pressing the J or N hotkey results in a choppy scroll experience. In 2.6.0 this was very smooth so I thought I'd report it.

Athou commented 1 year ago

It is indeed choppy with Chrome, thanks for reporting the issue. I'll see what I can do.

Athou commented 1 year ago

Could you try with this change please? It seems to help. The jar is available at https://github.com/Athou/commafeed/actions/runs/5320555387

poblabs commented 1 year ago

It's better for sure! I had 1 bit of choppiness but that could be my Chrome. I'll have to give it some more testing throughout the day.

Another question for you with the hotkey scrolling. Would it be possible to always scroll the next article to the top even if it fits within the view?

For example in this screenshot, I hit j to go to the next unread but it didn't scroll my feed to the top so I keep thinking it didn't work. Again, slight difference between v2 and v3 that I noticed.

image

Athou commented 1 year ago

Another question for you with the hotkey scrolling. Would it be possible to always scroll the next article to the top even if it fits within the view?

For example in this screenshot, I hit j to go to the next unread but it didn't scroll my feed to the top so I keep thinking it didn't work. Again, slight difference between v2 and v3 that I noticed.

Sure, could you open another issue though please?

poblabs commented 1 year ago

Sure thing - #1088 , thanks again!

poblabs commented 1 year ago

Compared to 2.0, I'm still having a bit choppy with CommaFeed version 3.7.0 (7c226f4). Could it be the speed it's scrolling? Is there an option to adjust scroll speed?

Athou commented 1 year ago

I profiled the app in Chrome and made some changes. Does this help https://github.com/Athou/commafeed/actions/runs/5366267839 ?

poblabs commented 1 year ago

so far so good! the only thing now is there's a delay (maybe 750ms?) from the keypress to the scroll event.

Athou commented 1 year ago

I made more changes to help with the initial lag. Could you test https://github.com/Athou/commafeed/actions/runs/5371503325 please?

poblabs commented 1 year ago

It's getting better! Compared to 2.0, still a bit slow but making progress to make it feel less laggy

ehamiter commented 1 year ago

Is there an option to adjust scroll speed?

I am also curious about this. I would prefer to have no animation at all, and immediately cut to the next entry. In commafeed-client/src/app/slices.ts, I see this:

if (arg.scrollToEntry) {
    const entryElement = document.getElementById(Constants.dom.entryId(entry))
    if (entryElement) {
        const alwaysScrollToEntry = state.user.settings?.alwaysScrollToEntry
        const entryEntirelyVisible = Constants.layout.isTopVisible(entryElement) && Constants.layout.isBottomVisible(entryElement)
        if (alwaysScrollToEntry || !entryEntirelyVisible) {
            const scrollSpeed = state.user.settings?.scrollSpeed
            thunkApi.dispatch(entriesSlice.actions.setScrollingToEntry(true))
            scrollToEntry(entryElement, scrollSpeed, () => thunkApi.dispatch(entriesSlice.actions.setScrollingToEntry(false)))
        }
    }
}

Can I set alwaysScrollToEntry or scrollSpeed? If so, where?

Thanks for any info!

Athou commented 1 year ago

Can I set alwaysScrollToEntry or scrollSpeed? If so, where?

Sure, those are the first two options in the user settings:

image

ehamiter commented 1 year ago

🤦

@Athou thanks so much, I swear I looked through the settings a billion times but somehow never noticed those.