From 335197b32f97e83f9992c7935657b1fa5015abe0 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Mon, 22 May 2023 23:12:26 +0800 Subject: [PATCH 1/4] fix: #1668 should not summarize twice --- app/client/controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/app/client/controller.ts b/app/client/controller.ts index d28e72b0ef0..86cb99e7fee 100644 --- a/app/client/controller.ts +++ b/app/client/controller.ts @@ -28,7 +28,6 @@ export const ChatControllerPool = { remove(sessionIndex: number, messageId: number) { const key = this.key(sessionIndex, messageId); - this.controllers[key]?.abort(); delete this.controllers[key]; }, From 5688aa44a6881956aa62cfbf31cca95607f76678 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Mon, 22 May 2023 23:49:11 +0800 Subject: [PATCH 2/4] fix: #1681 replace svg icons with png icons --- app/components/exporter.module.scss | 3 +- app/components/exporter.tsx | 41 +++++++++++++++++++++------- app/icons/bot.png | Bin 0 -> 7308 bytes app/icons/chatgpt.png | Bin 0 -> 9596 bytes 4 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 app/icons/bot.png create mode 100644 app/icons/chatgpt.png diff --git a/app/components/exporter.module.scss b/app/components/exporter.module.scss index 1460ac7668f..7141bc0bd60 100644 --- a/app/components/exporter.module.scss +++ b/app/components/exporter.module.scss @@ -131,7 +131,8 @@ position: absolute; top: 0px; left: 0px; - transform: scale(2); + height: 50%; + transform: scale(1.5); } .main-title { diff --git a/app/components/exporter.tsx b/app/components/exporter.tsx index 1465d89a837..1f936625273 100644 --- a/app/components/exporter.tsx +++ b/app/components/exporter.tsx @@ -7,17 +7,19 @@ import { copyToClipboard, downloadAs, useMobileScreen } from "../utils"; import CopyIcon from "../icons/copy.svg"; import LoadingIcon from "../icons/three-dots.svg"; -import ChatGptIcon from "../icons/chatgpt.svg"; +import ChatGptIcon from "../icons/chatgpt.png"; import ShareIcon from "../icons/share.svg"; +import BotIcon from "../icons/bot.png"; import DownloadIcon from "../icons/download.svg"; import { useMemo, useRef, useState } from "react"; import { MessageSelector, useMessageSelector } from "./message-selector"; import { Avatar } from "./emoji"; -import { MaskAvatar } from "./mask"; import dynamic from "next/dynamic"; +import NextImage from "next/image"; import { toBlob, toPng } from "html-to-image"; +import { DEFAULT_MASK_AVATAR } from "../store/mask"; const Markdown = dynamic(async () => (await import("./markdown")).Markdown, { loading: () => , @@ -253,6 +255,22 @@ export function PreviewActions(props: { ); } +function ExportAvatar(props: { avatar: string }) { + if (props.avatar === DEFAULT_MASK_AVATAR) { + return ( + + ); + } + + return ; +} + export function ImagePreviewer(props: { messages: ChatMessage[]; topic: string; @@ -319,7 +337,12 @@ export function ImagePreviewer(props: { >
- +
@@ -328,9 +351,9 @@ export function ImagePreviewer(props: { github.com/Yidadaa/ChatGPT-Next-Web
- + & - +
@@ -358,11 +381,9 @@ export function ImagePreviewer(props: { key={i} >
- {m.role === "user" ? ( - - ) : ( - - )} +
diff --git a/app/icons/bot.png b/app/icons/bot.png new file mode 100644 index 0000000000000000000000000000000000000000..973799b5dc1392afde2f6185cc8af08baa4f4147 GIT binary patch literal 7308 zcmX|GbyQSexTRA`Nu?14>23rBq$P$fNlEFH2I=k?;73b`bT`NV(lK-lG4#+Nyz6^w zy;(WMGT+NH4+$+>ORp=5e5%n zMO@n#;(kK2s?=g=!O9@WLB>gVGo`mkMn(S{TH!45cRN*qA|^Ak#|?YwgNe!fdfY3V z#TS*mBSYkLw%m9MYK*1&3I=Uwk3?eGy~Ef_i23gd+xXU=VR0F(74_9KcoI8y%y@ zZYhu((!Z>fPC6NV0JlV%=B@R`l$m~Uc?Jox)TAqD>*6!EJvcHOJL_X67ovVl6ymqX5f92?#@Q$vu$hgh&uWKu2`ob6^wlLAw$~OaMTe^I$4`~(ROK*{NW=C|R zX`ly3tyEz%_e?`AJj|k01<}PXe(meYmO60eqyUy1{hL1lsx;CyLCl;CL zXi{xCMQ~Ik<16)w9yXQ}HxeeHa|fB#tv*~k8VX8MzxpGaUE*GVK~zmoVK!N56AyP~7^ z$__6>QH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9%jfM&23z?KReTi_Nk z=B)V!W3G{T`Zuq5@W8tM)4F00iN+6o$SdS71;PqsVQaOE>FbxqRPxsGo8ms_aA!@C z6p`5rlHlJ%ZYM)Ulj9Pa;0?eF)!+u8STFD-77kxs9EeCHQ){rYl^ z{?@Wmy<_oSN7fo5CWcjN$DiQ^Nb6+MN*7dz0za!ao6rQ;npb>jx?6~SJfL6fx z0F#?(2DTjJMD7={vCJc~r9E+h1dwR%C`*Bb<4&h8<7zT41*p}(`Me!PdhsIi<=c^Wi5RQ#-w(6N9|GTj0C;o={b~W*QVlb}l-R z53gF!<9q@1F}|-Xb#1xkFLmcyqS_3`)bl6+q7`6Gtm{@FY@w!KEd6E{)82=UKl4r& z9XA;$#I5{u*9LpE| zV>gSu1H)RhUV66(edu4qZ&UVU?b5&h42h6pQK?;syX_zdWv73`e|%VLof?-@`My>1 z`Tqm3vTTC82l@XCz(^Og+0TE{C;|&-WMV0&C&b2Y|F@jj2d|U1?}Q zZv0eItO>!4$Puzck#Pi!L)VV~@;DfL)Sd%{3C%hXg;Cy(^jbC?Yp+z>cHkKaA%K_= U28%xfi6WAMtm?;VY182U0ij-$_y7O^ literal 0 HcmV?d00001 diff --git a/app/icons/chatgpt.png b/app/icons/chatgpt.png new file mode 100644 index 0000000000000000000000000000000000000000..5e0df9de5c4cd324803ee776af34d3b7ae83bf5e GIT binary patch literal 9596 zcmXY%1yCE^+r@*sdvGo8?yiLb#ihk5?hY?dthhUY7MI}e?pEC0Dele}{_|xf*~w1i z?(W^^ob!8bxT=aA8ZrXnr7+fiW{K1E zpq3YS9&P;U$)z?)In$TkP=Y%tM|pr>L-_jU@OBU&UqC1&P`!or?wc*F2A3L53 zsRG;LsOd8emVh|im&;~Whn@<{BouQ89Rf+5=q%^fa&|^ac{$mc&v{3->SIFI2M3cU z8#zxiA<~3xek<)VCyt*4%C_l`%XJ+Ge9Ajp^{G!FlLSb^H|4xxwXRp0SfmMW34!>b`h+>$(TKn)K# z`(HI^Rfe?xKe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;M1}B}7#qXYWmvX?f*S)vk;*}dD%evt+ zOQ6iBG@Xlwuu~P3uX`UwiM8fAiU=>Cco4dm7kw1-pJvq=)8n=+}lgmc)`uUF(Z$L!70S6)F$C_;*&k(BvRB(bN~230_91nhP0 zL%aSYjJUo}lVo?x8H2j0w0z(_h<(+5ntRY1Fejy&!&~{B0FXzboq3q?mY&)9+@n;WufP>bkRxj8v`DF3Rc2-0I-5@|R|@mJV?`?5;u zK>-}&vQ1S|K$EI^Gqu-8rl$;^h#8-7&N*>H2q-KJ@HD3u{FivG=2R{r&FOFdc2;ncL}D9KG)ShiAX$`u7A2Ljk*M(Z81dyXL}EkxIj#Kf#OZ-_Nv% zm!Fh}oIh5%)Jp6)^Dze8uT}x@{WTg&+&h<^3LUyRf+Q!7Q1P>{xsvpUc4@Ex08M^w z0xLa;bfIifc9)J>P_c#4(0(O*KXvA148Z8B0swwW?cU@M+?8n+F=#`UAAIy%oNr3j z_k!4&185b_#}~6r;KB=JAr)BUkeDgeAW+hmJv8|sOf_F(#&}ZpXlIO&mHF^w%R_Gd zJB&pr#sp+Yngt~agWtknP_%+rX(5em$R!{*HWK^UpB#nOlA2%+T AG5`Po literal 0 HcmV?d00001 From 213498ee44db7a9ff0603eecb42f3ae87c1e67bb Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Mon, 22 May 2023 23:52:09 +0800 Subject: [PATCH 3/4] chore: wont send system info if user use a mask --- app/store/chat.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index 1c82f9e04ef..3c9953e58f5 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -257,7 +257,12 @@ export const useChatStore = create()( }); // get recent messages - const systemMessages = [systemInfo]; + const systemMessages = []; + // if user define a mask with context prompts, wont send system info + if (session.mask.context.length === 0) { + systemMessages.push(systemInfo); + } + const recentMessages = get().getMessagesWithMemory(); const sendMessages = systemMessages.concat( recentMessages.concat(userMessage), @@ -345,7 +350,7 @@ export const useChatStore = create()( // wont send cleared context messages const clearedContextMessages = session.messages.slice( - (session.clearContextIndex ?? 0), + session.clearContextIndex ?? 0, ); const messages = clearedContextMessages.filter((msg) => !msg.isError); const n = messages.length; From 46016b91e6605c7ec29dcd05797db5eadb813fa6 Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Mon, 22 May 2023 23:59:11 +0800 Subject: [PATCH 4/4] fixup --- app/components/exporter.module.scss | 4 ++++ app/components/exporter.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/components/exporter.module.scss b/app/components/exporter.module.scss index 7141bc0bd60..3fde363f009 100644 --- a/app/components/exporter.module.scss +++ b/app/components/exporter.module.scss @@ -185,6 +185,10 @@ max-width: calc(100% - 104px); box-shadow: var(--card-shadow); border: var(--border-in-light); + + * { + overflow: hidden; + } } &-assistant { diff --git a/app/components/exporter.tsx b/app/components/exporter.tsx index 1f936625273..39280809411 100644 --- a/app/components/exporter.tsx +++ b/app/components/exporter.tsx @@ -386,7 +386,7 @@ export function ImagePreviewer(props: { />
-
+