2026-03-02T08-39-52_auto_memory/memories.db-wal

This commit is contained in:
Nicholai Vogel 2026-03-02 01:39:52 -07:00
parent 56bb82c9ec
commit 38078ab89d
4 changed files with 106 additions and 0 deletions

View File

@ -0,0 +1,106 @@
import { useCallback } from "react";
interface StepReviewProps {
extractedText: string;
trimmedText: string;
onExtractedChange: (text: string) => void;
onTrimmedChange: (text: string) => void;
}
const BOILERPLATE_PATTERNS = [
/^(Sure!|Of course!|Here('s| is)|Absolutely!|Certainly!|Based on our conversations?,?)\s*/i,
/^(I('d| would) be happy to|Let me summarize|Here's what I know)\s*/i,
/\n*(Let me know if|Is there anything|Feel free to|Hope this helps|I hope this).*/gi,
];
export default function StepReview({
extractedText,
trimmedText,
onExtractedChange,
onTrimmedChange,
}: StepReviewProps) {
const wordCount = trimmedText.trim().split(/\s+/).filter(Boolean).length;
const charCount = trimmedText.length;
const handleTrimBoilerplate = useCallback(() => {
let cleaned = extractedText;
for (const pattern of BOILERPLATE_PATTERNS) {
cleaned = cleaned.replace(pattern, "");
}
onTrimmedChange(cleaned.trim());
}, [extractedText, onTrimmedChange]);
const handleResetTrim = useCallback(() => {
onTrimmedChange(extractedText);
}, [extractedText, onTrimmedChange]);
return (
<div className="space-y-6">
<div>
<h2 className="text-2xl font-bold text-text mb-2">
Review Your Memory Export
</h2>
<p className="text-text-muted">
Paste what ChatGPT gave you below. You can edit it before importing
into Claude.
</p>
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-4">
<div className="space-y-2">
<div className="flex items-center justify-between">
<label className="text-sm font-medium text-text-muted">
Paste from ChatGPT
</label>
{extractedText && (
<button
onClick={handleTrimBoilerplate}
className="text-xs text-primary-light hover:text-primary transition-colors"
>
Trim boilerplate
</button>
)}
</div>
<textarea
value={extractedText}
onChange={(e) => onExtractedChange(e.target.value)}
placeholder="Paste ChatGPT's response here..."
className="w-full h-64 lg:h-80 rounded-xl bg-surface-muted border border-surface-border p-4 text-sm text-text placeholder:text-text-muted/50 resize-none focus:outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/25 font-mono"
/>
</div>
<div className="space-y-2">
<div className="flex items-center justify-between">
<label className="text-sm font-medium text-text-muted">
Preview (editable)
</label>
{trimmedText !== extractedText && (
<button
onClick={handleResetTrim}
className="text-xs text-text-muted hover:text-text transition-colors"
>
Reset
</button>
)}
</div>
<textarea
value={trimmedText}
onChange={(e) => onTrimmedChange(e.target.value)}
placeholder="Your cleaned-up profile will appear here..."
className="w-full h-64 lg:h-80 rounded-xl bg-surface-muted border border-surface-border p-4 text-sm text-text placeholder:text-text-muted/50 resize-none focus:outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/25 font-mono"
/>
</div>
</div>
<div className="flex items-center gap-4 text-xs text-text-muted">
<span>{wordCount} words</span>
<span>{charCount.toLocaleString()} characters</span>
{charCount > 10000 && (
<span className="text-yellow-400">
Consider trimming shorter profiles import more cleanly
</span>
)}
</div>
</div>
);
}

Binary file not shown.