hiyaryan / the-cdj

The Cognitive Distortion Journal (CDJ) is a smart journaling tool that helps remedy distorted thinking. It can feel impossible to follow the CBT technique of labeling distorted thinking and finding alternative modes of thought (i.e. reframing) while cognitive distortions are occurring. The CDJ does that work for you. -- The CDJ is in beta testing!!
https://thecdj.app
3 stars 0 forks source link

Make chat message box always shows the most recent messages. #62

Closed hiyaryan closed 7 months ago

hiyaryan commented 7 months ago

Adds a reference to the chat box with a scrollTop property set to the scrollHeight so that recent messages appear first on entry focus and when new messages are submitted.

This PR resolves issue #60.

hiyaryan commented 7 months ago

The last PR adds a smooth scrolling effect that aligns the Chat box in view and smoothly scrolls to the most recent messages once they are received from the server. This only occurs when the user has sent a message. If the user clicks on a new entry putting it into focus, then no effect occurs. The last messages sent for that entry will be in view without any scrolling effects to prevent react from auto-scrolling to Chat.