Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit c1d56cd

Browse files
fix(chat): issue where the "Skip to end" button remains when switching to a new chat window (#8172)
Fixes [QA-736](https://linear.app/sourcegraph/issue/QA-736/core-skip-to-end-toast-message-remains-stuck-after-clicking-new-chat) ## Test plan Ran unit tests and integration tests. Checked the behavior locally. Co-authored-by: Amp <amp@ampcode.com>
1 parent 7f9664a commit c1d56cd

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

vscode/webviews/chat/Transcript.test.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,14 @@ describe('Transcript', () => {
350350
expect(submitButtons).toHaveLength(3) // One button per editor per message.
351351
expect(submitButtons[0]).toBeEnabled()
352352
})
353+
354+
test('does not show ScrollDown button when transcript is empty', () => {
355+
render(<Transcript {...PROPS} transcript={[]} />)
356+
357+
// ScrollDown should not be present in empty transcript
358+
const scrollDownButton = screen.queryByText(/skip to end/i)
359+
expect(scrollDownButton).not.toBeInTheDocument()
360+
})
353361
})
354362

355363
type EditorHTMLElement = HTMLDivElement & { dataset: { lexicalEditor: 'true' } }

vscode/webviews/chat/Transcript.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,9 @@ export const Transcript: FC<TranscriptProps> = props => {
286286

287287
{scrollableContainer && <ScrollbarMarkers scrollContainer={scrollableContainer} />}
288288

289-
{!isAtBottomDebounced && <ScrollDown onClick={scrollTotheBottom} />}
289+
{!isAtBottomDebounced && interactions.length > 1 && (
290+
<ScrollDown onClick={scrollTotheBottom} />
291+
)}
290292

291293
<div className="tw-bg-[var(--vscode-input-background)]">
292294
{inputInteractionAtTheBottom &&

0 commit comments

Comments
 (0)