Very minor polish (#2445)

* fix minor polish

* cleaner chat flow

* remove keys

* slight robustification to copying
This commit is contained in:
pablodanswer
2024-09-14 10:54:29 -07:00
committed by GitHub
parent ee278522ef
commit a50c2e30ec
5 changed files with 8 additions and 10 deletions

View File

@@ -45,6 +45,7 @@ export function ChatBanner() {
shadow-sm
rounded
border-l-8 border-l-400
bg-background
border-r-4 border-r-200
border-border
border

View File

@@ -1124,9 +1124,9 @@ export function ChatPage({
await delay(50);
while (!stack.isComplete || !stack.isEmpty()) {
await delay(2);
await delay(0.5);
if (!stack.isEmpty()) {
if (!stack.isEmpty() && !controller.signal.aborted) {
const packet = stack.nextPacket();
if (!packet) {
continue;

View File

@@ -698,7 +698,8 @@ export async function useScrollonStream({
) {
// catch up if necessary!
const scrollAmount = scrollDist.current + 10000;
if (scrollDist.current > 140) {
if (scrollDist.current > 300) {
// if (scrollDist.current > 140) {
endDivRef.current.scrollIntoView();
} else {
blockActionRef.current = true;

View File

@@ -383,17 +383,13 @@ export const AIMessage = ({
// TODO: fix the fact that you have to double click to follow link
// for the first link
return (
<Citation
link={rest?.href}
key={node?.position?.start?.offset}
>
<Citation link={rest?.href}>
{rest.children}
</Citation>
);
} else {
return (
<a
key={node?.position?.start?.offset}
onMouseDown={() =>
rest.href
? window.open(rest.href, "_blank")
@@ -570,8 +566,8 @@ export const AIMessage = ({
<div
ref={hoverElementRef}
className={`
absolute -bottom-5
z-20
invisible ${(isHovering || isRegenerateHovered || settings?.isMobile) && "!visible"}
opacity-0 ${(isHovering || isRegenerateHovered || settings?.isMobile) && "!opacity-100"}
translate-y-2 ${(isHovering || settings?.isMobile) && "!translate-y-0"}