added: grade, subject and chapter in new chat, fixed that shitty card bug

This commit is contained in:
2026-08-18 04:44:10 -04:00
parent ab88ae30f1
commit 93a35a7343
24 changed files with 2683 additions and 66 deletions
@@ -3,9 +3,17 @@
======================================== */
import Message from "../message/Message";
import SelectorFlow from "../selector-flow/SelectorFlow";
import "./ChatHistory.css";
const ChatHistory = ({ messages, activeSubject, activeGrade, activeChapter, onPromptClick }) => {
const ChatHistory = ({
messages,
activeGrade,
onPromptClick,
isTyping,
showSelectorFlow,
onGradeChange,
}) => {
const hasMessages = messages.length > 0;
const suggestions = [
@@ -53,6 +61,8 @@ const ChatHistory = ({ messages, activeSubject, activeGrade, activeChapter, onPr
const fullPromptTexts = suggestions.map((s) => s.text + s.keywords.join(" ") + s.textEnd);
const streamingMsg = messages.find((m) => m.streaming);
if (hasMessages) {
return (
<div className="chat-history">
@@ -60,11 +70,23 @@ const ChatHistory = ({ messages, activeSubject, activeGrade, activeChapter, onPr
{messages.map((message) => (
<Message key={message.id} message={message} />
))}
{isTyping && !streamingMsg && (
<Message message={{ id: "typing", role: "assistant", text: "", streaming: true }} />
)}
<div ref={(el) => el && el.scrollIntoView({ behavior: "smooth", block: "end" })} />
</div>
</div>
);
}
if (showSelectorFlow) {
return (
<div className="chat-history">
<SelectorFlow grade={activeGrade} onGradeChange={onGradeChange} />
</div>
);
}
return (
<div className="chat-history">
<div className="chat-history__focus">