- {showProgress &&
{progressPercentage}%}
+ {showProgress &&
{progressPercentage.toFixed(0)}%}
{Icon && (
)}
diff --git a/gui/src/pages/edit.tsx b/gui/src/pages/edit.tsx
index f05648875..9629d4d66 100644
--- a/gui/src/pages/edit.tsx
+++ b/gui/src/pages/edit.tsx
@@ -7,7 +7,14 @@ import { useContext, useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import styled from "styled-components";
-import { defaultBorderRadius, lightGray, vscForeground } from "../components";
+import {
+ defaultBorderRadius,
+ lightGray,
+ parseColorForHex,
+ VSC_DIFF_INSERTED_LINE_BACKGROUND_VAR,
+ VSC_DIFF_REMOVED_LINE_BACKGROUND_VAR,
+ vscForeground,
+} from "../components";
import FileIcon from "../components/FileIcon";
import { NewSessionButton } from "../components/mainInput/NewSessionButton";
import resolveEditorContent from "../components/mainInput/resolveInput";
@@ -162,7 +169,7 @@ function Edit() {
placeholder={
["streaming", "accepting"].includes(editModeState.editStatus)
? "Enter instructions for edit"
- : "Enter follow-up instructions"
+ : "Enter instructions for edit"
}
border={`1px solid #aa0`}
availableContextProviders={availableContextProviders.filter(
@@ -203,7 +210,9 @@ function Edit() {
{
ideMessenger.request("edit/acceptReject", {
accept: false,
@@ -217,7 +226,9 @@ function Edit() {
{
ideMessenger.request("edit/acceptReject", {
accept: true,
@@ -240,7 +251,7 @@ function Edit() {
className="mr-auto flex items-center gap-2"
>
- Back to chat
+ Back to Chat
diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx
index 6ca0cc167..27e9be2cd 100644
--- a/gui/src/pages/gui/Chat.tsx
+++ b/gui/src/pages/gui/Chat.tsx
@@ -136,7 +136,6 @@ export function Chat() {
const { streamResponse } = useChatHandler(dispatch, ideMessenger);
const onboardingCard = useOnboardingCard();
const { showTutorialCard, closeTutorialCard } = useTutorialCard();
- const sessionState = useSelector((state: RootState) => state.state);
const defaultModel = useSelector(defaultModelSelector);
const ttsActive = useSelector((state: RootState) => state.state.ttsActive);
const active = useSelector((state: RootState) => state.state.active);
@@ -148,7 +147,7 @@ export function Chat() {
const { saveSession, getLastSessionId, loadLastSession } =
useHistory(dispatch);
- const scrollToBottom = useCallback(() => {
+ const snapToBottom = useCallback(() => {
if (!topGuiDivRef.current) return;
const elem = topGuiDivRef.current;
elem.scrollTop = elem.scrollHeight - elem.clientHeight;
@@ -156,9 +155,26 @@ export function Chat() {
setIsAtBottom(true);
}, [topGuiDivRef, setIsAtBottom]);
+ const smoothScrollToBottom = useCallback(async () => {
+ if (!topGuiDivRef.current) return;
+ const elem = topGuiDivRef.current
+ elem.scrollTo({
+ top: elem.scrollHeight - elem.clientHeight,
+ behavior: 'smooth'
+ })
+
+ setIsAtBottom(true);
+ }, [topGuiDivRef, setIsAtBottom]);
+
useEffect(() => {
- if (active) scrollToBottom();
- }, [active, scrollToBottom]);
+ if (active) snapToBottom();
+ }, [active, snapToBottom]);
+
+ useEffect(() => {
+ setTimeout(() => {
+ smoothScrollToBottom();
+ }, 250)
+ }, [smoothScrollToBottom, state.sessionId]);
useEffect(() => {
// Cmd + Backspace to delete current step
@@ -284,8 +300,8 @@ export function Chat() {
}
},
[
- sessionState.history,
- sessionState.contextItems,
+ state.history,
+ state.contextItems,
defaultModel,
state,
streamResponse,
@@ -370,11 +386,11 @@ export function Chat() {
: true
: stepsOpen[index]!
}
- onToggle={() => {}}
+ onToggle={() => { }}
>
{}}
+ onUserInput={(input: string) => { }}
item={item}
- onReverse={() => {}}
+ onReverse={() => { }}
onRetry={() => {
streamResponse(
state.history[index - 1].editorState,
state.history[index - 1].modifiers ??
- defaultInputModifiers,
+ defaultInputModifiers,
ideMessenger,
index - 1,
);