Skip to content

Commit

Permalink
fix: remove autoscrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
juancarlosfarah committed Apr 4, 2024
1 parent 3d09ac7 commit b6a1a06
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"@types/react-dom": "18.2.22",
"date-fns": "3.6.0",
"i18next": "23.9.0",
"lodash.delay": "4.1.1",
"react": "18.2.0",
"react-content-loader": "7.0.0",
"react-dom": "18.2.0",
Expand Down Expand Up @@ -59,7 +58,6 @@
"@cypress/code-coverage": "3.12.32",
"@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/i18n": "0.13.10",
"@types/lodash.delay": "^4",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/parser": "7.4.0",
Expand Down
18 changes: 0 additions & 18 deletions src/modules/message/MessagesPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Stack from '@mui/material/Stack';

import { ChatBotMessage, ChatbotRole } from '@graasp/sdk';

import delay from 'lodash.delay';
import { v4 as uuidv4 } from 'uuid';

import { mutations } from '@/config/queryClient';
Expand All @@ -28,19 +27,6 @@ type MessagesPaneProps = {
goToNextExchange: () => void;
};

const scrollToBottom = (): void => {
// todo: factor out
const delayInMillis = 500;
delay(
() =>
window.scrollTo({
top: document.body.scrollHeight,
behavior: 'smooth',
}),
delayInMillis,
);
};

const buildPrompt = (
threadMessages: Message[],
userMessage: Message,
Expand Down Expand Up @@ -109,8 +95,6 @@ const MessagesPane = ({
const updatedMessages = [...messages, newMessage];
setMessages((m) => [...m, newMessage]);

scrollToBottom();

// respond
const prompt = [
// initial settings
Expand Down Expand Up @@ -141,8 +125,6 @@ const MessagesPane = ({
// set status back to idle
setStatus(Status.Idle);

scrollToBottom();

// post comment from bot
// postAppDataAsync({
// data: actionData,
Expand Down
25 changes: 0 additions & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4098,22 +4098,6 @@ __metadata:
languageName: node
linkType: hard

"@types/lodash.delay@npm:^4":
version: 4.1.9
resolution: "@types/lodash.delay@npm:4.1.9"
dependencies:
"@types/lodash": "npm:*"
checksum: 10/2feae6891050dfd65ed9177fe2e7b42c2f6a9adacd7aa5dc90276ccf36d176b919a19dc0611e3045a0702aa35798d7ca523dc47818f2d4d4e0165e9cee1be474
languageName: node
linkType: hard

"@types/lodash@npm:*":
version: 4.17.0
resolution: "@types/lodash@npm:4.17.0"
checksum: 10/2053203292b5af99352d108656ceb15d39da5922fc3fb8186e1552d65c82d6e545372cc97f36c95873aa7186404d59d9305e9d49254d4ae55e77df1e27ab7b5d
languageName: node
linkType: hard

"@types/mime@npm:*":
version: 3.0.4
resolution: "@types/mime@npm:3.0.4"
Expand Down Expand Up @@ -8233,7 +8217,6 @@ __metadata:
"@tanstack/react-query-devtools": "npm:4.36.1"
"@trivago/prettier-plugin-sort-imports": "npm:4.3.0"
"@types/i18n": "npm:0.13.10"
"@types/lodash.delay": "npm:^4"
"@types/node": "npm:20.11.30"
"@types/react": "npm:18.2.70"
"@types/react-dom": "npm:18.2.22"
Expand All @@ -8260,7 +8243,6 @@ __metadata:
eslint-plugin-react-hooks: "npm:4.6.0"
husky: "npm:9.0.11"
i18next: "npm:23.9.0"
lodash.delay: "npm:4.1.1"
miragejs: "npm:0.1.48"
nock: "npm:13.5.3"
nyc: "npm:15.1.0"
Expand Down Expand Up @@ -9563,13 +9545,6 @@ __metadata:
languageName: node
linkType: hard

"lodash.delay@npm:4.1.1":
version: 4.1.1
resolution: "lodash.delay@npm:4.1.1"
checksum: 10/d6f21998d25a1db0ad1d3e943d5b329efc7f556b04a0a05f23a0517f86c2dcdde505c9f5264ead825a51ad4a9d6481f06cd564342002be9465faf50ccf87193f
languageName: node
linkType: hard

"lodash.flattendeep@npm:^4.4.0":
version: 4.4.0
resolution: "lodash.flattendeep@npm:4.4.0"
Expand Down

0 comments on commit b6a1a06

Please sign in to comment.