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

fix(markdown): text selection highlight wraps text only (#4963)

Harsh Kumar6b48492d15b7
diff --git a/apps/screenpipe-app-tauri/app/globals.css b/apps/screenpipe-app-tauri/app/globals.css
index b432b17b5..b8d738cd2 100644
--- a/apps/screenpipe-app-tauri/app/globals.css
+++ b/apps/screenpipe-app-tauri/app/globals.css
@@ -324,6 +324,27 @@
background-color: rgba(59, 130, 246, 0.35) !important;
}
+ /* Constrain selection highlight to text width — same approach as chat markdown.
+ flex + items-start makes block children shrink-wrap their content so
+ ::selection doesn't paint across the full container width. */
+ .ProseMirror {
+ display: flex;
+ flex-direction: column;
+ align-items: start;
+ }
+
+ /* Keep code blocks, details, hr, and tables full-width inside flex prose */
+ .prose > .not-prose,
+ .prose > hr,
+ .prose > table,
+ .ProseMirror > .not-prose,
+ .ProseMirror > hr,
+ .ProseMirror > table,
+ .ProseMirror > pre,
+ .ProseMirror > [data-type="taskList"] {
+ align-self: stretch;
+ }
+
.prose a,
.prose a * {
cursor: pointer !important;
diff --git a/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx b/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx
index 2da1c0e27..1b445107e 100644
--- a/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx
+++ b/apps/screenpipe-app-tauri/components/chat/markdown-block.tsx
@@ -43,7 +43,7 @@ export function MarkdownBlock({
return (
<MemoizedReactMarkdown
className={cn(
- "prose prose-sm max-w-full break-words overflow-hidden [word-break:break-word]",
+ "prose prose-sm max-w-full break-words overflow-hidden [word-break:break-word] flex flex-col items-start",
isUser ? "text-foreground dark:prose-invert" : "dark:prose-invert",
)}
remarkPlugins={[remarkGfm]}