Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
deaa36a
refactor: replace Toaster with CustomToaster component and update sty…
aditya-2k23 Apr 30, 2026
b763c74
Add react-markdown dependency to enhance markdown rendering capabilities
aditya-2k23 Apr 30, 2026
551e036
feat: add StyleTools component for markdown formatting and enhance Jo…
aditya-2k23 Apr 30, 2026
f3e6ac7
fix: change console.log to console.error for better error handling in…
aditya-2k23 Apr 30, 2026
36a326e
refactor: optimize deleteCollectionTree function to use batching and …
aditya-2k23 Apr 30, 2026
6c52d03
refactor: restructure Firebase initialization to handle missing envir…
aditya-2k23 Apr 30, 2026
f52c83e
chore: update version to 3.1.0 in package.json and remove redundant r…
aditya-2k23 Apr 30, 2026
47f8804
refactor: enhance styling and transitions for UI components in global…
aditya-2k23 Apr 30, 2026
ded8d03
refactor: extract design tokens for consistent theming and update glo…
aditya-2k23 Apr 30, 2026
d866ae3
Add richtext markdown style formatting for text in journal textarea a…
aditya-2k23 May 2, 2026
907bfae
journal textbox autosize and page-scroll
aditya-2k23 May 2, 2026
14fe3bb
fine I'll work with this!
aditya-2k23 May 2, 2026
8de362d
Fixed some color styling
aditya-2k23 May 2, 2026
566620a
Done with the animations
aditya-2k23 May 2, 2026
df2a5f3
style(ui): improve background styling and dark mode opacity
aditya-2k23 May 2, 2026
e480a45
chore(security): allow loom.com in CSP headers
aditya-2k23 May 2, 2026
2fab408
style(ui): refine visual consistency and interaction feedback
aditya-2k23 May 2, 2026
60d6b87
fix(ui): improve accessibility, save logic, and component stability
aditya-2k23 May 2, 2026
79aabd2
feat(ui): enhance footer with logo and creator attribution
aditya-2k23 May 5, 2026
9a9332e
style(ui): enhance button spacing and text visibility in AIInsightsSe…
aditya-2k23 May 5, 2026
f3d9c71
style(css): update transition properties and improve gradient definit…
aditya-2k23 May 5, 2026
1cbb618
fix(ui): enhance toast animations, improve input focus styles, and up…
aditya-2k23 May 5, 2026
6ac6ab8
feat(ui): enhance journal prompt instructions with rich text formatti…
aditya-2k23 May 5, 2026
90d74aa
feat(ui): integrate Loader component for loading states in Logout, Fi…
aditya-2k23 May 5, 2026
ab07edd
feat(ui): implement smooth splash screen animation and enforce minimu…
aditya-2k23 May 5, 2026
a931c48
feat(ui): enhance chat experience with Tiptap editor integration, mar…
aditya-2k23 May 5, 2026
964819b
fix(api): sanitize chat content and improve message previews in chat …
aditya-2k23 May 5, 2026
7c80d49
feat(ui): enhance chat components with markdown support and style imp…
aditya-2k23 May 5, 2026
3f16432
feat(ui): add underline support to RichTextEditor and StyleTools; enh…
aditya-2k23 May 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ yarn-error.log*
next-env.d.ts

.vscode
# Ignore Git Commit Genie data
.gitgenie/**
7 changes: 0 additions & 7 deletions AGENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ Users log:
- **AI**: Google Gemini (@google/generative-ai SDK)
- **Language**: JavaScript

Do NOT:

- Introduce Redux, Zustand, or new state libraries
- Introduce new backend frameworks
- Add experimental dependencies without strong reason

---

## 📁 Project Structure (Mental Model)
Expand Down Expand Up @@ -133,7 +127,6 @@ When fixing bugs:

Agents must NOT:

- Rewrite large files without request
- Change formatting or lint rules arbitrarily
- Rename variables for “style”
- Add features unless explicitly asked
Expand Down
15 changes: 13 additions & 2 deletions app/actions/insights.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ function buildPrompt(journalEntry) {
- You NEVER sound like a therapist, a bot, or a report. You sound like a girl who genuinely cares and is reading their journal.
- These phrases are banned forever: "I hear you", "that's valid", "it sounds like", "it's okay to feel", "as an AI", "I understand that", "I notice a pattern"

ABOUT THE JOURNAL:
The user writes their journal entries using a rich text editor that supports formatting — bold, italics, headings (H1, H2), and blockquotes. Pay attention to how they've formatted their entry. Bold text usually signals something they want to emphasize. Italics often carry softer, more reflective thoughts. Headings may structure a longer entry into sections. Blockquotes may be something they've heard, remembered, or want to reflect on. Let these formatting cues shape your understanding of what matters most to them today.

JOURNAL ENTRY:
"""
${journalEntry}
Expand All @@ -255,18 +258,21 @@ function buildPrompt(journalEntry) {
2. TRIGGERS — 2 to 4 short phrases (1-3 words each):
- Pulled directly from what they actually wrote
- Specific events, people, or themes mentioned — not generic labels
- If something is bolded or emphasized, it's likely a trigger worth calling out
- Examples: "missed deadline", "toxic coworker", "no sleep", "good news from mom"

3. RESPONSE — a warm, personal paragraph (3-5 sentences) written like a best friend reacting to their journal:
- Open with your immediate emotional reaction to what they shared — make it feel real, not scripted
- Mention something specific from their entry so they know you actually read it
- Mention something specific from their entry so they know you actually read it — especially anything they emphasized with bold or italic
- Make sure you also, use the ability of the text editor formatting to show that you see the nuances in their feelings.
- Celebrate the win OR sit with them in the hard feeling — don't rush past either
- Keep it warm, a little conversational, sprinkle emojis naturally where a person actually would 🥺
- NO bullet points, NO lists — just natural flowing prose like a friend texting a longer message
- Do NOT end with a question here — the follow-up question is separate

4. FOCUS — one specific thing from their entry (a problem OR a positive moment) that you're zooming in on:
- Should be a short phrase, not a sentence
- Prioritize something they formatted with emphasis if it exists — that formatting is intentional
- This is what the follow-up question will be anchored to

5. FOLLOW-UP QUESTION — one question that flows naturally from the focus:
Expand All @@ -292,6 +298,9 @@ function buildPartialPrompt(journalEntry, cachedMood, cachedTriggers, cachedHead
- Things on their mind lately: ${cachedTriggers.join(", ")}
- Last headline you gave them: "${cachedHeadline}"

ABOUT THE JOURNAL:
The user writes their journal entries using a rich text editor that supports bold, italics, headings (H1, H2), and blockquotes. If their entry includes formatted text, treat it as intentional emphasis. Bold usually signals something important or emotionally charged. Italics often carry softer reflections or hesitant thoughts. Headings may segment a longer entry into distinct moments. Blockquotes may be something they heard, remembered, or want to sit with. Let these cues guide where you focus your response.

WHAT THEY WROTE TODAY:
"""
${journalEntry}
Expand All @@ -301,14 +310,16 @@ function buildPartialPrompt(journalEntry, cachedMood, cachedTriggers, cachedHead
1. RESPONSE — a warm, personal paragraph (3-5 sentences) written like a best friend reacting to today's entry:
- Gently acknowledge that this feeling or situation has been coming up — but do it warmly, like a friend who notices and cares, not like a system detecting a pattern
- Example tone: "hey, this keeps coming up and I just wanna make sure you're okay 🥺" — NOT "I notice a recurring pattern in your entries"
- React to something specific in TODAY's entry — show you read this one, not just the last
- React to something specific in TODAY's entry — show you read this one, not just the last. If they bolded or italicized something, that's worth acknowledging
- Use the formatting cues to show you see the nuances in their feelings today.
- Keep it warm, conversational, with emojis where they naturally fit
- NO bullet points, NO lists — flowing prose only
- Do NOT end with a question here

2. FOCUS — one specific thing from today's entry to zoom in on:
- Short phrase, not a sentence
- Should be something slightly different from the previous focus to help them explore a new angle
- Formatted or emphasized text from their entry is often the best place to look

3. FOLLOW-UP QUESTION — one fresh question from a new angle:
- Try a different angle from what you asked before — help them explore something they haven't said yet
Expand Down
14 changes: 11 additions & 3 deletions app/api/chat/history/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,13 @@ export async function GET(req) {
const sId = data.sessionId || "default";

if (!groupedSessions[sId]) {
let cleanContent = data.content || "";
if (typeof cleanContent === "string") {
cleanContent = cleanContent.trim().replace(/^["']+|["']+$/g, "");
}
Comment on lines +68 to +71
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Inconsistent quote-stripping regex between assistant bubbles and other paths.

Line 70 and Line 93 use /^["']+|["']+$/g (greedy — strips all leading/trailing quote chars), while Line 86 uses /^["']|["']$/g (strips only a single char on each end). For the same source content, the preview, assistant bubble content, and non-assistant content can therefore disagree on how much quoting is removed. Pick one regex and apply consistently — preferably a "single matched pair" pattern so legitimate dialogue quotes within messages aren't clobbered:

♻️ Suggested helper
+const stripWrappingQuotes = (str) => {
+  if (typeof str !== "string") return str;
+  const trimmed = str.trim();
+  const match = trimmed.match(/^(["'])([\s\S]*)\1$/);
+  return match ? match[2] : trimmed;
+};

…then call stripWrappingQuotes(...) at all three sites.

This issue is paired with the same concern raised in app/api/chat/route.js Lines 595-597.

Also applies to: 86-86, 91-94

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/api/chat/history/route.js` around lines 68 - 71, Replace the inconsistent
greedy/one-char regexes with a single helper function stripWrappingQuotes(text)
that removes exactly one matched pair of wrapping single or double quotes (e.g.,
using a regex that captures a leading quote and ensures the trailing quote
matches it) and use that helper wherever the code currently trims on
cleanContent/preview/assistant content (references: the cleanContent variable,
the assistant bubble content generation, and the non-assistant/preview content
path). Ensure all three sites call stripWrappingQuotes(...) after trim() so
quoting behavior is identical across preview, assistant bubble, and other
content paths.

groupedSessions[sId] = {
sessionId: sId,
preview: (data.content || "").substring(0, 40) + ((data.content || "").length > 40 ? '...' : ''),
preview: cleanContent.substring(0, 40) + (cleanContent.length > 40 ? '...' : ''),
messages: []
};
}
Expand All @@ -79,15 +83,19 @@ export async function GET(req) {
groupedSessions[sId].messages.push({
id: `${doc.id}_${index}`,
role: "assistant",
content: bubble,
content: bubble.trim().replace(/^["']|["']$/g, ""),
timestamp,
});
});
} else {
let cleanContent = data.content;
if (typeof cleanContent === "string") {
cleanContent = cleanContent.trim().replace(/^["']+|["']+$/g, "");
}
groupedSessions[sId].messages.push({
id: doc.id,
role: data.role,
content: data.content,
content: cleanContent,
timestamp,
});
}
Expand Down
Loading
Loading