Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: truncate long task prompts on task cards with expand toggle

Adam Eivy462f081c3aea
diff --git a/client/src/components/cos/tabs/TaskItem.jsx b/client/src/components/cos/tabs/TaskItem.jsx
index c8cf5ce37e..1bd7b10a13 100644
--- a/client/src/components/cos/tabs/TaskItem.jsx
+++ b/client/src/components/cos/tabs/TaskItem.jsx
@@ -15,7 +15,9 @@ import {
ExternalLink,
AlertCircle,
TrendingUp,
- Play
+ Play,
+ ChevronDown,
+ ChevronUp
} from 'lucide-react';
import toast from '../../ui/Toast';
import * as api from '../../../services/api';
@@ -108,6 +110,13 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
const { isConfirming, requestDelete, cancelDelete, confirmDelete } = useConfirmDelete();
const blockedInputRef = useRef(null);
+ // Collapse long task prompts to the first couple of lines with an expand
+ // toggle. `isOverflowing` is measured against the clamped element so the
+ // toggle only appears when the description actually spills past two lines.
+ const [promptExpanded, setPromptExpanded] = useState(false);
+ const [isOverflowing, setIsOverflowing] = useState(false);
+ const descRef = useRef(null);
+
// Focus input when modal opens
useEffect(() => {
if (showBlockedModal && blockedInputRef.current) {
@@ -115,6 +124,17 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
}
}, [showBlockedModal]);
+ // Measure overflow while the prompt is collapsed. Kept sticky when expanded
+ // (removing the clamp collapses scrollHeight, which would otherwise hide the
+ // toggle mid-expand); recomputed only on the collapsed path when the text
+ // changes so an edit that shortens the prompt clears a stale toggle.
+ useEffect(() => {
+ if (promptExpanded) return;
+ const el = descRef.current;
+ if (!el) return;
+ setIsOverflowing(el.scrollHeight > el.clientHeight + 1);
+ }, [task.description, promptExpanded, editing]);
+
// Get models for selected provider in edit mode
const editProvider = providers?.find(p => p.id === editData.provider);
const editModels = filterSelectableModels(editProvider?.models);
@@ -340,7 +360,25 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
</div>
) : (
<>
- <p className="text-white">{task.description}</p>
+ <p
+ ref={descRef}
+ className={`text-white whitespace-pre-wrap ${promptExpanded ? '' : 'line-clamp-2'}`}
+ >
+ {task.description}
+ </p>
+ {(isOverflowing || promptExpanded) && (
+ <button
+ onClick={() => setPromptExpanded(v => !v)}
+ className="flex items-center gap-0.5 mt-0.5 text-xs text-port-accent hover:text-port-accent/80 transition-colors"
+ aria-expanded={promptExpanded}
+ >
+ {promptExpanded ? (
+ <><ChevronUp size={12} aria-hidden="true" /> Show less</>
+ ) : (
+ <><ChevronDown size={12} aria-hidden="true" /> Show more</>
+ )}
+ </button>
+ )}
{task.metadata?.context && (
<p className="text-sm text-gray-500 mt-1">{task.metadata.context}</p>
)}