From 0670b232d6dbe87d31181fd9bc3f871430cbc99e Mon Sep 17 00:00:00 2001 From: khushi sharma Date: Sun, 2 Aug 2026 22:36:16 +0530 Subject: [PATCH] feat: add learning journal insights for sessions --- client/src/main.jsx | 91 ++++++++++++++++++++++++++++++++++++++----- client/src/styles.css | 82 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+), 9 deletions(-) diff --git a/client/src/main.jsx b/client/src/main.jsx index ef3da3a9..7c7c3a5f 100644 --- a/client/src/main.jsx +++ b/client/src/main.jsx @@ -285,17 +285,90 @@ function Roadmap({ roadmap }) { } function SessionList({ sessions }) { + const [expanded, setExpanded] = useState(null); + return (
- {sessions.length ? sessions.slice(0, 6).map((session) => ( -
- -
- {session.scenario?.title} - {session.masterySignals.join(' / ')} -
-
- )) :

No sessions yet.

} + {sessions.length ? ( + sessions.slice(0, 6).map((session) => ( +
+ + +
+ {session.scenario?.title} + + + 📅 {new Date(session.createdAt).toLocaleDateString()} + + +

+ ⭐ Prompt Score: {session.promptScore ?? 0}/100 +

+ +
+ {session.masterySignals?.map((signal) => ( + + ✅ {signal} + + ))} +
+ + + {session.reflection && ( +
+ 💭 Reflection +

{session.reflection}

+
+ )} + + + + + + {expanded === session._id && ( +
+ + {session.misconceptions?.length > 0 && ( +
+ ⚠️ Misconceptions + + {session.misconceptions.map((item) => ( +

+ {item} +

+ ))} +
+ )} + + + 🧠 Code Explanation +

+ {session.codeExplanation} +

+ + + 🐍 Generated Code +
+                    {session.generatedCode}
+                  
+ +
+ )} + +
+
+ )) + ) : ( +

No sessions yet.

+ )}
); } diff --git a/client/src/styles.css b/client/src/styles.css index 70ac3f18..db7ad2a2 100644 --- a/client/src/styles.css +++ b/client/src/styles.css @@ -491,3 +491,85 @@ meter { grid-template-columns: 1fr; } } +/* Learning Journal */ + +.sessions article { + padding: 16px; + margin-bottom: 14px; + border-radius: 12px; + background: #ffffff; + border: 1px solid #e5e7eb; +} + +.sessions article > div { + display: flex; + flex-direction: column; + gap: 8px; +} + +.sessions small { + color: #6b7280; +} + + +/* Prompt Score */ + +.journal-score { + font-weight: 600; +} + + +/* Mastery signals */ + +.journal-mastery { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.journal-mastery span { + padding: 5px 10px; + border-radius: 20px; + background: #f3f4f6; + font-size: 14px; +} + + +/* Reflection */ + +.journal-reflection { + margin-top: 10px; + padding: 12px; + border-left: 4px solid #6366f1; + background: #f8fafc; +} + + +/* Details */ + +.journal-details { + margin-top: 12px; + padding: 12px; + border-radius: 10px; + background: #f9fafb; +} + + +/* Code block */ + +.journal-details pre { + padding: 12px; + overflow-x: auto; + border-radius: 8px; +} + + +/* Button */ + +.journal-details button, +.sessions button { + margin-top: 10px; + padding: 8px 14px; + border-radius: 8px; + cursor: pointer; +}