Browse Source

fixup: i18n and icon minor changes

Yidadaa 1 year ago
parent
commit
35cec0f1df
5 changed files with 14 additions and 4 deletions
  1. 3 1
      app/components/chat.module.scss
  2. 7 3
      app/components/chat.tsx
  3. 0 0
      app/icons/break.svg
  4. 2 0
      app/locales/cn.ts
  5. 2 0
      app/locales/en.ts

+ 3 - 1
app/components/chat.module.scss

@@ -120,7 +120,6 @@
   justify-content: center;
   align-items: center;
 
-  opacity: 0.5;
   color: var(--black);
   transition: all ease 0.3s;
   cursor: pointer;
@@ -128,6 +127,8 @@
   position: relative;
   font-size: 12px;
 
+  animation: slide-in ease 0.3s;
+
   $linear: linear-gradient(
     to right,
     rgba(0, 0, 0, 0),
@@ -152,6 +153,7 @@
 
   &-tips {
     @include show;
+    opacity: 0.5;
   }
 
   &-revert-btn {

+ 7 - 3
app/components/chat.tsx

@@ -303,8 +303,12 @@ function ClearContextDivider() {
         )
       }
     >
-      <div className={chatStyle["clear-context-tips"]}>上下文已清除</div>
-      <div className={chatStyle["clear-context-revert-btn"]}>取消清除</div>
+      <div className={chatStyle["clear-context-tips"]}>
+        {Locale.Context.Clear}
+      </div>
+      <div className={chatStyle["clear-context-revert-btn"]}>
+        {Locale.Context.Revert}
+      </div>
     </div>
   );
 }
@@ -417,7 +421,7 @@ export function ChatActions(props: {
         className={`${chatStyle["chat-input-action"]} clickable`}
         onClick={() => {
           chatStore.updateCurrentSession((session) => {
-            if ((session.clearContextIndex ?? -1) > 0) {
+            if (session.clearContextIndex === session.messages.length) {
               session.clearContextIndex = -1;
             } else {
               session.clearContextIndex = session.messages.length;

File diff suppressed because it is too large
+ 0 - 0
app/icons/break.svg


+ 2 - 0
app/locales/cn.ts

@@ -175,6 +175,8 @@ const cn = {
     Toast: (x: any) => `包含 ${x} 条预设提示词`,
     Edit: "当前对话设置",
     Add: "新增预设对话",
+    Clear: "上下文已清除",
+    Revert: "恢复上下文",
   },
   Plugin: {
     Name: "插件",

+ 2 - 0
app/locales/en.ts

@@ -178,6 +178,8 @@ const en: RequiredLocaleType = {
     Toast: (x: any) => `With ${x} contextual prompts`,
     Edit: "Contextual and Memory Prompts",
     Add: "Add a Prompt",
+    Clear: "Context Cleared",
+    Revert: "Revert",
   },
   Plugin: {
     Name: "Plugin",

Some files were not shown because too many files changed in this diff