feat(macos): add scroll-to-bottom button in webchat

Add a floating button with down chevron that appears when scrolled up from
the bottom of the conversation. Tapping it smoothly scrolls to the latest
messages. Uses ultraThinMaterial background with subtle shadow.

Closes #2466

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kenny Lee 2026-01-26 16:30:20 -08:00
parent a8ad242f88
commit 96dbca6170

View File

@ -118,6 +118,29 @@ public struct ClawdbotChatView: View {
}
self.messageListOverlay
if !self.isPinnedToBottom, self.hasPerformedInitialScroll {
VStack {
Spacer()
Button {
withAnimation(.snappy(duration: 0.22)) {
self.scrollPosition = self.scrollerBottomID
}
} label: {
Image(systemName: "chevron.down")
.font(.system(size: 14, weight: .semibold))
.foregroundStyle(.primary)
.frame(width: 32, height: 32)
.background(.ultraThinMaterial, in: Circle())
.shadow(color: .black.opacity(0.12), radius: 4, y: 2)
}
.buttonStyle(.plain)
.padding(.bottom, 8)
}
.frame(maxWidth: .infinity)
.transition(.opacity.combined(with: .scale(scale: 0.8)))
.animation(.easeOut(duration: 0.15), value: self.isPinnedToBottom)
}
}
// Ensure the message list claims vertical space on the first layout pass.
.frame(maxHeight: .infinity, alignment: .top)