diff --git a/apps/desktop/src/app/chat/composer/index.tsx b/apps/desktop/src/app/chat/composer/index.tsx index d19c0a253..6d1be3907 100644 --- a/apps/desktop/src/app/chat/composer/index.tsx +++ b/apps/desktop/src/app/chat/composer/index.tsx @@ -407,13 +407,19 @@ export function ChatBar({ return } - const pastedText = event.clipboardData.getData('text') + // Trim surrounding whitespace so a copy that dragged along leading/trailing + // blank lines (common when selecting from terminals, code blocks, web pages) + // doesn't dump multiline padding into the composer. Internal newlines are + // preserved — only the edges are cleaned up. + const pastedText = event.clipboardData.getData('text').trim() if (!pastedText) { + event.preventDefault() + return } - if (DATA_IMAGE_URL_RE.test(pastedText.trim())) { + if (DATA_IMAGE_URL_RE.test(pastedText)) { event.preventDefault() return diff --git a/apps/desktop/src/app/chat/sidebar/session-row.tsx b/apps/desktop/src/app/chat/sidebar/session-row.tsx index 81359a6f8..aaa623faa 100644 --- a/apps/desktop/src/app/chat/sidebar/session-row.tsx +++ b/apps/desktop/src/app/chat/sidebar/session-row.tsx @@ -1,3 +1,4 @@ +import { useStore } from '@nanostores/react' import type * as React from 'react' import { Button } from '@/components/ui/button' @@ -6,6 +7,7 @@ import type { SessionInfo } from '@/hermes' import { sessionTitle } from '@/lib/chat-runtime' import { triggerHaptic } from '@/lib/haptics' import { cn } from '@/lib/utils' +import { $attentionSessionIds } from '@/store/session' import { SessionActionsMenu, SessionContextMenu } from './session-actions-menu' @@ -61,6 +63,10 @@ export function SidebarSessionRow({ const title = sessionTitle(session) const age = formatAge(session.last_active || session.started_at) const handleLabel = `Reorder ${title}` + // Subscribe per-row (the leaf) instead of drilling a set through the list — + // the atom is tiny and rarely non-empty. True when a clarify prompt in this + // session is waiting on the user. + const needsInput = useStore($attentionSessionIds).includes(session.id) return ( - {isWorking &&