commafeed icon indicating copy to clipboard operation
commafeed copied to clipboard

3.6.0 smooth scrolling with hotkey is not smooth

Open poblabs opened this issue 1 year ago • 13 comments

  • CommaFeed version (or "commafeed.com"): 3.6.0
  • Browser [e.g. chrome, firefox]: Chrome 114.0.5735.134
  • Device [e.g. desktop, mobile]: Desktop, Windows 11

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.

poblabs avatar Jun 19 '23 16:06 poblabs

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

Athou avatar Jun 20 '23 07:06 Athou

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

Athou avatar Jun 20 '23 09:06 Athou

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

poblabs avatar Jun 20 '23 12:06 poblabs

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?

Athou avatar Jun 20 '23 12:06 Athou

Sure thing - #1088 , thanks again!

poblabs avatar Jun 20 '23 12:06 poblabs

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?

poblabs avatar Jun 24 '23 15:06 poblabs

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

Athou avatar Jun 24 '23 21:06 Athou

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

poblabs avatar Jun 25 '23 15:06 poblabs

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

Athou avatar Jun 25 '23 20:06 Athou

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

poblabs avatar Jun 26 '23 01:06 poblabs

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!

ehamiter avatar Aug 06 '23 01:08 ehamiter

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

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

image

Athou avatar Aug 06 '23 07:08 Athou

🤦

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

ehamiter avatar Aug 06 '23 15:08 ehamiter