Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat(chat): mark completed reasoning timeline with a Done step

Akarshan Biswas93e005e4a549
diff --git a/web-app/src/components/ai-elements/reasoning-timeline.tsx b/web-app/src/components/ai-elements/reasoning-timeline.tsx
index 642993eba..d81384726 100644
--- a/web-app/src/components/ai-elements/reasoning-timeline.tsx
+++ b/web-app/src/components/ai-elements/reasoning-timeline.tsx
@@ -7,6 +7,7 @@ type StepRowProps = {
text?: string
connector?: boolean
children?: React.ReactNode
+ marker?: React.ReactNode
}
/**
@@ -15,12 +16,25 @@ type StepRowProps = {
* reasoning paragraph, or `children` to host arbitrary content (e.g. a tool
* call) on the same continuous rail.
*/
-export const StepRow = ({ text, connector = false, children }: StepRowProps) => (
+export const StepRow = ({
+ text,
+ connector = false,
+ children,
+ marker,
+}: StepRowProps) => (
<li className="relative flex gap-2.5">
{connector && (
<span className="absolute left-[3px] top-3.5 -bottom-2.5 border-l border-dotted border-border" />
)}
- <span className="relative z-10 mt-1.5 size-1.5 shrink-0 rounded-full bg-muted-foreground/40" />
+ {marker ? (
+ <span className="relative z-10 mt-1.5 flex size-1.5 shrink-0 items-center justify-center">
+ <span className="absolute flex items-center justify-center">
+ {marker}
+ </span>
+ </span>
+ ) : (
+ <span className="relative z-10 mt-1.5 size-1.5 shrink-0 rounded-full bg-muted-foreground/40" />
+ )}
{children ? (
<div className="min-w-0 flex-1">{children}</div>
) : (
diff --git a/web-app/src/containers/MessageItem.tsx b/web-app/src/containers/MessageItem.tsx
index 93b0ebba5..8230eecb7 100644
--- a/web-app/src/containers/MessageItem.tsx
+++ b/web-app/src/containers/MessageItem.tsx
@@ -31,6 +31,7 @@ import {
IconAlertTriangle,
IconChevronLeft,
IconChevronRight,
+ IconCircleCheck,
} from '@tabler/icons-react'
import { EditMessageDialog } from '@/containers/dialogs/EditMessageDialog'
import { DeleteMessageDialog } from '@/containers/dialogs/DeleteMessageDialog'
@@ -577,6 +578,15 @@ export const MessageItem = memo(
)
}
if (steps.length === 0) return null
+ steps.push(
+ <StepRow
+ key={`${message.id}-done`}
+ marker={
+ <IconCircleCheck className="size-4 text-muted-foreground/60" />
+ }
+ text={t('chat:done')}
+ />
+ )
return (
<ol className="relative flex flex-col gap-2.5">
{steps.map((step, i) =>
diff --git a/web-app/src/locales/ca/chat.json b/web-app/src/locales/ca/chat.json
index 00f3634bc..b9cf1d55e 100644
--- a/web-app/src/locales/ca/chat.json
+++ b/web-app/src/locales/ca/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Envia el missatge",
"newConversation": "Conversa nova",
- "clearHistory": "Neteja l’historial"
+ "clearHistory": "Neteja l’historial",
+ "done": "Done"
}
diff --git a/web-app/src/locales/cs/chat.json b/web-app/src/locales/cs/chat.json
index 9fb7fef8e..21c775bae 100644
--- a/web-app/src/locales/cs/chat.json
+++ b/web-app/src/locales/cs/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Odeslat zprávu",
"newConversation": "Nová konverzace",
- "clearHistory": "Vymazat historii"
+ "clearHistory": "Vymazat historii",
+ "done": "Done"
}
diff --git a/web-app/src/locales/de-DE/chat.json b/web-app/src/locales/de-DE/chat.json
index d76ceeca4..c426be3f1 100644
--- a/web-app/src/locales/de-DE/chat.json
+++ b/web-app/src/locales/de-DE/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Nachricht senden",
"newConversation": "Neue Konversation",
- "clearHistory": "Verlauf löschen"
+ "clearHistory": "Verlauf löschen",
+ "done": "Done"
}
diff --git a/web-app/src/locales/en/chat.json b/web-app/src/locales/en/chat.json
index 80cd672b8..c1cbf882f 100644
--- a/web-app/src/locales/en/chat.json
+++ b/web-app/src/locales/en/chat.json
@@ -16,5 +16,6 @@
"actions": {
"regenerate": "Regenerate response",
"continue": "Continue generating"
- }
-}
\ No newline at end of file
+ },
+ "done": "Done"
+}
diff --git a/web-app/src/locales/es/chat.json b/web-app/src/locales/es/chat.json
index 7afb5423a..c94f2d471 100644
--- a/web-app/src/locales/es/chat.json
+++ b/web-app/src/locales/es/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Enviar mensaje",
"newConversation": "Nueva conversación",
- "clearHistory": "Borrar historial"
+ "clearHistory": "Borrar historial",
+ "done": "Done"
}
diff --git a/web-app/src/locales/fr/chat.json b/web-app/src/locales/fr/chat.json
index a4c5941ff..8ef2482bf 100644
--- a/web-app/src/locales/fr/chat.json
+++ b/web-app/src/locales/fr/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Envoyer un message",
"newConversation": "Nouvelle conversation",
- "clearHistory": "Effacer l'historique"
-}
\ No newline at end of file
+ "clearHistory": "Effacer l'historique",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/hi/chat.json b/web-app/src/locales/hi/chat.json
index 92dbb2011..718712852 100644
--- a/web-app/src/locales/hi/chat.json
+++ b/web-app/src/locales/hi/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "संदेश भेजें",
"newConversation": "नई बातचीत",
- "clearHistory": "इतिहास हटाएँ"
-}
\ No newline at end of file
+ "clearHistory": "इतिहास हटाएँ",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/id/chat.json b/web-app/src/locales/id/chat.json
index 7c9bd6b8b..435ee5d97 100644
--- a/web-app/src/locales/id/chat.json
+++ b/web-app/src/locales/id/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Kirim Pesan",
"newConversation": "Percakapan Baru",
- "clearHistory": "Hapus Riwayat"
-}
\ No newline at end of file
+ "clearHistory": "Hapus Riwayat",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/it/chat.json b/web-app/src/locales/it/chat.json
index de3f3227e..e60bd10af 100644
--- a/web-app/src/locales/it/chat.json
+++ b/web-app/src/locales/it/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Invia messaggio",
"newConversation": "Nuova conversazione",
- "clearHistory": "Cancella cronologia"
+ "clearHistory": "Cancella cronologia",
+ "done": "Done"
}
diff --git a/web-app/src/locales/ja/chat.json b/web-app/src/locales/ja/chat.json
index 783892d7f..9e5352f03 100644
--- a/web-app/src/locales/ja/chat.json
+++ b/web-app/src/locales/ja/chat.json
@@ -12,5 +12,6 @@
"embeddings": {
"title": "ドキュメントを準備しています",
"description": "添付ファイルを検索・引用できるようにインデックスを作成しています。大きなドキュメントの場合は少し時間がかかることがあります。"
- }
+ },
+ "done": "Done"
}
diff --git a/web-app/src/locales/ko/chat.json b/web-app/src/locales/ko/chat.json
index ec6b3f0f8..8fd57dcc7 100644
--- a/web-app/src/locales/ko/chat.json
+++ b/web-app/src/locales/ko/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "메시지 보내기",
"newConversation": "새 대화",
- "clearHistory": "대화 기록 삭제"
+ "clearHistory": "대화 기록 삭제",
+ "done": "Done"
}
diff --git a/web-app/src/locales/pl/chat.json b/web-app/src/locales/pl/chat.json
index baa8b1407..fef992acf 100644
--- a/web-app/src/locales/pl/chat.json
+++ b/web-app/src/locales/pl/chat.json
@@ -8,5 +8,6 @@
"newConversation": "Nowa Rozmowa",
"clearHistory": "Wyczyść Historię",
"temporaryChat": "Tymczasowy Czat",
- "temporaryChatDescription": "Rozpocznij tymczasową rozmowę, która nie zostanie zapisana w historii czatów."
+ "temporaryChatDescription": "Rozpocznij tymczasową rozmowę, która nie zostanie zapisana w historii czatów.",
+ "done": "Done"
}
diff --git a/web-app/src/locales/pt-BR/chat.json b/web-app/src/locales/pt-BR/chat.json
index e637206b3..80b2841b5 100644
--- a/web-app/src/locales/pt-BR/chat.json
+++ b/web-app/src/locales/pt-BR/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Enviar Mensagem",
"newConversation": "Nova Conversa",
- "clearHistory": "Limpar Histórico"
-}
\ No newline at end of file
+ "clearHistory": "Limpar Histórico",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/ru/chat.json b/web-app/src/locales/ru/chat.json
index 43199f65b..e028082ed 100644
--- a/web-app/src/locales/ru/chat.json
+++ b/web-app/src/locales/ru/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Отправить сообщение",
"newConversation": "Новый диалог",
- "clearHistory": "Очистить историю"
-}
\ No newline at end of file
+ "clearHistory": "Очистить историю",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/vn/chat.json b/web-app/src/locales/vn/chat.json
index 25639e64d..838079e3f 100644
--- a/web-app/src/locales/vn/chat.json
+++ b/web-app/src/locales/vn/chat.json
@@ -8,5 +8,6 @@
},
"sendMessage": "Gửi tin nhắn",
"newConversation": "Cuộc trò chuyện mới",
- "clearHistory": "Xóa lịch sử"
-}
\ No newline at end of file
+ "clearHistory": "Xóa lịch sử",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/zh-CN/chat.json b/web-app/src/locales/zh-CN/chat.json
index 83564b385..efb121339 100644
--- a/web-app/src/locales/zh-CN/chat.json
+++ b/web-app/src/locales/zh-CN/chat.json
@@ -8,5 +8,6 @@
"newConversation": "新对话",
"clearHistory": "清除历史记录",
"temporaryChat": "临时聊天",
- "temporaryChatDescription": "开始一个临时对话,不会保存到您的聊天历史记录中。"
-}
\ No newline at end of file
+ "temporaryChatDescription": "开始一个临时对话,不会保存到您的聊天历史记录中。",
+ "done": "Done"
+}
diff --git a/web-app/src/locales/zh-TW/chat.json b/web-app/src/locales/zh-TW/chat.json
index 245ac1c25..a975c25b6 100644
--- a/web-app/src/locales/zh-TW/chat.json
+++ b/web-app/src/locales/zh-TW/chat.json
@@ -8,5 +8,6 @@
"newConversation": "新對話",
"clearHistory": "清除歷史記錄",
"temporaryChat": "臨時聊天",
- "temporaryChatDescription": "開始一個不會儲存到聊天歷史記錄的臨時對話。"
-}
\ No newline at end of file
+ "temporaryChatDescription": "開始一個不會儲存到聊天歷史記錄的臨時對話。",
+ "done": "Done"
+}