From 9180cbe821b8016cfcfc909820b78407ae02686b Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 2 Jan 2026 00:21:48 +0100 Subject: [PATCH] fix: keep chat scrolled to bottom on session switch --- CHANGELOG.md | 1 + apps/shared/ClawdisKit/Sources/ClawdisChatUI/ChatView.swift | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af8d5c4df24..189c088d2df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ - Browser tools: add remote CDP URL support, Linux launcher options (`executablePath`, `noSandbox`), and surface `cdpUrl` in status. ### Fixes +- Chat UI: keep the chat scrolled to the latest message after switching sessions. - Gateway CLI: read `CLAWDIS_GATEWAY_PASSWORD` from environment in `callGateway()` — allows `doctor`/`health` commands to auth without explicit `--password` flag. - Auto-reply: suppress stray `HEARTBEAT_OK` acks so they never get delivered as messages. - Discord: include recent guild context when replying to mentions and add `discord.historyLimit` to tune how many messages are captured. diff --git a/apps/shared/ClawdisKit/Sources/ClawdisChatUI/ChatView.swift b/apps/shared/ClawdisKit/Sources/ClawdisChatUI/ChatView.swift index b2f76932d02..4beb1602c57 100644 --- a/apps/shared/ClawdisKit/Sources/ClawdisChatUI/ChatView.swift +++ b/apps/shared/ClawdisKit/Sources/ClawdisChatUI/ChatView.swift @@ -129,6 +129,9 @@ public struct ClawdisChatView: View { self.scrollPosition = self.scrollerBottomID self.hasPerformedInitialScroll = true } + .onChange(of: self.viewModel.sessionKey) { _, _ in + self.hasPerformedInitialScroll = false + } .onChange(of: self.viewModel.messages.count) { _, _ in guard self.hasPerformedInitialScroll else { return } withAnimation(.snappy(duration: 0.22)) {