Step control icons and layout adjustment (#1909)
* fix: layout alignment, colors and update icons * feat: add always show step controls on last step --------- Co-authored-by: Nate Sesti <33237525+sestinj@users.noreply.github.com>
This commit is contained in:
parent
6fc8ccc6c5
commit
5cb5df26c4
1 changed files with 91 additions and 95 deletions
|
|
@ -1,10 +1,9 @@
|
|||
import {
|
||||
ArrowUturnLeftIcon,
|
||||
BarsArrowDownIcon,
|
||||
HandThumbDownIcon,
|
||||
HandThumbUpIcon,
|
||||
TrashIcon,
|
||||
CubeIcon,
|
||||
ArrowPathIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import { ChatHistoryItem } from "core";
|
||||
import { stripImages } from "core/llm/images";
|
||||
|
|
@ -15,7 +14,6 @@ import {
|
|||
defaultBorderRadius,
|
||||
lightGray,
|
||||
vscBackground,
|
||||
vscButtonBackground,
|
||||
vscInputBackground,
|
||||
} from "..";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
|
|
@ -123,103 +121,101 @@ function StepContainer(props: StepContainerProps) {
|
|||
/>
|
||||
)}
|
||||
</ContentDiv>
|
||||
{(isHovered || typeof feedback !== "undefined") && !active && (
|
||||
<div
|
||||
className="flex gap-1 absolute -bottom-2 right-0"
|
||||
style={{
|
||||
zIndex: 200,
|
||||
color: lightGray,
|
||||
fontSize: getFontSize() - 3,
|
||||
}}
|
||||
>
|
||||
{props.modelTitle && (
|
||||
<div className="flex items-center">
|
||||
<CubeIcon className="w-3 h-4 mr-1 flex-shrink-0" />
|
||||
{props.modelTitle}
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: vscButtonBackground,
|
||||
borderColor: vscButtonBackground,
|
||||
}}
|
||||
className="w-px h-full ml-3 mr-1"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{truncatedEarly && (
|
||||
<HeaderButtonWithText
|
||||
text="Continue generation"
|
||||
onClick={(e) => {
|
||||
props.onContinueGeneration();
|
||||
}}
|
||||
>
|
||||
<BarsArrowDownIcon
|
||||
color={lightGray}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
)}
|
||||
|
||||
<CopyButton
|
||||
text={stripImages(props.item.message.content)}
|
||||
color={lightGray}
|
||||
/>
|
||||
<HeaderButtonWithText
|
||||
text="Regenerate"
|
||||
onClick={(e) => {
|
||||
props.onRetry();
|
||||
{(props.isLast || isHovered || typeof feedback !== "undefined") &&
|
||||
!active && (
|
||||
<div
|
||||
className="flex items-center gap-1 absolute -bottom-2 right-1"
|
||||
style={{
|
||||
zIndex: 200,
|
||||
color: lightGray,
|
||||
fontSize: getFontSize() - 3,
|
||||
}}
|
||||
>
|
||||
<ArrowUturnLeftIcon
|
||||
{props.subtext && (
|
||||
<>
|
||||
<div className="flex items-center">{props.subtext}</div>
|
||||
<div
|
||||
className="ml-2 mr-1"
|
||||
style={{
|
||||
width: "1px",
|
||||
height: "20px",
|
||||
backgroundColor: lightGray,
|
||||
}}
|
||||
></div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{truncatedEarly && (
|
||||
<HeaderButtonWithText
|
||||
text="Continue generation"
|
||||
onClick={(e) => {
|
||||
props.onContinueGeneration();
|
||||
}}
|
||||
>
|
||||
<BarsArrowDownIcon
|
||||
color={lightGray}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
)}
|
||||
|
||||
<CopyButton
|
||||
text={stripImages(props.item.message.content)}
|
||||
color={lightGray}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
{feedback === false || (
|
||||
<HeaderButtonWithText text="Helpful">
|
||||
<HandThumbUpIcon
|
||||
className={
|
||||
"cursor-pointer hover:text-green-500" +
|
||||
(feedback === true ? " text-green-500" : "")
|
||||
}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
color={lightGray}
|
||||
onClick={() => {
|
||||
sendFeedback(true);
|
||||
}}
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
)}
|
||||
{feedback === true || (
|
||||
<HeaderButtonWithText text="Unhelpful">
|
||||
<HandThumbDownIcon
|
||||
className={
|
||||
"cursor-pointer hover:text-red-500" +
|
||||
(feedback === false ? " text-red-500" : "")
|
||||
}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
color={lightGray}
|
||||
onClick={() => {
|
||||
sendFeedback(false);
|
||||
}}
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
)}
|
||||
<HeaderButtonWithText text="Delete Message">
|
||||
<TrashIcon
|
||||
color={lightGray}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
onClick={() => {
|
||||
props.onDelete();
|
||||
<HeaderButtonWithText
|
||||
text="Regenerate"
|
||||
onClick={(e) => {
|
||||
props.onRetry();
|
||||
}}
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
</div>
|
||||
)}
|
||||
>
|
||||
<ArrowPathIcon color={lightGray} width="1.2em" height="1.2em" />
|
||||
</HeaderButtonWithText>
|
||||
{feedback === false || (
|
||||
<HeaderButtonWithText text="Helpful">
|
||||
<HandThumbUpIcon
|
||||
className={
|
||||
"cursor-pointer hover:text-green-500" +
|
||||
(feedback === true ? " text-green-500" : "")
|
||||
}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
color={lightGray}
|
||||
onClick={() => {
|
||||
sendFeedback(true);
|
||||
}}
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
)}
|
||||
{feedback === true || (
|
||||
<HeaderButtonWithText text="Unhelpful">
|
||||
<HandThumbDownIcon
|
||||
className={
|
||||
"cursor-pointer hover:text-red-500" +
|
||||
(feedback === false ? " text-red-500" : "")
|
||||
}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
color={lightGray}
|
||||
onClick={() => {
|
||||
sendFeedback(false);
|
||||
}}
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
)}
|
||||
<HeaderButtonWithText text="Delete Message">
|
||||
<TrashIcon
|
||||
color={lightGray}
|
||||
width="1.2em"
|
||||
height="1.2em"
|
||||
onClick={() => {
|
||||
props.onDelete();
|
||||
}}
|
||||
/>
|
||||
</HeaderButtonWithText>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue