Skip to content

bug(desktop): "New messages" scroll-to-bottom indicator not dismissed after scrolling to bottom or switching conversations #2205

Description

@cat0825

What happened

The "New messages" scroll-to-bottom indicator in the chat surface is not dismissed correctly:

  1. Scrolling back to the bottom does not clear it. After scrolling up and receiving a new assistant message, scrolling all the way back down leaves the "New messages" label visible even though the user is at the bottom.
  2. It leaks across conversations. With the indicator active in one conversation, a brand-new conversation shows "New messages" from the start, and the first message of the new conversation re-triggers the indicator even after the user previously dismissed it.

Expected: the indicator clears once the user is at the bottom, and switching conversations resets the indicator state entirely.

How to reproduce

  1. Open a conversation with enough history that the content overflows the viewport.
  2. Scroll up so the floating scroll-to-bottom button appears.
  3. Wait for / trigger a new assistant message so the button label becomes "New messages".
  4. Scroll all the way back to the bottom.
    • Observed: "New messages" is still shown at the bottom edge (screenshot 3).
  5. Without clicking the indicator, start a brand-new conversation.
    • Observed: the new conversation shows "New messages" from the start (screenshot 2); the first message of the new conversation re-triggers the indicator (screenshot 1) even though the user is at the bottom.

Environment

  • Maka version: 0.1.5 (desktop build, CFBundleShortVersionString = 0.1.5)
  • OS and version: macOS, Apple Silicon (arm64)
  • Surface: Desktop

Logs, screenshots, or additional context

Runtime screenshots:

  1. Full window — transcript scrolled up with the "New messages" indicator floating over the chat.

Full window — "New messages" indicator over the transcript

  1. Bottom strip — transcript bottom and composer with the "New messages" indicator still present.

Bottom strip — composer with "New messages" still present

  1. Near-fullscreen — transcript scrolled back to the bottom; "New messages" is still shown at the bottom edge.

Scrolled back to the bottom — "New messages" still shown

Probable root cause (from the bundled renderer, @astryxdesign/core):

  • useChatNewMessages only clears hasNewMessages via dismiss(); the ResizeObserver sets it whenever the last .astryx-chat-message element changes while isLocked is false.
  • useChatStreamScroll only re-locks auto-follow on scrollend; it never reports "at bottom" back to the indicator, so isScrolledUp and hasNewMessages are independent and the button stays visible/labeled.
  • ChatLayout is not remounted per conversation (no key={sessionId}), so hasNewMessages, lastMessageRef (pointing at the previous conversation's last .astryx-chat-message node) and the unlocked isLocked=false survive a conversation switch; the new conversation's first message then re-flags hasNewMessages.

Suggested fixes (any of): reset lastMessageRef/hasNewMessages when the observed content element is replaced (conversation switch); clear the new-message flag when scrollend settles within the lock threshold; or remount ChatLayout per conversation (key={sessionId}).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions