Skip to content

Commit 2867f2e

Browse files
authored
Fix scrollbar in empty chat (#223)
* Removes the chat overflowing size, to suppress the scrollbar on empty chat * Remove the navigation button on empty chat
1 parent e268849 commit 2867f2e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/jupyter-chat/src/components/chat-messages.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,10 @@ export function Navigation(props: NavigationProps): JSX.Element {
625625
// in viewport.
626626
useEffect(() => {
627627
const viewportChanged = (model: IChatModel, viewport: number[]) => {
628-
setLastInViewport(viewport.includes(model.messages.length - 1));
628+
setLastInViewport(
629+
model.messages.length === 0 ||
630+
viewport.includes(model.messages.length - 1)
631+
);
629632
};
630633

631634
model.viewportChanged?.connect(viewportChanged);

packages/jupyter-chat/src/components/scroll-container.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function ScrollContainer(props: ScrollContainerProps): JSX.Element {
4343
...props.sx
4444
}}
4545
>
46-
<Box sx={{ minHeight: '100.01%' }}>{props.children}</Box>
46+
<Box>{props.children}</Box>
4747
<Box sx={{ overflowAnchor: 'auto', height: '1px' }} />
4848
</Box>
4949
);

0 commit comments

Comments
 (0)