Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: collapsible transcript search + caret-follow in note editor

Louis Beaumontfc386c4a1675
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/note-editor.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/note-editor.tsx
index b42ddd2fc..3f8881b13 100644
--- a/apps/screenpipe-app-tauri/components/meeting-notes/note-editor.tsx
+++ b/apps/screenpipe-app-tauri/components/meeting-notes/note-editor.tsx
@@ -105,10 +105,20 @@ export function NoteEditor({
class: PROSE_CLASSES,
"data-testid": "note-editor",
},
+ // Keep the caret comfortably in view after Enter / typing near the
+ // viewport edge. ProseMirror walks up parent scroll containers, so this
+ // works for the outer overflow-y-auto wrapper too.
+ scrollThreshold: { top: 80, bottom: 96, left: 0, right: 0 },
+ scrollMargin: { top: 80, bottom: 96, left: 0, right: 0 },
},
onUpdate({ editor }) {
onChangeRef.current(getMarkdown(editor));
},
+ onSelectionUpdate({ editor }) {
+ // Belt-and-braces: arrow-key navigation and programmatic selection
+ // changes don't always flag scrollIntoView, so nudge it ourselves.
+ editor.commands.scrollIntoView();
+ },
});
// Sync external value → editor without clobbering the user's caret.
diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx
index fc265f137..d581cb959 100644
--- a/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx
+++ b/apps/screenpipe-app-tauri/components/meeting-notes/transcript-panel.tsx
@@ -16,6 +16,7 @@ import {
Check,
Copy,
Loader2,
+ Search,
User,
X,
} from "lucide-react";
@@ -257,6 +258,8 @@ export function TranscriptPanel({
const [loading, setLoading] = useState(false);
const [loaded, setLoaded] = useState(false);
const [query, setQuery] = useState("");
+ const [searchOpen, setSearchOpen] = useState(false);
+ const searchInputRef = useRef<HTMLInputElement | null>(null);
const [copied, setCopied] = useState(false);
const [liveBlocks, setLiveBlocks] = useState<LiveTranscriptBlock[]>([]);
const [liveStatus, setLiveStatus] = useState<LiveStreamingStatus | null>(
@@ -529,6 +532,19 @@ export function TranscriptPanel({
setHasUnseenLive(false);
}, [isOpen, meeting.id, query]);
+ useEffect(() => {
+ if (searchOpen) {
+ searchInputRef.current?.focus();
+ }
+ }, [searchOpen]);
+
+ useEffect(() => {
+ if (!isOpen) {
+ setSearchOpen(false);
+ setQuery("");
+ }
+ }, [isOpen]);
+
useEffect(() => {
if (!isOpen || !isLive || query.trim()) return;
if (!isFollowingLive) {
@@ -611,6 +627,27 @@ export function TranscriptPanel({
<header className="flex items-center justify-end px-4 py-3 border-b border-border shrink-0">
<div className="flex items-center gap-1">
{headerActions}
+ {showSearch && (
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={() => {
+ setSearchOpen((prev) => {
+ const next = !prev;
+ if (!next) setQuery("");
+ return next;
+ });
+ }}
+ className={cn(
+ "h-7 w-7 p-0",
+ searchOpen && "bg-accent text-accent-foreground",
+ )}
+ title={searchOpen ? "hide search" : "search transcript"}
+ aria-pressed={searchOpen}
+ >
+ <Search className="h-3.5 w-3.5" />
+ </Button>
+ )}
<Button
variant="ghost"
size="sm"
@@ -644,12 +681,20 @@ export function TranscriptPanel({
</div>
)}
- {showSearch && (
+ {showSearch && (searchOpen || Boolean(query.trim())) && (
<div className="px-4 py-2 border-b border-border shrink-0">
<input
+ ref={searchInputRef}
type="search"
value={query}
onChange={(e) => setQuery(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Escape") {
+ e.stopPropagation();
+ setQuery("");
+ setSearchOpen(false);
+ }
+ }}
placeholder="search transcript..."
className="w-full bg-transparent text-xs px-2 py-1 border border-input focus:outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50"
/>