From f492faa84b5161e1ab0c818126ef0c8eab3c96ae Mon Sep 17 00:00:00 2001
From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
Date: Sat, 23 May 2026 23:24:24 -0400
Subject: [PATCH] feat(frontend): add scroll-to-bottom button, improve scroll
disengagement, and tall content detection
---
.../components/message/FloatingTTSButton.tsx | 2 +-
.../message/PromptInput.stt.test.tsx | 30 ++
.../src/components/message/PromptInput.tsx | 16 +-
.../__tests__/useTallScrollContent.test.tsx | 78 +++++
frontend/src/hooks/useAutoScroll.ts | 10 +-
frontend/src/hooks/useTallScrollContent.ts | 36 ++
frontend/src/index.css | 2 +-
frontend/src/pages/SessionDetail.tsx | 53 ++-
.../SessionDetail.scroll-floating.test.tsx | 308 ++++++++++++++++++
frontend/src/test/setup.ts | 6 +
10 files changed, 512 insertions(+), 29 deletions(-)
create mode 100644 frontend/src/hooks/__tests__/useTallScrollContent.test.tsx
create mode 100644 frontend/src/hooks/useTallScrollContent.ts
create mode 100644 frontend/src/pages/__tests__/SessionDetail.scroll-floating.test.tsx
diff --git a/frontend/src/components/message/FloatingTTSButton.tsx b/frontend/src/components/message/FloatingTTSButton.tsx
index b3c9aa3a..e8acd5e1 100644
--- a/frontend/src/components/message/FloatingTTSButton.tsx
+++ b/frontend/src/components/message/FloatingTTSButton.tsx
@@ -92,7 +92,7 @@ export function FloatingTTSButton({ messageId, content }: FloatingTTSButtonProps
onPointerDown={handlePointerDown}
onPointerUp={handlePointerUp}
onPointerLeave={handlePointerLeave}
- className={`absolute -top-5 right-0 md:right-4 z-50 flex items-center transition-all duration-200 shadow-md backdrop-blur-md ring-1 ${buttonToneClasses} ${isLongPressVisual ? 'scale-95 opacity-80' : 'active:scale-95 hover:scale-105'} ${!hasContent && !autoPlay ? 'opacity-50 cursor-not-allowed' : ''}`}
+ className={`flex items-center transition-all duration-200 shadow-md backdrop-blur-md ring-1 ${buttonToneClasses} ${isLongPressVisual ? 'scale-95 opacity-80' : 'active:scale-95 hover:scale-105'} ${!hasContent && !autoPlay ? 'opacity-50 cursor-not-allowed' : ''}`}
title={pillTitle}
aria-label={pillAriaLabel}
disabled={!hasContent && !autoPlay}
diff --git a/frontend/src/components/message/PromptInput.stt.test.tsx b/frontend/src/components/message/PromptInput.stt.test.tsx
index 0b3cb331..a37079ef 100644
--- a/frontend/src/components/message/PromptInput.stt.test.tsx
+++ b/frontend/src/components/message/PromptInput.stt.test.tsx
@@ -380,5 +380,35 @@ describe('PromptInput STT Gesture Tests', () => {
expect(mockStartRecording).toHaveBeenCalledTimes(1)
})
})
+
+ it('renders mobile mic even when showScrollButton is true and no voice feedback is active', async () => {
+ mocks.useMobile.mockReturnValue(true)
+
+ render(
+